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

Commit 1bcd07d

Browse files
committed
Field name cleanup
1 parent 656f0eb commit 1bcd07d

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

token/program-2022-test/tests/confidential_transfer.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,26 @@ struct ConfidentialTransferMintWithKeypairs {
2323
ct_mint: ConfidentialTransferMint,
2424
ct_mint_authority: Keypair,
2525
#[allow(dead_code)]
26-
ct_mint_auditor: ElGamalKeypair,
26+
ct_mint_transfer_auditor: ElGamalKeypair,
2727
#[allow(dead_code)]
2828
ct_mint_withdraw_withheld_authority: ElGamalKeypair,
2929
}
3030

3131
impl ConfidentialTransferMintWithKeypairs {
3232
fn new() -> Self {
3333
let ct_mint_authority = Keypair::new();
34-
let ct_mint_auditor = ElGamalKeypair::new_rand();
34+
let ct_mint_transfer_auditor = ElGamalKeypair::new_rand();
3535
let ct_mint_withdraw_withheld_authority = ElGamalKeypair::new_rand();
3636
let ct_mint = ConfidentialTransferMint {
3737
authority: ct_mint_authority.pubkey().into(),
3838
auto_approve_new_accounts: true.into(),
39-
auditor_pubkey: ct_mint_auditor.public.into(),
40-
withdraw_withheld_authority_pubkey: ct_mint_withdraw_withheld_authority.public.into(),
39+
transfer_auditor: ct_mint_transfer_auditor.public.into(),
40+
withdraw_withheld_authority: ct_mint_withdraw_withheld_authority.public.into(),
4141
};
4242
Self {
4343
ct_mint,
4444
ct_mint_authority,
45-
ct_mint_auditor,
45+
ct_mint_transfer_auditor,
4646
ct_mint_withdraw_withheld_authority,
4747
}
4848
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ pub struct ConfidentialTransferMint {
3939
/// * If non-zero, transfers must include ElGamal cypertext with this public key permitting the
4040
/// auditor to decode the transfer amount.
4141
/// * If all zero, auditing is currently disabled.
42-
pub auditor_pubkey: pod::ElGamalPubkey,
42+
pub transfer_auditor: pod::ElGamalPubkey,
4343

4444
/// * If non-zero, transfers must include ElGamal cypertext of the transfer fee with this
4545
/// public key. If this is the case, but the base mint is not extended for fees, then any
4646
/// transfer will fail.
4747
/// * If all zero, transfer fee is disabled. If this is the case, but the base mint is extended
4848
/// for fees, then any transfer will fail.
49-
pub withdraw_withheld_authority_pubkey: pod::ElGamalPubkey,
49+
pub withdraw_withheld_authority: pod::ElGamalPubkey,
5050
}
5151

5252
impl Extension for ConfidentialTransferMint {

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,13 +470,12 @@ fn process_transfer(
470470
&previous_instruction,
471471
)?;
472472

473-
if proof_data.transfer_with_fee_pubkeys.auditor != ct_mint.auditor_pubkey {
473+
if proof_data.transfer_with_fee_pubkeys.auditor != ct_mint.transfer_auditor {
474474
return Err(TokenError::ConfidentialTransferElGamalPubkeyMismatch.into());
475475
}
476476

477477
// `withdraw_withheld_authority` ElGamal pubkey in proof data and mint must match
478-
if proof_data.transfer_with_fee_pubkeys.fee_collector
479-
!= ct_mint.withdraw_withheld_authority_pubkey
478+
if proof_data.transfer_with_fee_pubkeys.fee_collector != ct_mint.withdraw_withheld_authority
480479
{
481480
return Err(TokenError::ConfidentialTransferElGamalPubkeyMismatch.into());
482481
}
@@ -558,7 +557,7 @@ fn process_transfer(
558557
&previous_instruction,
559558
)?;
560559

561-
if proof_data.transfer_pubkeys.auditor != ct_mint.auditor_pubkey {
560+
if proof_data.transfer_pubkeys.auditor != ct_mint.transfer_auditor {
562561
return Err(TokenError::ConfidentialTransferElGamalPubkeyMismatch.into());
563562
}
564563

0 commit comments

Comments
 (0)