diff --git a/units/src/amount.rs b/units/src/amount.rs index cc084d23d..c4195a3ec 100644 --- a/units/src/amount.rs +++ b/units/src/amount.rs @@ -1593,6 +1593,14 @@ impl core::iter::Sum for SignedAmount { } } +#[cfg(feature = "arbitrary")] +impl<'a> Arbitrary<'a> for SignedAmount { + fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result { + let s = i64::arbitrary(u)?; + Ok(SignedAmount(s)) + } +} + /// Calculates the sum over the iterator using checked arithmetic. pub trait CheckedSum: private::SumSeal { /// Calculates the sum over the iterator using checked arithmetic. If an over or underflow would