Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

token: Fix typos for cargo-spellcheck #7503

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion token/cli/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPL Token program command-line utility

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

## Build

Expand Down
2 changes: 1 addition & 1 deletion token/cli/src/encryption_keypair.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Temporary ElGamal keypair argument parser.
//!
//! NOTE: this module should be remoeved in the next Solana upgrade.
//! NOTE: this module should be removed in the next Solana upgrade.

use {
base64::{prelude::BASE64_STANDARD, Engine},
Expand Down
4 changes: 2 additions & 2 deletions token/client/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ where
mint_result
}

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

/// Reallocate a token account to be large enough for a set of
/// ExtensionTypes
/// `ExtensionType`s
pub async fn reallocate<S: Signers>(
&self,
account: &Pubkey,
Expand Down
4 changes: 2 additions & 2 deletions token/confidential-transfer/ciphertext-arithmetic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ pub fn subtract_from(
Some(ristretto_to_elgamal_ciphertext(&result_commitment, &handle))
}

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

/// Convert a pair of `PodRistrettoPoint` to a `PodElGamalCiphertext`
/// interpretting the first as the commitment and the second as the handle
/// interpreting the first as the commitment and the second as the handle
fn ristretto_to_elgamal_ciphertext(
commitment: &PodRistrettoPoint,
handle: &PodRistrettoPoint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn check_zk_elgamal_proof_program_account(
}

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

/// Decodes the proof context data associated with a zero-knowledge proof
Expand Down
4 changes: 2 additions & 2 deletions token/confidential-transfer/proof-extraction/src/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ pub struct TransferPubkeys {

/// The proof context information needed to process a [Transfer] instruction.
pub struct TransferProofContext {
/// Ciphertext containing the low 16 bits of the transafer amount
/// Ciphertext containing the low 16 bits of the transfer amount
pub ciphertext_lo: PodTransferAmountCiphertext,
/// Ciphertext containing the high 32 bits of the transafer amount
/// Ciphertext containing the high 32 bits of the transfer amount
pub ciphertext_hi: PodTransferAmountCiphertext,
/// The transfer public keys associated with a transfer
pub transfer_pubkeys: TransferPubkeys,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ pub struct TransferWithFeeProofContext {
pub ciphertext_lo: PodTransferAmountCiphertext,
/// Group encryption of the high 48 bits of the transfer amount
pub ciphertext_hi: PodTransferAmountCiphertext,
/// The public encryption keys associated with the transfer: source, dest,
/// auditor, and withdraw withheld authority
/// The public encryption keys associated with the transfer: source,
/// destination, auditor, and withdraw withheld authority
pub transfer_with_fee_pubkeys: TransferWithFeePubkeys,
/// The final spendable ciphertext after the transfer,
pub new_source_ciphertext: PodElGamalCiphertext,
Expand Down Expand Up @@ -250,20 +250,20 @@ impl TransferWithFeeProofContext {
}
}

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

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

/// Convert a `u16` amount into a curve25519 scalar
/// Convert a `u16` amount into a curve-25519 scalar
fn u16_to_scalar(amount: u16) -> PodScalar {
let mut bytes = [0u8; 32];
bytes[..2].copy_from_slice(&amount.to_le_bytes());
Expand Down
6 changes: 3 additions & 3 deletions token/confidential-transfer/proof-generation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ pub const TRANSFER_AMOUNT_HI_BITS: usize = 32;
pub const REMAINING_BALANCE_BIT_LENGTH: usize = 64;

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

/// Combine two numbers that are interpretted as the low and high bits of a
/// Combine two numbers that are interpreted as the low and high bits of a
/// target number. The `bit_length` parameter specifies the number of bits that
/// `amount_hi` is to be shifted by.
pub fn try_combine_lo_hi_u64(amount_lo: u64, amount_hi: u64, bit_length: usize) -> Option<u64> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ pub struct SupplyAccountInfo {
pub current_supply: PodElGamalCiphertext,
/// The decryptable supply
pub decryptable_supply: PodAeCiphertext,
/// The supply's elgamal pubkey
/// The supply's ElGamal pubkey
pub supply_elgamal_pubkey: PodElGamalPubkey,
}

impl SupplyAccountInfo {
/// Creates a SupplyAccountInfo from ConfidentialMintBurn extension account
/// data
/// Creates a `SupplyAccountInfo` from `ConfidentialMintBurn` extension
/// account data
pub fn new(extension: &ConfidentialMintBurn) -> Self {
Self {
current_supply: extension.confidential_supply,
Expand All @@ -41,7 +41,7 @@ impl SupplyAccountInfo {
}

/// Computes the current supply from the decryptable supply and the
/// difference between the decryptable supply and the elgamal encrypted
/// difference between the decryptable supply and the ElGamal encrypted
/// supply ciphertext
pub fn decrypt_current_supply(
&self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ pub struct InitializeMintData {
/// The ElGamal pubkey used to encrypt the confidential supply
#[cfg_attr(feature = "serde-traits", serde(with = "elgamalpubkey_fromstr"))]
pub supply_elgamal_pubkey: PodElGamalPubkey,
/// The initial 0 supply ecrypted with the supply aes key
/// The initial 0 supply encrypted with the supply aes key
#[cfg_attr(feature = "serde-traits", serde(with = "aeciphertext_fromstr"))]
pub decryptable_supply: PodAeCiphertext,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use {

/// Maximum bit length of any mint or burn amount
///
/// Any mint or burn amount must be less than 2^48
/// Any mint or burn amount must be less than `2^48`
pub const MAXIMUM_DEPOSIT_TRANSFER_AMOUNT: u64 = (u16::MAX as u64) + (1 << 16) * (u32::MAX as u64);

/// Bit length of the low bits of pending balance plaintext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use {
spl_token_confidential_transfer_proof_extraction::instruction::verify_and_extract_context,
};

/// Processes an [InitializeMint] instruction.
/// Processes an [`InitializeMint`] instruction.
fn process_initialize_mint(accounts: &[AccountInfo], data: &InitializeMintData) -> ProgramResult {
let account_info_iter = &mut accounts.iter();
let mint_info = next_account_info(account_info_iter)?;
Expand All @@ -54,7 +54,7 @@ fn process_initialize_mint(accounts: &[AccountInfo], data: &InitializeMintData)
Ok(())
}

/// Processes an [RotateSupplyElGamal] instruction.
/// Processes an [`RotateSupplyElGamal`] instruction.
#[cfg(feature = "zk-ops")]
fn process_rotate_supply_elgamal_pubkey(
program_id: &Pubkey,
Expand Down Expand Up @@ -110,7 +110,7 @@ fn process_rotate_supply_elgamal_pubkey(
Ok(())
}

/// Processes an [UpdateAuthority] instruction.
/// Processes an [`UpdateAuthority`] instruction.
fn process_update_decryptable_supply(
program_id: &Pubkey,
accounts: &[AccountInfo],
Expand Down Expand Up @@ -142,7 +142,7 @@ fn process_update_decryptable_supply(
Ok(())
}

/// Processes a [ConfidentialMint] instruction.
/// Processes a [`ConfidentialMint`] instruction.
#[cfg(feature = "zk-ops")]
fn process_confidential_mint(
program_id: &Pubkey,
Expand Down Expand Up @@ -267,7 +267,7 @@ fn process_confidential_mint(
Ok(())
}

/// Processes a [ConfidentialBurn] instruction.
/// Processes a [`ConfidentialBurn`] instruction.
#[cfg(feature = "zk-ops")]
fn process_confidential_burn(
program_id: &Pubkey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use {
std::slice::Iter,
};

/// Verify zero-knowledge proofs needed for a [ConfidentialMint] instruction and
/// return the corresponding proof context information.
/// Verify zero-knowledge proofs needed for a [`ConfidentialMint`] instruction
/// and return the corresponding proof context information.
#[cfg(feature = "zk-ops")]
pub fn verify_mint_proof(
account_info_iter: &mut Iter<'_, AccountInfo<'_>>,
Expand Down Expand Up @@ -65,8 +65,8 @@ pub fn verify_mint_proof(
.map_err(|e| -> TokenError { e.into() })?)
}

/// Verify zero-knowledge proofs needed for a [ConfidentialBurn] instruction and
/// return the corresponding proof context information.
/// Verify zero-knowledge proofs needed for a [`ConfidentialBurn`] instruction
/// and return the corresponding proof context information.
#[cfg(feature = "zk-ops")]
pub fn verify_burn_proof(
account_info_iter: &mut Iter<'_, AccountInfo<'_>>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ pub enum ConfidentialTransferInstruction {
/// validity proof as well as the token owner signature.
///
/// If the token account is not large enough to include the new
/// cconfidential transfer extension, then optionally reallocate the
/// confidential transfer extension, then optionally reallocate the
/// account to increase the data size. To reallocate, a payer account to
/// fund the reallocation and the system account should be included in the
/// instruction.
Expand Down
4 changes: 2 additions & 2 deletions token/program-2022/src/extension/confidential_transfer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use {

/// Maximum bit length of any deposit or transfer amount
///
/// Any deposit or transfer amount must be less than 2^48
/// Any deposit or transfer amount must be less than `2^48`
pub const MAXIMUM_DEPOSIT_TRANSFER_AMOUNT: u64 = (u16::MAX as u64) + (1 << 16) * (u32::MAX as u64);

/// Bit length of the low bits of pending balance plaintext
Expand Down Expand Up @@ -64,7 +64,7 @@ pub struct ConfidentialTransferMint {
/// `ConfidentialTransferInstruction::ConfigureAccount`)
pub auto_approve_new_accounts: PodBool,

/// Authority to decode any transfer amount in a confidential transafer.
/// Authority to decode any transfer amount in a confidential transfer.
pub auditor_elgamal_pubkey: OptionalNonZeroElGamalPubkey,
}

Expand Down
26 changes: 13 additions & 13 deletions token/program-2022/src/extension/confidential_transfer/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use {
},
};

/// Processes an [InitializeMint] instruction.
/// Processes an [`InitializeMint`] instruction.
fn process_initialize_mint(
accounts: &[AccountInfo],
authority: &OptionalNonZeroPubkey,
Expand All @@ -67,7 +67,7 @@ fn process_initialize_mint(
Ok(())
}

/// Processes an [UpdateMint] instruction.
/// Processes an [`UpdateMint`] instruction.
fn process_update_mint(
accounts: &[AccountInfo],
auto_approve_new_account: PodBool,
Expand Down Expand Up @@ -104,7 +104,7 @@ enum ElGamalPubkeySource<'a> {
ElGamalRegistry(&'a ElGamalRegistry),
}

/// Processes a [ConfigureAccountWithRegistry] instruction.
/// Processes a [`ConfigureAccountWithRegistry`] instruction.
fn process_configure_account_with_registry(
program_id: &Pubkey,
accounts: &[AccountInfo],
Expand Down Expand Up @@ -195,7 +195,7 @@ fn reallocate_for_configure_account_with_registry<'a>(
Ok(())
}

/// Processes a [ConfigureAccount] instruction.
/// Processes a [`ConfigureAccount`] instruction.
fn process_configure_account(
program_id: &Pubkey,
accounts: &[AccountInfo],
Expand Down Expand Up @@ -292,7 +292,7 @@ fn process_configure_account(
Ok(())
}

/// Processes an [ApproveAccount] instruction.
/// Processes an [`ApproveAccount`] instruction.
fn process_approve_account(accounts: &[AccountInfo]) -> ProgramResult {
let account_info_iter = &mut accounts.iter();
let token_account_info = next_account_info(account_info_iter)?;
Expand Down Expand Up @@ -326,7 +326,7 @@ fn process_approve_account(accounts: &[AccountInfo]) -> ProgramResult {
}
}

/// Processes an [EmptyAccount] instruction.
/// Processes an [`EmptyAccount`] instruction.
fn process_empty_account(
program_id: &Pubkey,
accounts: &[AccountInfo],
Expand Down Expand Up @@ -379,7 +379,7 @@ fn process_empty_account(
Ok(())
}

/// Processes a [Deposit] instruction.
/// Processes a [`Deposit`] instruction.
#[cfg(feature = "zk-ops")]
fn process_deposit(
program_id: &Pubkey,
Expand Down Expand Up @@ -480,7 +480,7 @@ pub fn verify_and_split_deposit_amount(amount: u64) -> Result<(u64, u64), TokenE
Ok((deposit_amount_lo, deposit_amount_hi))
}

/// Processes a [Withdraw] instruction.
/// Processes a [`Withdraw`] instruction.
#[cfg(feature = "zk-ops")]
fn process_withdraw(
program_id: &Pubkey,
Expand Down Expand Up @@ -584,7 +584,7 @@ fn process_withdraw(
Ok(())
}

/// Processes a [Transfer] or [TransferWithFee] instruction.
/// Processes a [`Transfer`] or [`TransferWithFee`] instruction.
#[allow(clippy::too_many_arguments)]
#[cfg(feature = "zk-ops")]
fn process_transfer(
Expand Down Expand Up @@ -1127,7 +1127,7 @@ fn process_destination_for_transfer_with_fee(
Ok(())
}

/// Processes an [ApplyPendingBalance] instruction.
/// Processes an [`ApplyPendingBalance`] instruction.
#[cfg(feature = "zk-ops")]
fn process_apply_pending_balance(
program_id: &Pubkey,
Expand Down Expand Up @@ -1177,7 +1177,7 @@ fn process_apply_pending_balance(
Ok(())
}

/// Processes a [DisableConfidentialCredits] or [EnableConfidentialCredits]
/// Processes a [`DisableConfidentialCredits`] or [`EnableConfidentialCredits`]
/// instruction.
fn process_allow_confidential_credits(
program_id: &Pubkey,
Expand Down Expand Up @@ -1208,8 +1208,8 @@ fn process_allow_confidential_credits(
Ok(())
}

/// Processes an [DisableNonConfidentialCredits] or
/// [EnableNonConfidentialCredits] instruction.
/// Processes an [`DisableNonConfidentialCredits`] or
/// [`EnableNonConfidentialCredits`] instruction.
fn process_allow_non_confidential_credits(
program_id: &Pubkey,
accounts: &[AccountInfo],
Expand Down
Loading
Loading