zebra_chain/amount/arbitrary.rs
1//! Randomised test case generation for amounts.
2
3use proptest::prelude::*;
4
5use crate::amount::*;
6
7impl<C> Arbitrary for Amount<C>
8where
9 C: Constraint + std::fmt::Debug,
10{
11 type Parameters = ();
12
13 fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy {
14 C::valid_range().prop_map(|v| Self(v, PhantomData)).boxed()
15 }
16
17 type Strategy = BoxedStrategy<Self>;
18}