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

Commit 3793181

Browse files
committed
rename ProofData::ProofData to ProofData::InstructionData
1 parent 2844a1f commit 3793181

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

token/client/src/token.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,7 +1922,7 @@ where
19221922
let proof_location = if let Some(proof_data_temp) = proof_data.as_ref() {
19231923
ProofLocation::InstructionOffset(
19241924
1.try_into().unwrap(),
1925-
ProofData::ProofData(proof_data_temp),
1925+
ProofData::InstructionData(proof_data_temp),
19261926
)
19271927
} else {
19281928
match proof_account.unwrap() {
@@ -2016,7 +2016,7 @@ where
20162016
let proof_location = if let Some(proof_data_temp) = proof_data.as_ref() {
20172017
ProofLocation::InstructionOffset(
20182018
1.try_into().unwrap(),
2019-
ProofData::ProofData(proof_data_temp),
2019+
ProofData::InstructionData(proof_data_temp),
20202020
)
20212021
} else {
20222022
match proof_account.unwrap() {
@@ -2114,7 +2114,7 @@ where
21142114
let proof_location = if let Some(proof_data_temp) = proof_data.as_ref() {
21152115
ProofLocation::InstructionOffset(
21162116
1.try_into().unwrap(),
2117-
ProofData::ProofData(proof_data_temp),
2117+
ProofData::InstructionData(proof_data_temp),
21182118
)
21192119
} else {
21202120
match proof_account.unwrap() {
@@ -2256,7 +2256,7 @@ where
22562256
let proof_location = if let Some(proof_data_temp) = proof_data.as_ref() {
22572257
ProofLocation::InstructionOffset(
22582258
1.try_into().unwrap(),
2259-
ProofData::ProofData(proof_data_temp),
2259+
ProofData::InstructionData(proof_data_temp),
22602260
)
22612261
} else {
22622262
match proof_account.unwrap() {
@@ -2956,7 +2956,7 @@ where
29562956
let proof_location = if let Some(proof_data_temp) = proof_data.as_ref() {
29572957
ProofLocation::InstructionOffset(
29582958
1.try_into().unwrap(),
2959-
ProofData::ProofData(proof_data_temp),
2959+
ProofData::InstructionData(proof_data_temp),
29602960
)
29612961
} else {
29622962
match proof_account.unwrap() {
@@ -3702,7 +3702,7 @@ where
37023702
let proof_location = if let Some(proof_data_temp) = proof_data.as_ref() {
37033703
ProofLocation::InstructionOffset(
37043704
1.try_into().unwrap(),
3705-
ProofData::ProofData(proof_data_temp),
3705+
ProofData::InstructionData(proof_data_temp),
37063706
)
37073707
} else {
37083708
match proof_account.unwrap() {
@@ -3787,7 +3787,7 @@ where
37873787
let proof_location = if let Some(proof_data_temp) = proof_data.as_ref() {
37883788
ProofLocation::InstructionOffset(
37893789
1.try_into().unwrap(),
3790-
ProofData::ProofData(proof_data_temp),
3790+
ProofData::InstructionData(proof_data_temp),
37913791
)
37923792
} else {
37933793
match proof_account.unwrap() {

token/program-2022/src/extension/confidential_transfer/instruction.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,9 @@ pub fn configure_account(
801801
return Err(TokenError::InvalidProofInstructionOffset.into());
802802
}
803803
match proof_data {
804-
ProofData::ProofData(data) => instructions.push(verify_pubkey_validity(None, data)),
804+
ProofData::InstructionData(data) => {
805+
instructions.push(verify_pubkey_validity(None, data))
806+
}
805807
ProofData::RecordAccount(address, offset) => instructions.push(
806808
ProofInstruction::VerifyPubkeyValidity
807809
.encode_verify_proof_from_account(None, address, offset),
@@ -913,7 +915,7 @@ pub fn empty_account(
913915
return Err(TokenError::InvalidProofInstructionOffset.into());
914916
}
915917
match proof_data {
916-
ProofData::ProofData(data) => instructions.push(verify_zero_balance(None, data)),
918+
ProofData::InstructionData(data) => instructions.push(verify_zero_balance(None, data)),
917919
ProofData::RecordAccount(address, offset) => instructions.push(
918920
ProofInstruction::VerifyZeroBalance
919921
.encode_verify_proof_from_account(None, address, offset),
@@ -1053,7 +1055,7 @@ pub fn withdraw(
10531055
return Err(TokenError::InvalidProofInstructionOffset.into());
10541056
}
10551057
match proof_data {
1056-
ProofData::ProofData(data) => instructions.push(verify_withdraw(None, data)),
1058+
ProofData::InstructionData(data) => instructions.push(verify_withdraw(None, data)),
10571059
ProofData::RecordAccount(address, offset) => instructions.push(
10581060
ProofInstruction::VerifyWithdraw
10591061
.encode_verify_proof_from_account(None, address, offset),
@@ -1155,7 +1157,7 @@ pub fn transfer(
11551157
return Err(TokenError::InvalidProofInstructionOffset.into());
11561158
}
11571159
match proof_data {
1158-
ProofData::ProofData(data) => instructions.push(verify_transfer(None, data)),
1160+
ProofData::InstructionData(data) => instructions.push(verify_transfer(None, data)),
11591161
ProofData::RecordAccount(address, offset) => instructions.push(
11601162
ProofInstruction::VerifyTransfer
11611163
.encode_verify_proof_from_account(None, address, offset),
@@ -1257,7 +1259,9 @@ pub fn transfer_with_fee(
12571259
return Err(TokenError::InvalidProofInstructionOffset.into());
12581260
}
12591261
match proof_data {
1260-
ProofData::ProofData(data) => instructions.push(verify_transfer_with_fee(None, data)),
1262+
ProofData::InstructionData(data) => {
1263+
instructions.push(verify_transfer_with_fee(None, data))
1264+
}
12611265
ProofData::RecordAccount(address, offset) => instructions.push(
12621266
ProofInstruction::VerifyTransferWithFee
12631267
.encode_verify_proof_from_account(None, address, offset),

token/program-2022/src/extension/confidential_transfer_fee/instruction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ pub fn withdraw_withheld_tokens_from_mint(
380380
return Err(TokenError::InvalidProofInstructionOffset.into());
381381
}
382382
match proof_data {
383-
ProofData::ProofData(data) => {
383+
ProofData::InstructionData(data) => {
384384
instructions.push(verify_ciphertext_ciphertext_equality(None, data))
385385
}
386386
ProofData::RecordAccount(address, offset) => instructions.push(
@@ -491,7 +491,7 @@ pub fn withdraw_withheld_tokens_from_accounts(
491491
return Err(TokenError::InvalidProofInstructionOffset.into());
492492
}
493493
match proof_data {
494-
ProofData::ProofData(data) => {
494+
ProofData::InstructionData(data) => {
495495
instructions.push(verify_ciphertext_ciphertext_equality(None, data))
496496
}
497497
ProofData::RecordAccount(address, offset) => instructions.push(

token/program-2022/src/proof.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ pub enum ProofLocation<'a, T> {
6969
}
7070

7171
/// A proof data type to distinguish between proof data included as part of
72-
/// instruction data and proof data stored in a record account.
72+
/// zk-token proof instruction data and proof data stored in a record account.
7373
#[derive(Clone, Copy)]
7474
pub enum ProofData<'a, T> {
7575
/// The proof data
76-
ProofData(&'a T),
76+
InstructionData(&'a T),
7777
/// The address of a record account containing the proof data and its byte
7878
/// offset
7979
RecordAccount(&'a Pubkey, u32),

0 commit comments

Comments
 (0)