diff --git a/token/confidential-transfer/elgamal-registry/src/instruction.rs b/token/confidential-transfer/elgamal-registry/src/instruction.rs index 851664d1ae1..aedd4177f0d 100644 --- a/token/confidential-transfer/elgamal-registry/src/instruction.rs +++ b/token/confidential-transfer/elgamal-registry/src/instruction.rs @@ -128,13 +128,14 @@ pub fn create_registry( /// Create a `RegistryInstruction::UpdateRegistry` instruction pub fn update_registry( - registry_account: &Pubkey, - owner: &Pubkey, + owner_address: &Pubkey, proof_location: ProofLocation, ) -> Result, ProgramError> { - let mut accounts = vec![AccountMeta::new(*registry_account, false)]; + let elgamal_registry_address = get_elgamal_registry_address(owner_address, &id()); + + let mut accounts = vec![AccountMeta::new(elgamal_registry_address, false)]; let proof_instruction_offset = proof_instruction_offset(&mut accounts, proof_location); - accounts.push(AccountMeta::new_readonly(*owner, true)); + accounts.push(AccountMeta::new_readonly(*owner_address, true)); let registry_instruction = Instruction { program_id: id(), diff --git a/token/program-2022-test/tests/confidential_transfer.rs b/token/program-2022-test/tests/confidential_transfer.rs index 9300cfa97a3..09138a47605 100644 --- a/token/program-2022-test/tests/confidential_transfer.rs +++ b/token/program-2022-test/tests/confidential_transfer.rs @@ -2884,12 +2884,9 @@ async fn confidential_transfer_configure_token_account_with_registry() { &spl_elgamal_registry::id(), ); - let instructions = spl_elgamal_registry::instruction::update_registry( - &elgamal_registry_address, - &alice.pubkey(), - proof_location, - ) - .unwrap(); + let instructions = + spl_elgamal_registry::instruction::update_registry(&alice.pubkey(), proof_location) + .unwrap(); let tx = Transaction::new_signed_with_payer( &instructions, Some(&ctx.payer.pubkey()),