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

Commit 7ab4de6

Browse files
token-2022: minor rename pod types with descriptive types (#2983)
1 parent e17706c commit 7ab4de6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub struct ConfidentialTransferAccount {
102102
pub actual_pending_balance_credit_counter: PodU64,
103103

104104
/// The withheld amount of fees. This will always be zero if fees are never enabled.
105-
pub withheld_amount: pod::ElGamalCiphertext,
105+
pub withheld_amount: EncryptedWithheldAmount,
106106
}
107107

108108
impl Extension for ConfidentialTransferAccount {
@@ -121,9 +121,9 @@ impl ConfidentialTransferAccount {
121121

122122
/// Check if a `ConfidentialTransferAccount` is in a closable state
123123
pub fn closable(&self) -> ProgramResult {
124-
if self.pending_balance == pod::ElGamalCiphertext::zeroed()
125-
&& self.available_balance == pod::ElGamalCiphertext::zeroed()
126-
&& self.withheld_amount == pod::ElGamalCiphertext::zeroed()
124+
if self.pending_balance == EncryptedBalance::zeroed()
125+
&& self.available_balance == EncryptedBalance::zeroed()
126+
&& self.withheld_amount == EncryptedWithheldAmount::zeroed()
127127
{
128128
Ok(())
129129
} else {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ fn process_configure_account(
159159
confidential_transfer_account.pending_balance_credit_counter = 0.into();
160160
confidential_transfer_account.expected_pending_balance_credit_counter = 0.into();
161161
confidential_transfer_account.actual_pending_balance_credit_counter = 0.into();
162-
confidential_transfer_account.withheld_amount = pod::ElGamalCiphertext::zeroed();
162+
confidential_transfer_account.withheld_amount = EncryptedWithheldAmount::zeroed();
163163

164164
Ok(())
165165
}
@@ -234,9 +234,9 @@ fn process_empty_account(
234234
return Err(ProgramError::InvalidInstructionData);
235235
}
236236

237-
confidential_transfer_account.available_balance = pod::ElGamalCiphertext::zeroed();
237+
confidential_transfer_account.available_balance = EncryptedBalance::zeroed();
238238

239-
if confidential_transfer_account.withheld_amount != pod::ElGamalCiphertext::zeroed() {
239+
if confidential_transfer_account.withheld_amount != EncryptedWithheldAmount::zeroed() {
240240
msg!("Withheld amount is not zero");
241241
return Err(ProgramError::InvalidAccountData);
242242
}

0 commit comments

Comments
 (0)