This repository was archived by the owner on Mar 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
token/program-2022/src/extension/confidential_transfer Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ pub struct ConfidentialTransferAccount {
102
102
pub actual_pending_balance_credit_counter : PodU64 ,
103
103
104
104
/// 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 ,
106
106
}
107
107
108
108
impl Extension for ConfidentialTransferAccount {
@@ -121,9 +121,9 @@ impl ConfidentialTransferAccount {
121
121
122
122
/// Check if a `ConfidentialTransferAccount` is in a closable state
123
123
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 ( )
127
127
{
128
128
Ok ( ( ) )
129
129
} else {
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ fn process_configure_account(
159
159
confidential_transfer_account. pending_balance_credit_counter = 0 . into ( ) ;
160
160
confidential_transfer_account. expected_pending_balance_credit_counter = 0 . into ( ) ;
161
161
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 ( ) ;
163
163
164
164
Ok ( ( ) )
165
165
}
@@ -234,9 +234,9 @@ fn process_empty_account(
234
234
return Err ( ProgramError :: InvalidInstructionData ) ;
235
235
}
236
236
237
- confidential_transfer_account. available_balance = pod :: ElGamalCiphertext :: zeroed ( ) ;
237
+ confidential_transfer_account. available_balance = EncryptedBalance :: zeroed ( ) ;
238
238
239
- if confidential_transfer_account. withheld_amount != pod :: ElGamalCiphertext :: zeroed ( ) {
239
+ if confidential_transfer_account. withheld_amount != EncryptedWithheldAmount :: zeroed ( ) {
240
240
msg ! ( "Withheld amount is not zero" ) ;
241
241
return Err ( ProgramError :: InvalidAccountData ) ;
242
242
}
You can’t perform that action at this time.
0 commit comments