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 7, 2025
1 parent 9e2de76 commit 64f34b3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion rgb
Submodule rgb updated 1 files
+10 −2 src/pay.rs
2 changes: 1 addition & 1 deletion rgb-std
14 changes: 4 additions & 10 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 @@ -540,20 +539,17 @@ fn same_transfer_twice_no_update_witnesses(#[case] transfer_type: TransferType)

wlt_2.accept_transfer(consignment, 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,
AssetSchema::Nia,
vec![amount],
vec![],
false,
);

// with TransferType::Blinded this works but should fail
// this should fail
wlt_2.send(
&mut wlt_1,
TransferType::Blinded,
Expand All @@ -564,12 +560,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 +579,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 64f34b3

Please sign in to comment.