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

[token-2022] Add support for reading proofs from record accounts #7055

Merged
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/pull-request-token.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert these changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I forgot to turn off the auto formatter...

Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ jobs:
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH

- name: Build and test token
run: ./ci/cargo-test-sbf.sh token
run: |
cargo build-sbf --manifest-path record/program/Cargo.toml
./ci/cargo-test-sbf.sh token

- name: Upload programs
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -246,6 +248,7 @@ jobs:
run: |
cargo build-sbf --manifest-path token/program-2022/Cargo.toml
cargo build-sbf --manifest-path instruction-padding/program/Cargo.toml
cargo build-sbf --manifest-path record/program/Cargo.toml
./token/twoxtx-setup.sh
./token/twoxtx-solana/cargo-test-sbf --manifest-path token/program-2022-test/Cargo.toml -- --nocapture

Expand Down
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion token/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ use {
},
spl_token_client::{
client::{ProgramRpcClientSendTransaction, RpcClientResponse},
proof_generation::ProofAccount,
token::{ComputeUnitLimit, ExtensionInitializationParams, Token},
},
spl_token_group_interface::state::TokenGroup,
Expand Down Expand Up @@ -3348,7 +3349,7 @@ async fn command_deposit_withdraw_confidential_tokens(
.confidential_transfer_withdraw(
&token_account_address,
&owner,
Some(&context_state_pubkey),
Some(&ProofAccount::ContextAccount(context_state_pubkey)),
amount,
decimals,
Some(withdraw_account_info),
Expand Down
3 changes: 3 additions & 0 deletions token/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ version = "0.11.0"

[dependencies]
async-trait = "0.1"
bincode = "1.3.2"
bytemuck = "1.16.1"
curve25519-dalek = "3.2.1"
futures = "0.3.30"
futures-util = "0.3"
Expand All @@ -26,6 +28,7 @@ spl-associated-token-account = { version = "4.0.0", path = "../../associated-tok
spl-memo = { version = "5.0", path = "../../memo/program", features = [
"no-entrypoint",
] }
spl-record = { version = "0.2.0", path = "../../record/program", features = ["no-entrypoint"] }
spl-token = { version = "6.0", path = "../program", features = [
"no-entrypoint",
] }
Expand Down
6 changes: 6 additions & 0 deletions token/client/src/proof_generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use {
curve25519_dalek::scalar::Scalar,
solana_sdk::pubkey::Pubkey,
spl_token_2022::{
error::TokenError,
extension::confidential_transfer::{
Expand All @@ -32,6 +33,11 @@ use {
},
};

pub enum ProofAccount {
ContextAccount(Pubkey),
RecordAccount(Pubkey),
}

/// The main logic to create the five split proof data for a transfer with fee.
#[allow(clippy::too_many_arguments)]
pub fn transfer_with_fee_split_proof_data(
Expand Down
Loading
Loading