Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 342e227

Browse files
[token-2022] Update to check_zk_elgamal_proof_program_account (#7163)
1 parent 2d0cb06 commit 342e227

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

token/program-2022/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,12 @@ pub fn check_spl_token_program_account(spl_token_program_id: &Pubkey) -> Program
112112
Ok(())
113113
}
114114

115-
/// Checks that the supplied program ID is correct for the ZK Token proof
115+
/// Checks that the supplied program ID is correct for the ZK ElGamal proof
116116
/// program
117-
pub fn check_zk_token_proof_program_account(zk_token_proof_program_id: &Pubkey) -> ProgramResult {
118-
if zk_token_proof_program_id != &solana_zk_sdk::zk_elgamal_proof_program::id() {
117+
pub fn check_zk_elgamal_proof_program_account(
118+
zk_elgamal_proof_program_id: &Pubkey,
119+
) -> ProgramResult {
120+
if zk_elgamal_proof_program_id != &solana_zk_sdk::zk_elgamal_proof_program::id() {
119121
return Err(ProgramError::IncorrectProgramId);
120122
}
121123
Ok(())

token/program-2022/src/proof.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Helper for processing instruction data from ZK ElGamal proof program
22
33
use {
4-
crate::check_zk_token_proof_program_account,
4+
crate::check_zk_elgamal_proof_program_account,
55
bytemuck::Pod,
66
solana_program::{
77
account_info::{next_account_info, AccountInfo},
@@ -107,7 +107,7 @@ pub fn verify_and_extract_context<'a, T: Pod + ZkProofData<U>, U: Pod>(
107107
if proof_instruction_offset == 0 {
108108
// interpret `account_info` as a context state account
109109
let context_state_account_info = next_account_info(account_info_iter)?;
110-
check_zk_token_proof_program_account(context_state_account_info.owner)?;
110+
check_zk_elgamal_proof_program_account(context_state_account_info.owner)?;
111111
let context_state_account_data = context_state_account_info.data.borrow();
112112
let context_state = pod_from_bytes::<ProofContextState<U>>(&context_state_account_data)?;
113113

0 commit comments

Comments
 (0)