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

Commit fbff190

Browse files
committed
clippy; review fixes
1 parent 3f3c66e commit fbff190

File tree

4 files changed

+8
-33
lines changed

4 files changed

+8
-33
lines changed

token/confidential-transfer/proof-extraction/src/encryption.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use {
55
grouped_elgamal::{
66
PodGroupedElGamalCiphertext2Handles, PodGroupedElGamalCiphertext3Handles,
77
},
8-
pedersen::PodPedersenCommitment,
98
},
109
};
1110

@@ -14,10 +13,6 @@ use {
1413
pub struct PodTransferAmountCiphertext(pub(crate) PodGroupedElGamalCiphertext3Handles);
1514

1615
impl PodTransferAmountCiphertext {
17-
pub fn extract_commitment(&self) -> PodPedersenCommitment {
18-
self.0.extract_commitment()
19-
}
20-
2116
pub fn try_extract_ciphertext(
2217
&self,
2318
index: usize,
@@ -33,10 +28,6 @@ impl PodTransferAmountCiphertext {
3328
pub struct PodFeeCiphertext(pub(crate) PodGroupedElGamalCiphertext2Handles);
3429

3530
impl PodFeeCiphertext {
36-
pub fn extract_commitment(&self) -> PodPedersenCommitment {
37-
self.0.extract_commitment()
38-
}
39-
4031
pub fn try_extract_ciphertext(
4132
&self,
4233
index: usize,
@@ -52,10 +43,6 @@ impl PodFeeCiphertext {
5243
pub struct PodBurnAmountCiphertext(pub(crate) PodGroupedElGamalCiphertext3Handles);
5344

5445
impl PodBurnAmountCiphertext {
55-
pub fn extract_commitment(&self) -> PodPedersenCommitment {
56-
self.0.extract_commitment()
57-
}
58-
5946
pub fn try_extract_ciphertext(
6047
&self,
6148
index: usize,
@@ -71,10 +58,6 @@ impl PodBurnAmountCiphertext {
7158
pub struct PodMintAmountCiphertext(pub(crate) PodGroupedElGamalCiphertext3Handles);
7259

7360
impl PodMintAmountCiphertext {
74-
pub fn extract_commitment(&self) -> PodPedersenCommitment {
75-
self.0.extract_commitment()
76-
}
77-
7861
pub fn try_extract_ciphertext(
7962
&self,
8063
index: usize,

token/confidential-transfer/proof-extraction/src/instruction.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ where
184184
)
185185
}
186186
};
187-
*expected_instruction_offset += 1;
187+
*expected_instruction_offset = expected_instruction_offset
188+
.checked_add(1)
189+
.ok_or(ProgramError::InvalidInstructionData)?;
188190
Ok(proof_instruction_offset)
189191
}
190192
ProofLocation::ContextStateAccount(context_state_account) => {

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ use {
3434
CiphertextCiphertextEqualityProofContext, CiphertextCiphertextEqualityProofData,
3535
},
3636
},
37-
spl_pod::optional_keys::OptionalNonZeroPubkey,
3837
spl_token_confidential_transfer_proof_extraction::instruction::verify_and_extract_context,
3938
};
4039

@@ -95,9 +94,7 @@ fn process_rotate_supply_elgamal_pubkey(
9594

9695
let authority_info = next_account_info(account_info_iter)?;
9796
let authority_info_data_len = authority_info.data_len();
98-
99-
let authority = OptionalNonZeroPubkey::try_from(mint_authority)?;
100-
let authority = Option::<Pubkey>::from(authority).ok_or(TokenError::NoAuthorityExists)?;
97+
let authority = mint_authority.ok_or(TokenError::NoAuthorityExists)?;
10198

10299
Processor::validate_owner(
103100
program_id,
@@ -121,17 +118,16 @@ fn process_update_decryptable_supply(
121118
) -> ProgramResult {
122119
let account_info_iter = &mut accounts.iter();
123120
let mint_info = next_account_info(account_info_iter)?;
124-
let authority_info = next_account_info(account_info_iter)?;
125-
let authority_info_data_len = authority_info.data_len();
126121

127122
check_program_account(mint_info.owner)?;
128123
let mint_data = &mut mint_info.data.borrow_mut();
129124
let mut mint = PodStateWithExtensionsMut::<PodMint>::unpack(mint_data)?;
130125
let mint_authority = mint.base.mint_authority;
131126
let mint_burn_extension = mint.get_extension_mut::<ConfidentialMintBurn>()?;
132127

133-
let authority = OptionalNonZeroPubkey::try_from(mint_authority)?;
134-
let authority = Option::<Pubkey>::from(authority).ok_or(TokenError::NoAuthorityExists)?;
128+
let authority_info = next_account_info(account_info_iter)?;
129+
let authority_info_data_len = authority_info.data_len();
130+
let authority = mint_authority.ok_or(TokenError::NoAuthorityExists)?;
135131

136132
Processor::validate_owner(
137133
program_id,
@@ -180,9 +176,7 @@ fn process_confidential_mint(
180176

181177
let authority_info = next_account_info(account_info_iter)?;
182178
let authority_info_data_len = authority_info.data_len();
183-
184-
let authority = OptionalNonZeroPubkey::try_from(mint_authority)?;
185-
let authority = Option::<Pubkey>::from(authority).ok_or(TokenError::NoAuthorityExists)?;
179+
let authority = mint_authority.ok_or(TokenError::NoAuthorityExists)?;
186180

187181
Processor::validate_owner(
188182
program_id,

token/program-2022/src/instruction.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,8 +1122,6 @@ pub enum AuthorityType {
11221122
GroupPointer,
11231123
/// Authority to set the group member address
11241124
GroupMemberPointer,
1125-
/// Authority to mint new confidential tokens
1126-
MintConfidentialTokens,
11271125
}
11281126

11291127
impl AuthorityType {
@@ -1144,7 +1142,6 @@ impl AuthorityType {
11441142
AuthorityType::MetadataPointer => 12,
11451143
AuthorityType::GroupPointer => 13,
11461144
AuthorityType::GroupMemberPointer => 14,
1147-
AuthorityType::MintConfidentialTokens => 15,
11481145
}
11491146
}
11501147

@@ -1165,7 +1162,6 @@ impl AuthorityType {
11651162
12 => Ok(AuthorityType::MetadataPointer),
11661163
13 => Ok(AuthorityType::GroupPointer),
11671164
14 => Ok(AuthorityType::GroupMemberPointer),
1168-
15 => Ok(AuthorityType::MintConfidentialTokens),
11691165
_ => Err(TokenError::InvalidInstruction.into()),
11701166
}
11711167
}

0 commit comments

Comments
 (0)