Skip to content

Commit

Permalink
restore aborted transfer tests with applied fix
Browse files Browse the repository at this point in the history
applies RGB-WG/rgb-std#288 fix
  • Loading branch information
dr-orlovsky committed Jan 6, 2025
1 parent 9e2de76 commit d7af987
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion rgb-std
13 changes: 4 additions & 9 deletions tests/transfers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,10 @@ fn rbf_transfer() {
}

#[rstest]
#[ignore = "fix needed"] // https://github.com/RGB-WG/rgb-core/issues/283
#[case(TransferType::Blinded)]
#[should_panic(
expected = "the invoice requirements can't be fulfilled using available assets or smart contract state."
)]
#[case(TransferType::Blinded)]
#[case(TransferType::Witness)]
fn same_transfer_twice_no_update_witnesses(#[case] transfer_type: TransferType) {
println!("transfer_type {transfer_type:?}");
Expand All @@ -539,12 +538,10 @@ fn same_transfer_twice_no_update_witnesses(#[case] transfer_type: TransferType)
let (consignment, _) = wlt_1.transfer(invoice, None, Some(1000), true, None);

wlt_2.accept_transfer(consignment, None);
wlt_2.sync_and_update_witnesses(None);

// with TransferType::Blinded this shows duplicated allocations
wlt_2.debug_logs(contract_id, &iface_type_name, AllocationFilter::WalletAll);

// with TransferType::Blinded this fails because the wallet sees 2 allocations instead of 1
// comment it in order to see the inflation bug
wlt_2.check_allocations(
contract_id,
&iface_type_name,
Expand All @@ -553,7 +550,7 @@ fn same_transfer_twice_no_update_witnesses(#[case] transfer_type: TransferType)
false,
);

// with TransferType::Blinded this works but should fail
// this should fail
wlt_2.send(
&mut wlt_1,
TransferType::Blinded,
Expand All @@ -564,12 +561,11 @@ fn same_transfer_twice_no_update_witnesses(#[case] transfer_type: TransferType)
None,
);

// with TransferType::Blinded 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);

// with TransferType::Blinded this works but should fail
// this should fail
wlt_1.send(
&mut wlt_3,
TransferType::Blinded,
Expand All @@ -584,7 +580,6 @@ fn same_transfer_twice_no_update_witnesses(#[case] transfer_type: TransferType)
}

#[rstest]
#[ignore = "fix needed"] // https://github.com/RGB-WG/rgb-core/issues/283
#[case(TransferType::Blinded)]
#[case(TransferType::Witness)]
fn same_transfer_twice_update_witnesses(#[case] transfer_type: TransferType) {
Expand Down

0 comments on commit d7af987

Please sign in to comment.