Skip to content

Commit ef9b56c

Browse files
sdbondiclaude
andcommitted
fix: use assert_reject_reason in airdrop and meme_coin tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4381b65 commit ef9b56c

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

wasm_templates/airdrop/tests/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn test_airdrop_add_recipient_airdrop_allow_list_full() {
7979

8080
// add recipients
8181
for _ in 0..100 {
82-
let (_account_component, owner_proof, account_secret_key) = test.create_funded_account();
82+
let (account_component, owner_proof, account_secret_key) = test.create_funded_account();
8383
let result = test.execute_expect_success(
8484
Transaction::builder_localnet()
8585
.call_method(

wasm_templates/meme_coin/tests/test.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use tari_template_test_tooling::engine_types::commit_result::RejectReason;
21
use tari_template_lib::types::{Amount, ComponentAddress, amount, NonFungibleAddress, Metadata};
32
use tari_template_test_tooling::crypto::RistrettoSecretKey;
3+
use tari_template_test_tooling::support::assert_error::assert_reject_reason;
44
use tari_template_test_tooling::TemplateTest;
55
use tari_template_test_tooling::transaction::{args, Transaction};
66

@@ -77,17 +77,7 @@ fn test_memecoin_owner_only_allowed_method() {
7777
.build_and_seal(&account_secret_key),
7878
vec![owner_proof.clone()],
7979
);
80-
assert!(matches!(reject_reason, RejectReason::ExecutionFailure(_)));
81-
if let RejectReason::ExecutionFailure(reason) = reject_reason {
82-
assert!(reason.starts_with("Access Denied:"));
83-
assert!(reason.contains(
84-
format!(
85-
"call component method 'burn' on {}",
86-
meme_coin_result.meme_coin_component
87-
)
88-
.as_str()
89-
));
90-
}
80+
assert_reject_reason(reject_reason, "call component method 'burn'");
9181
}
9282

9383
#[test]

0 commit comments

Comments
 (0)