Skip to content

Commit

Permalink
fix a lil test bug
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec committed Aug 31, 2023
1 parent b19cb57 commit be2e6f0
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions token/program-2022-test/tests/transfer_hook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -706,10 +706,13 @@ async fn success_transfers_using_onchain_helper() {
offchain::resolve_extra_transfer_account_metas(
&mut instruction,
|address| {
token_a
.get_account(address)
.map_ok(|acc| Some(acc.data))
.map_err(offchain::AccountFetchError::from)
token_a.get_account(address).map_ok_or_else(
|e| match e {
TokenClientError::AccountNotFound => Ok(None),
_ => Err(offchain::AccountFetchError::from(e)),
},
|acc| Ok(Some(acc.data)),
)
},
&mint_a,
)
Expand All @@ -718,10 +721,13 @@ async fn success_transfers_using_onchain_helper() {
offchain::resolve_extra_transfer_account_metas(
&mut instruction,
|address| {
token_a
.get_account(address)
.map_ok(|acc| Some(acc.data))
.map_err(offchain::AccountFetchError::from)
token_a.get_account(address).map_ok_or_else(
|e| match e {
TokenClientError::AccountNotFound => Ok(None),
_ => Err(offchain::AccountFetchError::from(e)),
},
|acc| Ok(Some(acc.data)),
)
},
&mint_b,
)
Expand Down

0 comments on commit be2e6f0

Please sign in to comment.