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

Commit 2479c1e

Browse files
authored
token: Fix typos for cargo-spellcheck (#7503)
* token: Fix typos #### Problem There are typos in the token code, and people sometimes fix them, but mostly don't. #### Summary of changes Starting with the `token/*` directory, fix all typos or properly put them between backticks if they're code. These were all found using `cargo spellcheck` and a specialized dictionary with programming / Solana / ZK terminology. Once all of the typos are fixed, then we can add the spellchecking to CI. * Update doctests
1 parent 5e86285 commit 2479c1e

File tree

57 files changed

+358
-316
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+358
-316
lines changed

token/cli/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPL Token program command-line utility
22

3-
A basic command-line for creating and using SPL Tokens. See https://spl.solana.com/token for more details
3+
A basic command-line for creating and using SPL Tokens. See <https://spl.solana.com/token> for more details
44

55
## Build
66

token/cli/src/encryption_keypair.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Temporary ElGamal keypair argument parser.
22
//!
3-
//! NOTE: this module should be remoeved in the next Solana upgrade.
3+
//! NOTE: this module should be removed in the next Solana upgrade.
44
55
use {
66
base64::{prelude::BASE64_STANDARD, Engine},

token/client/src/token.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ where
901901
mint_result
902902
}
903903

904-
/// Retrive mint information.
904+
/// Retrieve mint information.
905905
pub async fn get_mint_info(&self) -> TokenResult<StateWithExtensionsOwned<Mint>> {
906906
let account = self.get_account(self.pubkey).await?;
907907
self.unpack_mint_info(account)
@@ -1669,7 +1669,7 @@ where
16691669
}
16701670

16711671
/// Reallocate a token account to be large enough for a set of
1672-
/// ExtensionTypes
1672+
/// `ExtensionType`s
16731673
pub async fn reallocate<S: Signers>(
16741674
&self,
16751675
account: &Pubkey,

token/confidential-transfer/ciphertext-arithmetic/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub fn subtract_from(
119119
Some(ristretto_to_elgamal_ciphertext(&result_commitment, &handle))
120120
}
121121

122-
/// Convert a `u64` amount into a curve25519 scalar
122+
/// Convert a `u64` amount into a curve-25519 scalar
123123
fn u64_to_scalar(amount: u64) -> PodScalar {
124124
let mut amount_bytes = [0u8; 32];
125125
amount_bytes[..8].copy_from_slice(&amount.to_le_bytes());
@@ -141,7 +141,7 @@ fn elgamal_ciphertext_to_ristretto(
141141
}
142142

143143
/// Convert a pair of `PodRistrettoPoint` to a `PodElGamalCiphertext`
144-
/// interpretting the first as the commitment and the second as the handle
144+
/// interpreting the first as the commitment and the second as the handle
145145
fn ristretto_to_elgamal_ciphertext(
146146
commitment: &PodRistrettoPoint,
147147
handle: &PodRistrettoPoint,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub fn check_zk_elgamal_proof_program_account(
3434
}
3535

3636
/// If a proof is to be read from a record account, the proof instruction data
37-
/// must be 5 bytes: 1 byte for the proof type and 4 bytes for the u32 offset
37+
/// must be 5 bytes: 1 byte for the proof type and 4 bytes for the `u32` offset
3838
const INSTRUCTION_DATA_LENGTH_WITH_RECORD_ACCOUNT: usize = 5;
3939

4040
/// Decodes the proof context data associated with a zero-knowledge proof

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ pub struct TransferPubkeys {
2121

2222
/// The proof context information needed to process a [Transfer] instruction.
2323
pub struct TransferProofContext {
24-
/// Ciphertext containing the low 16 bits of the transafer amount
24+
/// Ciphertext containing the low 16 bits of the transfer amount
2525
pub ciphertext_lo: PodTransferAmountCiphertext,
26-
/// Ciphertext containing the high 32 bits of the transafer amount
26+
/// Ciphertext containing the high 32 bits of the transfer amount
2727
pub ciphertext_hi: PodTransferAmountCiphertext,
2828
/// The transfer public keys associated with a transfer
2929
pub transfer_pubkeys: TransferPubkeys,

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ pub struct TransferWithFeeProofContext {
4848
pub ciphertext_lo: PodTransferAmountCiphertext,
4949
/// Group encryption of the high 48 bits of the transfer amount
5050
pub ciphertext_hi: PodTransferAmountCiphertext,
51-
/// The public encryption keys associated with the transfer: source, dest,
52-
/// auditor, and withdraw withheld authority
51+
/// The public encryption keys associated with the transfer: source,
52+
/// destination, auditor, and withdraw withheld authority
5353
pub transfer_with_fee_pubkeys: TransferWithFeePubkeys,
5454
/// The final spendable ciphertext after the transfer,
5555
pub new_source_ciphertext: PodElGamalCiphertext,
@@ -250,20 +250,20 @@ impl TransferWithFeeProofContext {
250250
}
251251
}
252252

253-
/// Ristretto generator point for curve25519
253+
/// Ristretto generator point for curve-25519
254254
const G: PodRistrettoPoint = PodRistrettoPoint([
255255
226, 242, 174, 10, 106, 188, 78, 113, 168, 132, 169, 97, 197, 0, 81, 95, 88, 227, 11, 106, 165,
256256
130, 221, 141, 182, 166, 89, 69, 224, 141, 45, 118,
257257
]);
258258

259-
/// Convert a `u64` amount into a curve25519 scalar
259+
/// Convert a `u64` amount into a curve-25519 scalar
260260
fn u64_to_scalar(amount: u64) -> PodScalar {
261261
let mut bytes = [0u8; 32];
262262
bytes[..8].copy_from_slice(&amount.to_le_bytes());
263263
PodScalar(bytes)
264264
}
265265

266-
/// Convert a `u16` amount into a curve25519 scalar
266+
/// Convert a `u16` amount into a curve-25519 scalar
267267
fn u16_to_scalar(amount: u16) -> PodScalar {
268268
let mut bytes = [0u8; 32];
269269
bytes[..2].copy_from_slice(&amount.to_le_bytes());

token/confidential-transfer/proof-generation/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ pub const TRANSFER_AMOUNT_HI_BITS: usize = 32;
2626
pub const REMAINING_BALANCE_BIT_LENGTH: usize = 64;
2727

2828
/// Takes in a 64-bit number `amount` and a bit length `bit_length`. It returns:
29-
/// - the `bit_length` low bits of `amount` interpretted as u64
30-
/// - the `(64 - bit_length)` high bits of `amount` interpretted as u64
29+
/// - the `bit_length` low bits of `amount` interpreted as `u64`
30+
/// - the `(64 - bit_length)` high bits of `amount` interpreted as `u64`
3131
pub fn try_split_u64(amount: u64, bit_length: usize) -> Option<(u64, u64)> {
3232
match bit_length {
3333
0 => Some((0, amount)),
@@ -45,7 +45,7 @@ pub fn try_split_u64(amount: u64, bit_length: usize) -> Option<(u64, u64)> {
4545
}
4646
}
4747

48-
/// Combine two numbers that are interpretted as the low and high bits of a
48+
/// Combine two numbers that are interpreted as the low and high bits of a
4949
/// target number. The `bit_length` parameter specifies the number of bits that
5050
/// `amount_hi` is to be shifted by.
5151
pub fn try_combine_lo_hi_u64(amount_lo: u64, amount_hi: u64, bit_length: usize) -> Option<u64> {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ pub struct SupplyAccountInfo {
2525
pub current_supply: PodElGamalCiphertext,
2626
/// The decryptable supply
2727
pub decryptable_supply: PodAeCiphertext,
28-
/// The supply's elgamal pubkey
28+
/// The supply's ElGamal pubkey
2929
pub supply_elgamal_pubkey: PodElGamalPubkey,
3030
}
3131

3232
impl SupplyAccountInfo {
33-
/// Creates a SupplyAccountInfo from ConfidentialMintBurn extension account
34-
/// data
33+
/// Creates a `SupplyAccountInfo` from `ConfidentialMintBurn` extension
34+
/// account data
3535
pub fn new(extension: &ConfidentialMintBurn) -> Self {
3636
Self {
3737
current_supply: extension.confidential_supply,
@@ -41,7 +41,7 @@ impl SupplyAccountInfo {
4141
}
4242

4343
/// Computes the current supply from the decryptable supply and the
44-
/// difference between the decryptable supply and the elgamal encrypted
44+
/// difference between the decryptable supply and the ElGamal encrypted
4545
/// supply ciphertext
4646
pub fn decrypt_current_supply(
4747
&self,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ pub struct InitializeMintData {
194194
/// The ElGamal pubkey used to encrypt the confidential supply
195195
#[cfg_attr(feature = "serde-traits", serde(with = "elgamalpubkey_fromstr"))]
196196
pub supply_elgamal_pubkey: PodElGamalPubkey,
197-
/// The initial 0 supply ecrypted with the supply aes key
197+
/// The initial 0 supply encrypted with the supply aes key
198198
#[cfg_attr(feature = "serde-traits", serde(with = "aeciphertext_fromstr"))]
199199
pub decryptable_supply: PodAeCiphertext,
200200
}

0 commit comments

Comments
 (0)