This repository was archived by the owner on Mar 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +5
-11
lines changed
program-2022/src/extension/confidential_transfer Expand file tree Collapse file tree 4 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -1980,7 +1980,6 @@ where
1980
1980
& self ,
1981
1981
account : & Pubkey ,
1982
1982
elgamal_registry_account : & Pubkey ,
1983
- authority : & Pubkey ,
1984
1983
) -> TokenResult < T :: Output > {
1985
1984
self . process_ixs :: < [ & dyn Signer ; 0 ] > (
1986
1985
& [
@@ -1989,7 +1988,6 @@ where
1989
1988
account,
1990
1989
& self . pubkey ,
1991
1990
elgamal_registry_account,
1992
- authority,
1993
1991
) ?,
1994
1992
] ,
1995
1993
& [ ] ,
Original file line number Diff line number Diff line change @@ -2902,7 +2902,7 @@ async fn confidential_transfer_configure_token_account_with_registry() {
2902
2902
token
2903
2903
. create_auxiliary_token_account_with_extension_space (
2904
2904
& alice_account_keypair,
2905
- & alice_token_account ,
2905
+ & alice . pubkey ( ) ,
2906
2906
vec ! [ ExtensionType :: ConfidentialTransferAccount ] ,
2907
2907
)
2908
2908
. await
@@ -2912,7 +2912,6 @@ async fn confidential_transfer_configure_token_account_with_registry() {
2912
2912
. confidential_transfer_configure_token_account_with_registry (
2913
2913
& alice_account_keypair. pubkey ( ) ,
2914
2914
& elgamal_registry_address,
2915
- & alice. pubkey ( ) ,
2916
2915
)
2917
2916
. await
2918
2917
. unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -490,7 +490,6 @@ pub enum ConfidentialTransferInstruction {
490
490
/// 0. `[writable]` The SPL Token account.
491
491
/// 1. `[]` The corresponding SPL Token mint.
492
492
/// 2. `[]` The ElGamal registry account.
493
- /// 3. `[]` The account owner.
494
493
///
495
494
/// Data expected by this instruction:
496
495
/// None
@@ -1731,14 +1730,12 @@ pub fn configure_account_with_registry(
1731
1730
token_account : & Pubkey ,
1732
1731
mint : & Pubkey ,
1733
1732
elgamal_registry_account : & Pubkey ,
1734
- authority : & Pubkey ,
1735
1733
) -> Result < Instruction , ProgramError > {
1736
1734
check_program_account ( token_program_id) ?;
1737
1735
let accounts = vec ! [
1738
1736
AccountMeta :: new( * token_account, false ) ,
1739
1737
AccountMeta :: new_readonly( * mint, false ) ,
1740
1738
AccountMeta :: new_readonly( * elgamal_registry_account, false ) ,
1741
- AccountMeta :: new_readonly( * authority, false ) ,
1742
1739
] ;
1743
1740
1744
1741
Ok ( encode_instruction (
Original file line number Diff line number Diff line change @@ -151,9 +151,6 @@ fn process_configure_account(
151
151
}
152
152
} ;
153
153
154
- let authority_info = next_account_info ( account_info_iter) ?;
155
- let authority_info_data_len = authority_info. data_len ( ) ;
156
-
157
154
check_program_account ( token_account_info. owner ) ?;
158
155
let token_account_data = & mut token_account_info. data . borrow_mut ( ) ;
159
156
let mut token_account = PodStateWithExtensionsMut :: < PodAccount > :: unpack ( token_account_data) ?;
@@ -164,6 +161,9 @@ fn process_configure_account(
164
161
165
162
match elgamal_pubkey_source {
166
163
ElGamalPubkeySource :: ProofInstructionOffset ( _) => {
164
+ let authority_info = next_account_info ( account_info_iter) ?;
165
+ let authority_info_data_len = authority_info. data_len ( ) ;
166
+
167
167
Processor :: validate_owner (
168
168
program_id,
169
169
& token_account. base . owner ,
@@ -176,7 +176,7 @@ fn process_configure_account(
176
176
// if ElGamal registry was provided, then just verify that the owners of the
177
177
// registry and token accounts match, then skip the signature
178
178
// verification check
179
- if elgamal_registry_account. owner != * authority_info . key {
179
+ if elgamal_registry_account. owner != token_account . base . owner {
180
180
return Err ( TokenError :: OwnerMismatch . into ( ) ) ;
181
181
}
182
182
}
You can’t perform that action at this time.
0 commit comments