Procházet zdrojové kódy

Enable the range statements in the wallet test

Ian Goldberg před 3 měsíci
rodič
revize
aedf3fbda9
2 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 2 2
      README.md
  2. 2 2
      tests/wallet.rs

+ 2 - 2
README.md

@@ -104,7 +104,7 @@ The primary way to create a protocol is with the `muCMZProtocol!` macro.
       [ W: Wallet { randid: R, balance: H },
         I: Item { serialno: H, price: H } ],
       N: Wallet { randid: J, balance: H },
-      N.balance >= 0,
+      (0..=100000000).contains(N.balance),
       W.balance = N.balance + I.price
     }
 ```
@@ -309,7 +309,7 @@ example:
       [ W: Wallet { randid: R, balance: H },
         I: Item { serialno: H, price: H } ],
       N: Wallet { randid: J, balance: H },
-      N.balance >= 0,
+      (0..=100000000).contains(N.balance),
       W.balance = N.balance + I.price + fee
     }
 ```

+ 2 - 2
tests/wallet.rs

@@ -31,7 +31,7 @@ macro_rules! protos_def {
                   [ W: Wallet { randid: R, balance: H },
                     I: Item { serialno: H, price: H } ],
                   N: Wallet { randid: J, balance: H },
-        //          N.balance >= 0,
+                  (0..=100000000).contains(N.balance),
                   W.balance = N.balance + I.price
                 }
 
@@ -39,7 +39,7 @@ macro_rules! protos_def {
                  [ W: Wallet { randid: R, balance: H },
                    I: Item { serialno: H, price: H } ],
                  N: Wallet { randid: J, balance: H },
-        //         N.balance >= 0,
+                 (0..=100000000).contains(N.balance),
                  W.balance = N.balance + I.price + fee
                }