|
|
@@ -1,6 +1,6 @@
|
|
|
use {
|
|
|
super::*,
|
|
|
- spl_token_2022::{
|
|
|
+ spl_token_2022_interface::{
|
|
|
extension::confidential_transfer::instruction::*,
|
|
|
instruction::{decode_instruction_data, decode_instruction_type},
|
|
|
solana_zk_sdk::encryption::pod::elgamal::PodElGamalPubkey,
|
|
|
@@ -600,7 +600,7 @@ mod test {
|
|
|
solana_instruction::{AccountMeta, Instruction},
|
|
|
solana_message::Message,
|
|
|
solana_pubkey::Pubkey,
|
|
|
- spl_token_2022::{
|
|
|
+ spl_token_2022_interface::{
|
|
|
extension::confidential_transfer::instruction::{
|
|
|
initialize_mint, inner_configure_account, inner_empty_account, update_mint,
|
|
|
},
|
|
|
@@ -614,7 +614,7 @@ mod test {
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
- spl_token_confidential_transfer_proof_extraction::instruction::{ProofData, ProofLocation},
|
|
|
+ spl_token_confidential_transfer_proof_extraction::instruction::ProofLocation,
|
|
|
std::num::NonZero,
|
|
|
};
|
|
|
|
|
|
@@ -634,7 +634,7 @@ mod test {
|
|
|
#[test]
|
|
|
fn test_initialize() {
|
|
|
let instruction = initialize_mint(
|
|
|
- &spl_token_2022::id(),
|
|
|
+ &spl_token_2022_interface::id(),
|
|
|
&Pubkey::new_unique(),
|
|
|
Some(Pubkey::new_unique()),
|
|
|
true,
|
|
|
@@ -647,7 +647,7 @@ mod test {
|
|
|
#[test]
|
|
|
fn test_approve() {
|
|
|
let instruction = approve_account(
|
|
|
- &spl_token_2022::id(),
|
|
|
+ &spl_token_2022_interface::id(),
|
|
|
&Pubkey::new_unique(),
|
|
|
&Pubkey::new_unique(),
|
|
|
&Pubkey::new_unique(),
|
|
|
@@ -660,7 +660,7 @@ mod test {
|
|
|
#[test]
|
|
|
fn test_update() {
|
|
|
let instruction = update_mint(
|
|
|
- &spl_token_2022::id(),
|
|
|
+ &spl_token_2022_interface::id(),
|
|
|
&Pubkey::new_unique(),
|
|
|
&Pubkey::new_unique(),
|
|
|
&[],
|
|
|
@@ -676,16 +676,12 @@ mod test {
|
|
|
for location in [
|
|
|
ProofLocation::InstructionOffset(
|
|
|
NonZero::new(1).unwrap(),
|
|
|
- ProofData::InstructionData(&PubkeyValidityProofData::zeroed()),
|
|
|
- ),
|
|
|
- ProofLocation::InstructionOffset(
|
|
|
- NonZero::new(1).unwrap(),
|
|
|
- ProofData::RecordAccount(&Pubkey::new_unique(), 0),
|
|
|
+ &PubkeyValidityProofData::zeroed(),
|
|
|
),
|
|
|
ProofLocation::ContextStateAccount(&Pubkey::new_unique()),
|
|
|
] {
|
|
|
let instruction = inner_configure_account(
|
|
|
- &spl_token_2022::id(),
|
|
|
+ &spl_token_2022_interface::id(),
|
|
|
&Pubkey::new_unique(),
|
|
|
&Pubkey::new_unique(),
|
|
|
&PodAeCiphertext::default(),
|
|
|
@@ -704,16 +700,12 @@ mod test {
|
|
|
for location in [
|
|
|
ProofLocation::InstructionOffset(
|
|
|
NonZero::new(1).unwrap(),
|
|
|
- ProofData::InstructionData(&ZeroCiphertextProofData::zeroed()),
|
|
|
- ),
|
|
|
- ProofLocation::InstructionOffset(
|
|
|
- NonZero::new(1).unwrap(),
|
|
|
- ProofData::RecordAccount(&Pubkey::new_unique(), 0),
|
|
|
+ &ZeroCiphertextProofData::zeroed(),
|
|
|
),
|
|
|
ProofLocation::ContextStateAccount(&Pubkey::new_unique()),
|
|
|
] {
|
|
|
let instruction = inner_empty_account(
|
|
|
- &spl_token_2022::id(),
|
|
|
+ &spl_token_2022_interface::id(),
|
|
|
&Pubkey::new_unique(),
|
|
|
&Pubkey::new_unique(),
|
|
|
&[],
|
|
|
@@ -730,21 +722,11 @@ mod test {
|
|
|
(
|
|
|
ProofLocation::InstructionOffset(
|
|
|
NonZero::new(1).unwrap(),
|
|
|
- ProofData::InstructionData(&CiphertextCommitmentEqualityProofData::zeroed()),
|
|
|
+ &CiphertextCommitmentEqualityProofData::zeroed(),
|
|
|
),
|
|
|
ProofLocation::InstructionOffset(
|
|
|
NonZero::new(3).unwrap(),
|
|
|
- ProofData::InstructionData(&BatchedRangeProofU64Data::zeroed()),
|
|
|
- ),
|
|
|
- ),
|
|
|
- (
|
|
|
- ProofLocation::InstructionOffset(
|
|
|
- NonZero::new(1).unwrap(),
|
|
|
- ProofData::RecordAccount(&Pubkey::new_unique(), 0),
|
|
|
- ),
|
|
|
- ProofLocation::InstructionOffset(
|
|
|
- NonZero::new(2).unwrap(),
|
|
|
- ProofData::RecordAccount(&Pubkey::new_unique(), 0),
|
|
|
+ &BatchedRangeProofU64Data::zeroed(),
|
|
|
),
|
|
|
),
|
|
|
(
|
|
|
@@ -753,7 +735,7 @@ mod test {
|
|
|
),
|
|
|
] {
|
|
|
let instruction = inner_withdraw(
|
|
|
- &spl_token_2022::id(),
|
|
|
+ &spl_token_2022_interface::id(),
|
|
|
&Pubkey::new_unique(),
|
|
|
&Pubkey::new_unique(),
|
|
|
1,
|
|
|
@@ -775,31 +757,15 @@ mod test {
|
|
|
(
|
|
|
ProofLocation::InstructionOffset(
|
|
|
NonZero::new(1).unwrap(),
|
|
|
- ProofData::InstructionData(&CiphertextCommitmentEqualityProofData::zeroed()),
|
|
|
- ),
|
|
|
- ProofLocation::InstructionOffset(
|
|
|
- NonZero::new(2).unwrap(),
|
|
|
- ProofData::InstructionData(
|
|
|
- &BatchedGroupedCiphertext3HandlesValidityProofData::zeroed(),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ProofLocation::InstructionOffset(
|
|
|
- NonZero::new(3).unwrap(),
|
|
|
- ProofData::InstructionData(&BatchedRangeProofU128Data::zeroed()),
|
|
|
- ),
|
|
|
- ),
|
|
|
- (
|
|
|
- ProofLocation::InstructionOffset(
|
|
|
- NonZero::new(1).unwrap(),
|
|
|
- ProofData::RecordAccount(&Pubkey::new_unique(), 0),
|
|
|
+ &CiphertextCommitmentEqualityProofData::zeroed(),
|
|
|
),
|
|
|
ProofLocation::InstructionOffset(
|
|
|
NonZero::new(2).unwrap(),
|
|
|
- ProofData::RecordAccount(&Pubkey::new_unique(), 0),
|
|
|
+ &BatchedGroupedCiphertext3HandlesValidityProofData::zeroed(),
|
|
|
),
|
|
|
ProofLocation::InstructionOffset(
|
|
|
NonZero::new(3).unwrap(),
|
|
|
- ProofData::RecordAccount(&Pubkey::new_unique(), 0),
|
|
|
+ &BatchedRangeProofU128Data::zeroed(),
|
|
|
),
|
|
|
),
|
|
|
(
|
|
|
@@ -809,7 +775,7 @@ mod test {
|
|
|
),
|
|
|
] {
|
|
|
let instruction = inner_transfer(
|
|
|
- &spl_token_2022::id(),
|
|
|
+ &spl_token_2022_interface::id(),
|
|
|
&Pubkey::new_unique(),
|
|
|
&Pubkey::new_unique(),
|
|
|
&Pubkey::new_unique(),
|
|
|
@@ -839,49 +805,23 @@ mod test {
|
|
|
(
|
|
|
ProofLocation::InstructionOffset(
|
|
|
NonZero::new(1).unwrap(),
|
|
|
- ProofData::InstructionData(&CiphertextCommitmentEqualityProofData::zeroed()),
|
|
|
- ),
|
|
|
- ProofLocation::InstructionOffset(
|
|
|
- NonZero::new(2).unwrap(),
|
|
|
- ProofData::InstructionData(
|
|
|
- &BatchedGroupedCiphertext3HandlesValidityProofData::zeroed(),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ProofLocation::InstructionOffset(
|
|
|
- NonZero::new(3).unwrap(),
|
|
|
- ProofData::InstructionData(&PercentageWithCapProofData::zeroed()),
|
|
|
- ),
|
|
|
- ProofLocation::InstructionOffset(
|
|
|
- NonZero::new(4).unwrap(),
|
|
|
- ProofData::InstructionData(
|
|
|
- &BatchedGroupedCiphertext2HandlesValidityProofData::zeroed(),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ProofLocation::InstructionOffset(
|
|
|
- NonZero::new(5).unwrap(),
|
|
|
- ProofData::InstructionData(&BatchedRangeProofU256Data::zeroed()),
|
|
|
- ),
|
|
|
- ),
|
|
|
- (
|
|
|
- ProofLocation::InstructionOffset(
|
|
|
- NonZero::new(1).unwrap(),
|
|
|
- ProofData::RecordAccount(&Pubkey::new_unique(), 0),
|
|
|
+ &CiphertextCommitmentEqualityProofData::zeroed(),
|
|
|
),
|
|
|
ProofLocation::InstructionOffset(
|
|
|
NonZero::new(2).unwrap(),
|
|
|
- ProofData::RecordAccount(&Pubkey::new_unique(), 0),
|
|
|
+ &BatchedGroupedCiphertext3HandlesValidityProofData::zeroed(),
|
|
|
),
|
|
|
ProofLocation::InstructionOffset(
|
|
|
NonZero::new(3).unwrap(),
|
|
|
- ProofData::RecordAccount(&Pubkey::new_unique(), 0),
|
|
|
+ &PercentageWithCapProofData::zeroed(),
|
|
|
),
|
|
|
ProofLocation::InstructionOffset(
|
|
|
NonZero::new(4).unwrap(),
|
|
|
- ProofData::RecordAccount(&Pubkey::new_unique(), 0),
|
|
|
+ &BatchedGroupedCiphertext2HandlesValidityProofData::zeroed(),
|
|
|
),
|
|
|
ProofLocation::InstructionOffset(
|
|
|
NonZero::new(5).unwrap(),
|
|
|
- ProofData::RecordAccount(&Pubkey::new_unique(), 0),
|
|
|
+ &BatchedRangeProofU256Data::zeroed(),
|
|
|
),
|
|
|
),
|
|
|
(
|
|
|
@@ -893,7 +833,7 @@ mod test {
|
|
|
),
|
|
|
] {
|
|
|
let instruction = inner_transfer_with_fee(
|
|
|
- &spl_token_2022::id(),
|
|
|
+ &spl_token_2022_interface::id(),
|
|
|
&Pubkey::new_unique(),
|
|
|
&Pubkey::new_unique(),
|
|
|
&Pubkey::new_unique(),
|