Skip to content

Commit

Permalink
show inflation bug in same_transfer_twice_no_update_witnesses
Browse files Browse the repository at this point in the history
  • Loading branch information
zoedberg committed Nov 11, 2024
1 parent cfed8e4 commit 0c859f5
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/transfers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,8 @@ fn same_transfer_twice_no_update_witnesses() {
// this shows duplicated allocations
wlt_2.debug_logs(contract_id, &iface_type_name, AllocationFilter::WalletAll);

// commented in order to show inflation bug
/*
// this fails because the wallet sees 2 allocations instead of 1
wlt_2.check_allocations(
contract_id,
Expand All @@ -511,6 +513,36 @@ fn same_transfer_twice_no_update_witnesses() {
vec![amount],
false,
);
*/

// this works but should fail
wlt_2.send(
&mut wlt_1,
TransferType::Blinded,
contract_id,
&iface_type_name,
200,
1000,
None,
);

// this shows 1900+200 as owned, but we issued 2000
wlt_1.debug_logs(contract_id, &iface_type_name, AllocationFilter::WalletAll);

let mut wlt_3 = get_wallet(&DescriptorType::Wpkh);

// this works but should fail
wlt_1.send(
&mut wlt_3,
TransferType::Blinded,
contract_id,
&iface_type_name,
2100,
1000,
None,
);
// this shows 2100 as owned, but we issued 2000
wlt_3.debug_logs(contract_id, &iface_type_name, AllocationFilter::WalletAll);
}

#[test]
Expand Down

0 comments on commit 0c859f5

Please sign in to comment.