From f6c787e15fa66ac13b747371236f19e366f3881e Mon Sep 17 00:00:00 2001 From: Pravdyvy Date: Mon, 22 Dec 2025 04:02:12 +0200 Subject: [PATCH] fix: suggestions fix --- wallet/src/cli/programs/token.rs | 2 -- wallet/src/program_facades/token.rs | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/wallet/src/cli/programs/token.rs b/wallet/src/cli/programs/token.rs index 1a3b256..25d61ff 100644 --- a/wallet/src/cli/programs/token.rs +++ b/wallet/src/cli/programs/token.rs @@ -56,8 +56,6 @@ pub enum TokenProgramAgnosticSubcommand { /// /// Also if `definition` is private then it is owned, because /// we can not modify foreign accounts. - /// - /// ToDo: Return and add foreign variant when we could modify foreign accounts Burn { /// definition - valid 32 byte base58 string with privacy prefix #[arg(long)] diff --git a/wallet/src/program_facades/token.rs b/wallet/src/program_facades/token.rs index a32fef9..4d21b94 100644 --- a/wallet/src/program_facades/token.rs +++ b/wallet/src/program_facades/token.rs @@ -312,7 +312,9 @@ impl Token<'_> { let (instruction, program) = token_program_preparation_burn(amount); // ToDo: Fix this by updating `nssa::public_transaction::Message::try_new` to get raw bytes - let instruction: [u32; 23] = instruction.try_into().unwrap(); + let instruction: [u32; 23] = instruction + .try_into() + .expect("Instruction vector should have len 32"); let Ok(nonces) = self.0.get_accounts_nonces(vec![holder_account_id]).await else { return Err(ExecutionFailureKind::SequencerError); @@ -323,16 +325,14 @@ impl Token<'_> { nonces, instruction, ) - .unwrap(); + .expect("Instruction should serialize"); - let Some(signing_key) = self + let signing_key = self .0 .storage .user_data .get_pub_account_signing_key(&holder_account_id) - else { - return Err(ExecutionFailureKind::KeyNotFoundError); - }; + .ok_or(ExecutionFailureKind::KeyNotFoundError)?; let witness_set = nssa::public_transaction::WitnessSet::for_message(&message, &[signing_key]);