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

Commit 1244657

Browse files
authored
Reapply "[token-2022] Add support for reading proofs from record acco… (#7086)
Reapply "[token-2022] Add support for reading proofs from record accou… (#7084) This reverts commit e99e313.
1 parent d181f74 commit 1244657

File tree

14 files changed

+1032
-146
lines changed

14 files changed

+1032
-146
lines changed

Cargo.lock

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

token/cli/src/command.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ use {
6969
},
7070
spl_token_client::{
7171
client::{ProgramRpcClientSendTransaction, RpcClientResponse},
72+
proof_generation::ProofAccount,
7273
token::{ComputeUnitLimit, ExtensionInitializationParams, Token},
7374
},
7475
spl_token_group_interface::state::TokenGroup,
@@ -3348,7 +3349,7 @@ async fn command_deposit_withdraw_confidential_tokens(
33483349
.confidential_transfer_withdraw(
33493350
&token_account_address,
33503351
&owner,
3351-
Some(&context_state_pubkey),
3352+
Some(&ProofAccount::ContextAccount(context_state_pubkey)),
33523353
amount,
33533354
decimals,
33543355
Some(withdraw_account_info),

token/client/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ version = "0.11.0"
99

1010
[dependencies]
1111
async-trait = "0.1"
12+
bincode = "1.3.2"
13+
bytemuck = "1.16.3"
1214
curve25519-dalek = "3.2.1"
1315
futures = "0.3.30"
1416
futures-util = "0.3"
@@ -26,6 +28,7 @@ spl-associated-token-account = { version = "4.0.0", path = "../../associated-tok
2628
spl-memo = { version = "5.0", path = "../../memo/program", features = [
2729
"no-entrypoint",
2830
] }
31+
spl-record = { version = "0.2.0", path = "../../record/program", features = ["no-entrypoint"] }
2932
spl-token = { version = "6.0", path = "../program", features = [
3033
"no-entrypoint",
3134
] }

token/client/src/proof_generation.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
use {
88
curve25519_dalek::scalar::Scalar,
9+
solana_sdk::pubkey::Pubkey,
910
spl_token_2022::{
1011
error::TokenError,
1112
extension::confidential_transfer::{
@@ -32,6 +33,11 @@ use {
3233
},
3334
};
3435

36+
pub enum ProofAccount {
37+
ContextAccount(Pubkey),
38+
RecordAccount(Pubkey, u32),
39+
}
40+
3541
/// The main logic to create the five split proof data for a transfer with fee.
3642
#[allow(clippy::too_many_arguments)]
3743
pub fn transfer_with_fee_split_proof_data(

0 commit comments

Comments
 (0)