From e93f79f54cfa15457b9e64c93cfac6fdc4c163fe Mon Sep 17 00:00:00 2001 From: samkim-crypto Date: Sat, 17 Aug 2024 12:23:01 +0900 Subject: [PATCH] update `check_zk_token_proof_program_account` to `check_zk_elgamal_proof_program_account` --- token/program-2022/src/lib.rs | 8 +++++--- token/program-2022/src/proof.rs | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/token/program-2022/src/lib.rs b/token/program-2022/src/lib.rs index dc2985b7b0e..573fd0f18d7 100644 --- a/token/program-2022/src/lib.rs +++ b/token/program-2022/src/lib.rs @@ -112,10 +112,12 @@ pub fn check_spl_token_program_account(spl_token_program_id: &Pubkey) -> Program Ok(()) } -/// Checks that the supplied program ID is correct for the ZK Token proof +/// Checks that the supplied program ID is correct for the ZK ElGamal proof /// program -pub fn check_zk_token_proof_program_account(zk_token_proof_program_id: &Pubkey) -> ProgramResult { - if zk_token_proof_program_id != &solana_zk_sdk::zk_elgamal_proof_program::id() { +pub fn check_zk_elgamal_proof_program_account( + zk_elgamal_proof_program_id: &Pubkey, +) -> ProgramResult { + if zk_elgamal_proof_program_id != &solana_zk_sdk::zk_elgamal_proof_program::id() { return Err(ProgramError::IncorrectProgramId); } Ok(()) diff --git a/token/program-2022/src/proof.rs b/token/program-2022/src/proof.rs index ac93788c7d3..551beaba5d6 100644 --- a/token/program-2022/src/proof.rs +++ b/token/program-2022/src/proof.rs @@ -1,7 +1,7 @@ //! Helper for processing instruction data from ZK Token proof program use { - crate::check_zk_token_proof_program_account, + crate::check_zk_elgamal_proof_program_account, bytemuck::Pod, solana_program::{ account_info::{next_account_info, AccountInfo}, @@ -107,7 +107,7 @@ pub fn verify_and_extract_context<'a, T: Pod + ZkProofData, U: Pod>( if proof_instruction_offset == 0 { // interpret `account_info` as a context state account let context_state_account_info = next_account_info(account_info_iter)?; - check_zk_token_proof_program_account(context_state_account_info.owner)?; + check_zk_elgamal_proof_program_account(context_state_account_info.owner)?; let context_state_account_data = context_state_account_info.data.borrow(); let context_state = pod_from_bytes::>(&context_state_account_data)?;