Skip to content

Commit

Permalink
token-2022: Refactor StateWithExtensionsMut functionality into trait (
Browse files Browse the repository at this point in the history
#6329)

* Refactor `StateWithExtensionsMut` functionality into trait

* Dedupe unpack function

* Simplify passing function
  • Loading branch information
joncinque authored Mar 5, 2024
1 parent 0b93ebd commit a42d7bd
Show file tree
Hide file tree
Showing 17 changed files with 175 additions and 134 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ use {
},
memo_transfer::{check_previous_sibling_instruction_is_memo, memo_required},
transfer_fee::TransferFeeConfig,
BaseStateWithExtensions, StateWithExtensions, StateWithExtensionsMut,
BaseStateWithExtensions, BaseStateWithExtensionsMut, StateWithExtensions,
StateWithExtensionsMut,
},
instruction::{decode_instruction_data, decode_instruction_type},
processor::Processor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use {
EncryptedWithheldAmount,
},
transfer_fee::TransferFeeConfig,
BaseStateWithExtensions, StateWithExtensionsMut,
BaseStateWithExtensions, BaseStateWithExtensionsMut, StateWithExtensionsMut,
},
instruction::{decode_instruction_data, decode_instruction_type},
processor::Processor,
Expand Down
2 changes: 1 addition & 1 deletion token/program-2022/src/extension/cpi_guard/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use {
error::TokenError,
extension::{
cpi_guard::{in_cpi, instruction::CpiGuardInstruction, CpiGuard},
StateWithExtensionsMut,
BaseStateWithExtensionsMut, StateWithExtensionsMut,
},
instruction::decode_instruction_type,
processor::Processor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use {
instruction::{decode_instruction, DefaultAccountStateInstruction},
DefaultAccountState,
},
StateWithExtensionsMut,
BaseStateWithExtensionsMut, StateWithExtensionsMut,
},
processor::Processor,
state::{AccountState, Mint},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use {
},
GroupMemberPointer,
},
StateWithExtensionsMut,
BaseStateWithExtensionsMut, StateWithExtensionsMut,
},
instruction::{decode_instruction_data, decode_instruction_type},
processor::Processor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use {
},
GroupPointer,
},
StateWithExtensionsMut,
BaseStateWithExtensionsMut, StateWithExtensionsMut,
},
instruction::{decode_instruction_data, decode_instruction_type},
processor::Processor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use {
instruction::{InitializeInstructionData, InterestBearingMintInstruction},
BasisPoints, InterestBearingConfig,
},
StateWithExtensionsMut,
BaseStateWithExtensionsMut, StateWithExtensionsMut,
},
instruction::{decode_instruction_data, decode_instruction_type},
processor::Processor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use {
check_program_account,
extension::{
memo_transfer::{instruction::RequiredMemoTransfersInstruction, MemoTransfer},
StateWithExtensionsMut,
BaseStateWithExtensionsMut, StateWithExtensionsMut,
},
instruction::decode_instruction_type,
processor::Processor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use {
},
MetadataPointer,
},
StateWithExtensionsMut,
BaseStateWithExtensionsMut, StateWithExtensionsMut,
},
instruction::{decode_instruction_data, decode_instruction_type},
processor::Processor,
Expand Down
Loading

0 comments on commit a42d7bd

Please sign in to comment.