Skip to content

Commit

Permalink
test(claim_utxo): Ensure double registration does not change balance
Browse files Browse the repository at this point in the history
Register a UTXO claim twice and verify that balance is still correct.
  • Loading branch information
Sword-Smith committed Nov 20, 2024
1 parent 0ff7687 commit c4288ee
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/rpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2447,11 +2447,24 @@ mod rpc_server_tests {
}

for utxo_notification in alice_to_bob_utxo_notifications.into_iter() {
bob_rpc_server
// Register the same UTXO multiple times to ensure that this does not
// change the balance.
let claim_was_new0 = bob_rpc_server
.clone()
.claim_utxo(
context::current(),
utxo_notification.ciphertext.clone(),
None,
)
.await
.unwrap();
assert!(claim_was_new0);
let claim_was_new1 = bob_rpc_server
.clone()
.claim_utxo(context::current(), utxo_notification.ciphertext, None)
.await
.unwrap();
assert!(!claim_was_new1);
}

assert_eq!(
Expand Down

0 comments on commit c4288ee

Please sign in to comment.