Skip to content

Commit f07f3d3

Browse files
committed
simplify the test
1 parent c9aeb57 commit f07f3d3

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

kmir/src/tests/integration/data/prove-rs/spl_token_domain_data.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -133,30 +133,21 @@ fn test_spltoken_domain_data(
133133
multisig: &AccountInfo<'_>,
134134
rent: &AccountInfo<'_>,
135135
) {
136-
test_spl_account_pack_is_native_branch(acc);
137-
test_spl_account_is_native_branch(acc);
136+
test_spl_account_is_native_branches(acc);
138137
test_spl_account_domain_data(acc);
139138
test_spl_mint_domain_data(mint);
140139
test_spl_multisig_domain_data(multisig);
141140
test_spl_rent_domain_data(rent);
142141
}
143142

144-
fn test_spl_account_pack_is_native_branch(acc: &AccountInfo<'_>) {
145-
// Keep is_native symbolic and pack through an extra call frame to mirror process_burn’s cross-frame writeback
143+
fn test_spl_account_is_native_branches(acc: &AccountInfo<'_>) {
144+
// Keep is_native symbolic, hit pack through an extra call frame, and exercise COption::<u64>::is_some
146145
cheatcode_is_spl_account(acc);
146+
147147
let account = get_account(acc);
148148
let mut borrow = acc.data.borrow_mut();
149149
pack_account_inner(&mut borrow, &account);
150-
}
151-
152-
fn pack_account_inner(buf: &mut [u8], account: &Account) {
153-
Account::pack(account.clone(), buf).unwrap();
154-
}
155150

156-
fn test_spl_account_is_native_branch(acc: &AccountInfo<'_>) {
157-
// Keep is_native symbolic and exercise COption::<u64>::is_some to reproduce the ndbranch
158-
cheatcode_is_spl_account(acc);
159-
let account = get_account(acc);
160151
let _ = account.is_native();
161152
}
162153

@@ -263,6 +254,10 @@ fn get_multisig(acc: &AccountInfo<'_>) -> Multisig {
263254
Multisig::unpack_unchecked(&acc.data.borrow()).unwrap()
264255
}
265256

257+
fn pack_account_inner(buf: &mut [u8], account: &Account) {
258+
Account::pack(account.clone(), buf).unwrap();
259+
}
260+
266261
#[inline(never)]
267262
fn cheatcode_is_spl_account(_: &AccountInfo<'_>) {}
268263

kmir/src/tests/integration/test_integration.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
'assume-cheatcode-conflict-fail': ['check_assume_conflict'],
3939
'transmute-bytes': ['bytes_to_u64', 'u64_to_bytes'],
4040
'spl_token_domain_data': [
41-
'test_spl_account_pack_is_native_branch',
4241
'test_spl_account_is_native_branch',
4342
'test_spl_account_domain_data',
4443
'test_spl_mint_domain_data',

0 commit comments

Comments
 (0)