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

Commit ffbaacc

Browse files
committed
use Signersinstead of Signer for confidential transfer client functions
1 parent dc89cbe commit ffbaacc

File tree

3 files changed

+57
-59
lines changed

3 files changed

+57
-59
lines changed

token/client/src/token.rs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,16 +2271,17 @@ where
22712271
/// Create a record account containing zero-knowledge proof needed for a
22722272
/// confidential transfer.
22732273
pub async fn confidential_transfer_create_record_account<
2274-
S: Signer,
2274+
S1: Signer,
2275+
S2: Signer,
22752276
ZK: Pod + ZkProofData<U>,
22762277
U: Pod,
22772278
>(
22782279
&self,
22792280
record_account: &Pubkey,
22802281
record_authority: &Pubkey,
22812282
proof_data: &ZK,
2282-
record_account_signer: &S,
2283-
record_authority_signer: &S,
2283+
record_account_signer: &S1,
2284+
record_authority_signer: &S2,
22842285
) -> TokenResult<Vec<T::Output>> {
22852286
let proof_data = bytes_of(proof_data);
22862287
let space = proof_data
@@ -2326,11 +2327,8 @@ where
23262327
};
23272328

23282329
let first_ixs = create_record_instructions(true, first_chunk, 0);
2329-
self.process_ixs(
2330-
&first_ixs,
2331-
&[record_account_signer, record_authority_signer],
2332-
)
2333-
.await?;
2330+
let first_ixs_signers: [&dyn Signer; 2] = [record_account_signer, record_authority_signer];
2331+
self.process_ixs(&first_ixs, &first_ixs_signers).await?;
23342332

23352333
let subsequent_chunk_size =
23362334
calculate_record_max_chunk_size(create_record_instructions, false);
@@ -2354,28 +2352,28 @@ where
23542352
}
23552353

23562354
/// Close a record account.
2357-
pub async fn confidential_transfer_close_record_account<S: Signer>(
2355+
pub async fn confidential_transfer_close_record_account<S: Signers>(
23582356
&self,
23592357
record_account: &Pubkey,
23602358
record_authority: &Pubkey,
23612359
receiver: &Pubkey,
2362-
record_authority_signer: &S,
2360+
signing_keypairs: &S,
23632361
) -> TokenResult<T::Output> {
23642362
self.process_ixs(
23652363
&[spl_record::instruction::close_account(
23662364
record_account,
23672365
record_authority,
23682366
receiver,
23692367
)],
2370-
&[record_authority_signer],
2368+
signing_keypairs,
23712369
)
23722370
.await
23732371
}
23742372

23752373
/// Create a context state account containing zero-knowledge proof needed
23762374
/// for a confidential transfer instruction.
23772375
pub async fn confidential_transfer_create_context_state_account<
2378-
S: Signer,
2376+
S: Signers,
23792377
ZK: Pod + ZkProofData<U>,
23802378
U: Pod,
23812379
>(
@@ -2384,7 +2382,7 @@ where
23842382
context_state_authority: &Pubkey,
23852383
proof_data: &ZK,
23862384
split_account_creation_and_proof_verification: bool,
2387-
signer: &S,
2385+
signing_keypairs: &S,
23882386
) -> TokenResult<T::Output> {
23892387
let instruction_type = zk_proof_type_to_instruction(ZK::PROOF_TYPE)?;
23902388
let space = size_of::<ProofContextState<U>>();
@@ -2410,7 +2408,7 @@ where
24102408
space as u64,
24112409
&zk_elgamal_proof_program::id(),
24122410
)],
2413-
&[signer],
2411+
signing_keypairs,
24142412
)
24152413
.await?;
24162414

@@ -2443,14 +2441,14 @@ where
24432441
),
24442442
instruction_type.encode_verify_proof(Some(context_state_info), proof_data),
24452443
],
2446-
&[signer],
2444+
signing_keypairs,
24472445
)
24482446
.await
24492447
}
24502448
}
24512449

24522450
/// Close a ZK Token proof program context state
2453-
pub async fn confidential_transfer_close_context_state<S: Signer>(
2451+
pub async fn confidential_transfer_close_context_state<S: Signers>(
24542452
&self,
24552453
context_state_account: &Pubkey,
24562454
lamport_destination_account: &Pubkey,
@@ -2467,7 +2465,7 @@ where
24672465
context_state_info,
24682466
lamport_destination_account,
24692467
)],
2470-
&[signing_keypairs],
2468+
signing_keypairs,
24712469
)
24722470
.await
24732471
}

0 commit comments

Comments
 (0)