Skip to content

Commit

Permalink
Fix test in global state
Browse files Browse the repository at this point in the history
  • Loading branch information
Sword-Smith committed Oct 11, 2024
1 parent d1aebf1 commit 5cedbd8
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/models/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2003,7 +2003,7 @@ mod global_state_tests {
.await
.wallet_state
.next_unused_spending_key(KeyType::Generation);
let (tx_to_alice_and_bob, _maybe_change_output) = genesis_state_lock
let (tx_to_alice_and_bob, maybe_change_output) = genesis_state_lock
.lock_guard()
.await
.create_transaction_with_prover_capability(
Expand All @@ -2018,9 +2018,23 @@ mod global_state_tests {
)
.await
.unwrap();
let Some(change_output) = maybe_change_output else {
panic!("Expected change output to genesis receiver");
};

// genesis receiver does not care about change
// this is not what we are testing here
// Expect change output
genesis_state_lock
.global_state_lock
.lock_guard_mut()
.await
.wallet_state
.add_expected_utxo(ExpectedUtxo::new(
change_output.utxo(),
change_output.sender_randomness(),
genesis_key.privacy_preimage(),
UtxoNotifier::Myself,
))
.await;

let block_transaction =
tx_to_alice_and_bob.merge_with(coinbase_transaction, Default::default());
Expand Down

0 comments on commit 5cedbd8

Please sign in to comment.