|
@@ -28,20 +28,20 @@ macro_rules! protos_def {
|
|
}
|
|
}
|
|
|
|
|
|
$proto_macro! { $wallet_spend,
|
|
$proto_macro! { $wallet_spend,
|
|
- [ W: Wallet { randid: R, balance: H },
|
|
|
|
- I: Item { serialno: H, price: H } ],
|
|
|
|
- N: Wallet { randid: J, balance: H },
|
|
|
|
- (0..=100000000).contains(N.balance),
|
|
|
|
- W.balance = N.balance + I.price
|
|
|
|
- }
|
|
|
|
|
|
+ [ W: Wallet { randid: R, balance: H },
|
|
|
|
+ I: Item { serialno: H, price: H } ],
|
|
|
|
+ N: Wallet { randid: J, balance: H },
|
|
|
|
+ (0..=100000000).contains(N.balance),
|
|
|
|
+ W.balance = N.balance + I.price
|
|
|
|
+ }
|
|
|
|
|
|
$proto_macro! { $wallet_spend_with_fee<fee>,
|
|
$proto_macro! { $wallet_spend_with_fee<fee>,
|
|
- [ W: Wallet { randid: R, balance: H },
|
|
|
|
- I: Item { serialno: H, price: H } ],
|
|
|
|
- N: Wallet { randid: J, balance: H },
|
|
|
|
- (0..=100000000).contains(N.balance),
|
|
|
|
- W.balance = N.balance + I.price + fee
|
|
|
|
- }
|
|
|
|
|
|
+ [ W: Wallet { randid: R, balance: H },
|
|
|
|
+ I: Item { serialno: H, price: H } ],
|
|
|
|
+ N: Wallet { randid: J, balance: H },
|
|
|
|
+ (0..=100000000).contains(N.balance),
|
|
|
|
+ W.balance = N.balance + I.price + fee
|
|
|
|
+ }
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
fn $test_wallet() -> Result<(), CMZError> {
|
|
fn $test_wallet() -> Result<(), CMZError> {
|