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

Commit 20c84b5

Browse files
committed
remove obsolete null check
1 parent df6cd8b commit 20c84b5

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

token/program-2022/src/extension/confidential_mint_burn/account_info.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,11 @@ impl SupplyAccountInfo {
4949
if self.supply_elgamal_pubkey.is_none() {
5050
return Err(TokenError::InvalidState);
5151
}
52-
// fresh mints are initialized with a zeroed decryptable_supply
53-
let current_decyptable_supply = if self.decryptable_supply != PodAeCiphertext::default() {
54-
// decrypt the current supply
55-
TryInto::<AeCiphertext>::try_into(self.decryptable_supply)
56-
.map_err(|_| TokenError::MalformedCiphertext)?
57-
.decrypt(aes_key)
58-
.ok_or(TokenError::MalformedCiphertext)?
59-
} else {
60-
0
61-
};
52+
// decrypt the decryptable supply
53+
let current_decyptable_supply = TryInto::<AeCiphertext>::try_into(self.decryptable_supply)
54+
.map_err(|_| TokenError::MalformedCiphertext)?
55+
.decrypt(aes_key)
56+
.ok_or(TokenError::MalformedCiphertext)?;
6257

6358
// get the difference between the supply ciphertext and the decryptable supply
6459
// explanation see https://github.com/solana-labs/solana-program-library/pull/6881#issuecomment-2385579058

0 commit comments

Comments
 (0)