Skip to content

Commit 739ab50

Browse files
committed
add extraction of token2022 sync native & close account ixs
1 parent 353f974 commit 739ab50

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

auction-server/src/auction/service/verification.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,11 @@ impl Service {
657657
.filter_map(|(_, instruction)| {
658658
let ix_parsed = TokenInstruction::unpack(&instruction.data).ok();
659659
if matches!(ix_parsed, Some(TokenInstruction::SyncNative)) {
660+
return Some(instruction);
661+
}
662+
663+
let ix_parsed_2022 = Token2022Instruction::unpack(&instruction.data).ok();
664+
if matches!(ix_parsed_2022, Some(Token2022Instruction::SyncNative)) {
660665
Some(instruction)
661666
} else {
662667
None
@@ -710,6 +715,22 @@ impl Service {
710715
destination,
711716
owner,
712717
});
718+
} else {
719+
let ix_parsed_2022 = Token2022Instruction::unpack(&instruction.data).ok();
720+
if let Some(Token2022Instruction::CloseAccount) = ix_parsed_2022 {
721+
let accounts = futures::future::try_join_all(
722+
(0..3).map(|i| self.extract_account(tx, instruction, i)),
723+
)
724+
.await?;
725+
let [account, destination, owner] = array::from_fn(|i| accounts[i]);
726+
727+
result.push(CloseAccountInstructionData {
728+
index,
729+
account,
730+
destination,
731+
owner,
732+
});
733+
}
713734
}
714735
}
715736
Ok(result)

0 commit comments

Comments
 (0)