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

contract/money/integration: Assert expected PoW reward

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

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

@@ -18,6 +18,7 @@
 
 use darkfi::Result;
 use darkfi_contract_test_harness::{init_logger, Holder, TestHarness};
+use darkfi_sdk::blockchain::expected_reward;
 use log::info;
 
 #[test]
@@ -51,7 +52,9 @@ fn money_integration() -> Result<()> {
             .await?;
         }
 
-        let _ = th.gather_owncoin(&Holder::Alice, &alice_proposal_params.output, None)?;
+        let alice_owncoin =
+            th.gather_owncoin(&Holder::Alice, &alice_proposal_params.output, None)?;
+        assert!(alice_owncoin.note.value == expected_reward(verification_slot));
 
         th.assert_trees(&HOLDERS);
         verification_slot += 1;
@@ -79,6 +82,8 @@ fn money_integration() -> Result<()> {
         verification_slot += 1;
         th.generate_slot(verification_slot).await?;
 
+        // Alice sends a payment of some DRK to Bob.
+
         // Statistics
         th.statistics();