@@ -486,7 +486,9 @@ pub enum ConfidentialTransferInstruction {
486486 ///
487487 /// If the token account is not large enough to include the new
488488 /// cconfidential transfer extension, then optionally reallocate the
489- /// account to increase the data size.
489+ /// account to increase the data size. To reallocate, a payer account to
490+ /// fund the reallocation and the system account should be included in the
491+ /// instruction.
490492 ///
491493 /// Accounts expected by this instruction:
492494 ///
@@ -499,7 +501,7 @@ pub enum ConfidentialTransferInstruction {
499501 /// 4. `[]` (Optional) System program for reallocation funding
500502 ///
501503 /// Data expected by this instruction:
502- /// `ConfigureAccountWithRegistryInstructionData`
504+ /// None
503505 ConfigureAccountWithRegistry ,
504506}
505507
@@ -676,17 +678,6 @@ pub struct TransferWithFeeInstructionData {
676678 pub range_proof_instruction_offset : i8 ,
677679}
678680
679- /// Data expected by
680- /// `ConfidentialTransferInstruction::ConfigureAccountWithRegistry`
681- #[ cfg_attr( feature = "serde-traits" , derive( Serialize , Deserialize ) ) ]
682- #[ derive( Clone , Copy , Debug , PartialEq , Pod , Zeroable ) ]
683- #[ repr( C ) ]
684- pub struct ConfigureAccountWithRegistryInstructionData {
685- /// Reallocate token account if it is not large enough for the
686- /// `ConfidentialTransfer` extension.
687- pub reallocate_account : PodBool ,
688- }
689-
690681/// Create a `InitializeMint` instruction
691682pub fn initialize_mint (
692683 token_program_id : & Pubkey ,
@@ -1756,21 +1747,16 @@ pub fn configure_account_with_registry(
17561747 AccountMeta :: new_readonly( * mint, false ) ,
17571748 AccountMeta :: new_readonly( * elgamal_registry_account, false ) ,
17581749 ] ;
1759- let reallocate_account = if let Some ( payer) = payer {
1750+ if let Some ( payer) = payer {
17601751 accounts. push ( AccountMeta :: new ( * payer, true ) ) ;
17611752 accounts. push ( AccountMeta :: new_readonly ( system_program:: id ( ) , false ) ) ;
1762- true
1763- } else {
1764- false
1765- } ;
1753+ }
17661754
17671755 Ok ( encode_instruction (
17681756 token_program_id,
17691757 accounts,
17701758 TokenInstruction :: ConfidentialTransferExtension ,
17711759 ConfidentialTransferInstruction :: ConfigureAccountWithRegistry ,
1772- & ConfigureAccountWithRegistryInstructionData {
1773- reallocate_account : reallocate_account. into ( ) ,
1774- } ,
1760+ & ( ) ,
17751761 ) )
17761762}
0 commit comments