Просмотр исходного кода

contract/money: Fix slot generation in integration test

parazyd 2 лет назад
Родитель
Сommit
d0eac00cea
1 измененных файлов с 6 добавлено и 5 удалено
  1. 6 5
      src/contract/money/tests/integration.rs

+ 6 - 5
src/contract/money/tests/integration.rs

@@ -28,16 +28,17 @@ fn money_integration() -> Result<()> {
         // Holders this test will use
         // Holders this test will use
         const HOLDERS: [Holder; 2] = [Holder::Alice, Holder::Bob];
         const HOLDERS: [Holder; 2] = [Holder::Alice, Holder::Bob];
 
 
-        // Current verification slot
-        let mut verification_slot = 0;
-
         // Initialize harness
         // Initialize harness
         let mut th = TestHarness::new(&["money".to_string()]).await?;
         let mut th = TestHarness::new(&["money".to_string()]).await?;
 
 
+        // Current verification slot
+        let mut verification_slot = 1;
+        th.generate_slot(verification_slot).await?;
+
         // Drop some money to Alice
         // Drop some money to Alice
         info!("[Alice] Building block proposal");
         info!("[Alice] Building block proposal");
         let (alice_proposal_tx, alice_proposal_params) =
         let (alice_proposal_tx, alice_proposal_params) =
-            th.pow_reward(&Holder::Alice, None, verification_slot + 1, None)?;
+            th.pow_reward(&Holder::Alice, None, verification_slot, None)?;
 
 
         for holder in HOLDERS {
         for holder in HOLDERS {
             info!("[{holder:?}] Executing Alice's block proposal");
             info!("[{holder:?}] Executing Alice's block proposal");
@@ -57,7 +58,7 @@ fn money_integration() -> Result<()> {
         // And some to Bob
         // And some to Bob
         info!("[Bob] Building block proposal");
         info!("[Bob] Building block proposal");
         let (bob_proposal_tx, bob_proposal_params) =
         let (bob_proposal_tx, bob_proposal_params) =
-            th.pow_reward(&Holder::Bob, None, verification_slot + 1, None)?;
+            th.pow_reward(&Holder::Bob, None, verification_slot, None)?;
 
 
         for holder in HOLDERS {
         for holder in HOLDERS {
             info!("[{holder:?}] Executing Alice's block proposal");
             info!("[{holder:?}] Executing Alice's block proposal");