Răsfoiți Sursa

fix genesis_mint unit test

x 2 ani în urmă
părinte
comite
89da561315
1 a modificat fișierele cu 7 adăugiri și 7 ștergeri
  1. 7 7
      src/contract/money/tests/genesis_mint.rs

+ 7 - 7
src/contract/money/tests/genesis_mint.rs

@@ -157,14 +157,14 @@ fn genesis_mint() -> Result<()> {
 
         th.assert_trees(&HOLDERS);
 
+        // Bob should have his old OwnCoin, and this new one.
+        let bob_oc = th.gather_owncoin(&Holder::Bob, &transfer_params.outputs[0], None)?;
+        bob_owncoins.push(bob_oc);
+
         // Alice should now have one OwnCoin with the change from the above transaction.
-        let alice_oc = th.gather_owncoin(&Holder::Alice, &transfer_params.outputs[0], None)?;
+        let alice_oc = th.gather_owncoin(&Holder::Alice, &transfer_params.outputs[1], None)?;
         alice_owncoins.push(alice_oc);
 
-        // Bob should have his old one, and this new one.
-        let bob_oc = th.gather_owncoin(&Holder::Bob, &transfer_params.outputs[1], None)?;
-        bob_owncoins.push(bob_oc);
-
         assert!(alice_owncoins.len() == 1);
         assert!(bob_owncoins.len() == 2);
 
@@ -193,11 +193,11 @@ fn genesis_mint() -> Result<()> {
         th.assert_trees(&HOLDERS);
 
         // Alice should now have two OwnCoins
-        let alice_oc = th.gather_owncoin(&Holder::Alice, &transfer_params.outputs[1], None)?;
+        let alice_oc = th.gather_owncoin(&Holder::Alice, &transfer_params.outputs[0], None)?;
         alice_owncoins.push(alice_oc);
 
         // Bob should have two with the change from the above tx
-        let bob_oc = th.gather_owncoin(&Holder::Bob, &transfer_params.outputs[0], None)?;
+        let bob_oc = th.gather_owncoin(&Holder::Bob, &transfer_params.outputs[1], None)?;
         bob_owncoins.push(bob_oc);
 
         // Validating transaction outcomes