1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Randomised test case generation for amounts.

use proptest::prelude::*;

use crate::amount::*;

impl<C> Arbitrary for Amount<C>
where
    C: Constraint + std::fmt::Debug,
{
    type Parameters = ();

    fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy {
        C::valid_range().prop_map(|v| Self(v, PhantomData)).boxed()
    }

    type Strategy = BoxedStrategy<Self>;
}