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

Commit 9db366c

Browse files
authored
token: Fix some spelling mistakes (#3777)
1 parent 92b1ea3 commit 9db366c

File tree

11 files changed

+18
-18
lines changed

11 files changed

+18
-18
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ pub struct WithdrawInstructionData {
407407
pub amount: PodU64,
408408
/// Expected number of base 10 digits to the right of the decimal place
409409
pub decimals: u8,
410-
/// The new decryptable balance if the withrawal succeeds
410+
/// The new decryptable balance if the withdrawal succeeds
411411
pub new_decryptable_available_balance: DecryptableBalance,
412412
/// Relative location of the `ProofInstruction::VerifyWithdraw` instruction to the `Withdraw`
413413
/// instruction in the transaction

token/program-2022/src/extension/confidential_transfer/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub struct ConfidentialTransferMint {
5959

6060
/// Authority to decode any transfer amount in a confidential transafer.
6161
///
62-
/// * If non-zero, transfers must include ElGamal cypertext with this public key permitting the
62+
/// * If non-zero, transfers must include ElGamal cyphertext with this public key permitting the
6363
/// auditor to decode the transfer amount.
6464
/// * If all zero, auditing is currently disabled.
6565
pub auditor_encryption_pubkey: EncryptionPubkey,
@@ -71,7 +71,7 @@ pub struct ConfidentialTransferMint {
7171
/// amount that are associated with accounts. When combined with the fee parameters, the
7272
/// withheld fee amounts can reveal information about transfer amounts.
7373
///
74-
/// * If non-zero, transfers must include ElGamal cypertext of the transfer fee with this
74+
/// * If non-zero, transfers must include ElGamal cyphertext of the transfer fee with this
7575
/// public key. If this is the case, but the base mint is not extended for fees, then any
7676
/// transfer will fail.
7777
/// * If all zero, transfer fee is disabled. If this is the case, but the base mint is extended

token/program-2022/src/extension/interest_bearing_mint/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl InterestBearingConfig {
8888
Some(scaled_amount_with_interest.to_string())
8989
}
9090

91-
/// Try to convert a UI represenation of a token amount to its raw amount using the given decimals
91+
/// Try to convert a UI representation of a token amount to its raw amount using the given decimals
9292
/// field
9393
pub fn try_ui_amount_into_amount(
9494
&self,

token/program-2022/src/extension/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,15 +1616,15 @@ mod test {
16161616
let err = StateWithExtensionsMut::<Mint>::unpack_uninitialized(&mut buffer).unwrap_err();
16171617
assert_eq!(err, ProgramError::InvalidAccountData);
16181618

1619-
// ok since there are two bytes for the type, which is `Uninitialized`
1619+
// OK since there are two bytes for the type, which is `Uninitialized`
16201620
let mut buffer = vec![0; BASE_ACCOUNT_LENGTH + 3];
16211621
let mut state = StateWithExtensionsMut::<Mint>::unpack_uninitialized(&mut buffer).unwrap();
16221622
let err = state.get_extension_mut::<MintCloseAuthority>().unwrap_err();
16231623
assert_eq!(err, ProgramError::InvalidAccountData);
16241624

16251625
assert_eq!(state.get_extension_types().unwrap(), vec![]);
16261626

1627-
// malformed since there aren't too bytes for the type
1627+
// malformed since there aren't two bytes for the type
16281628
let mut buffer = vec![0; BASE_ACCOUNT_LENGTH + 2];
16291629
let state = StateWithExtensionsMut::<Mint>::unpack_uninitialized(&mut buffer).unwrap();
16301630
assert_eq!(

token/program-2022/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ pub fn amount_to_ui_amount_string_trimmed(amount: u64, decimals: u8) -> String {
6464
s
6565
}
6666

67-
/// Try to convert a UI represenation of a token amount to its raw amount using the given decimals
67+
/// Try to convert a UI representation of a token amount to its raw amount using the given decimals
6868
/// field
6969
pub fn try_ui_amount_into_amount(ui_amount: String, decimals: u8) -> Result<u64, ProgramError> {
7070
let decimals = decimals as usize;
7171
let mut parts = ui_amount.split('.');
72-
let mut amount_str = parts.next().unwrap().to_string(); // splitting a string, even an empty one, will always yield an iterator of at least len == 1
72+
let mut amount_str = parts.next().unwrap().to_string(); // splitting a string, even an empty one, will always yield an iterator of at least length == 1
7373
let after_decimal = parts.next().unwrap_or("");
7474
let after_decimal = after_decimal.trim_end_matches('0');
7575
if (amount_str.is_empty() && after_decimal.is_empty())

token/program-2022/src/processor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6407,7 +6407,7 @@ mod tests {
64076407
let account = Account::unpack_unchecked(&account_account.data).unwrap();
64086408
assert_eq!(account.amount, u64::MAX);
64096409

6410-
// atttempt to mint one more to the other account
6410+
// attempt to mint one more to the other account
64116411
assert_eq!(
64126412
Err(TokenError::Overflow.into()),
64136413
do_process_instruction(

token/program-2022/src/state.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ pub(crate) mod test {
468468
let result = Account::unpack_account_owner(&src);
469469
assert!(result.is_none());
470470

471-
// Account data length is multi-sig data size with a valid extension and initalized,
471+
// Account data length is multi-sig data size with a valid extension and initialized,
472472
// expect none
473473
let mut src: [u8; Multisig::LEN] = [0; Multisig::LEN];
474474
src[ACCOUNT_INITIALIZED_INDEX] = AccountState::Initialized as u8;
@@ -502,21 +502,21 @@ pub(crate) mod test {
502502
let result = Account::unpack_account_mint(&src);
503503
assert_eq!(result, Option::None);
504504

505-
// Account data length > account data size with a valid extension and initalized,
505+
// Account data length > account data size with a valid extension and initialized,
506506
// expect some key returned
507507
let mut src: [u8; Account::LEN + 5] = [0; Account::LEN + 5];
508508
src[ACCOUNT_INITIALIZED_INDEX] = AccountState::Initialized as u8;
509509
src[Account::LEN] = AccountType::Account as u8;
510510
let result = Account::unpack_account_mint(&src);
511511
assert!(result.is_some());
512512

513-
// Account data length > account data size with a valid extension but uninitalized,
513+
// Account data length > account data size with a valid extension but uninitialized,
514514
// expect none
515515
src[ACCOUNT_INITIALIZED_INDEX] = AccountState::Uninitialized as u8;
516516
let result = Account::unpack_account_mint(&src);
517517
assert!(result.is_none());
518518

519-
// Account data length is multi-sig data size with a valid extension and initalized,
519+
// Account data length is multi-sig data size with a valid extension and initialized,
520520
// expect none
521521
let mut src: [u8; Multisig::LEN] = [0; Multisig::LEN];
522522
src[ACCOUNT_INITIALIZED_INDEX] = AccountState::Initialized as u8;

token/program/src/instruction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ pub enum TokenInstruction<'a> {
466466
},
467467
// Any new variants also need to be added to program-2022 `TokenInstruction`, so that the
468468
// latter remains a superset of this instruction set. New variants also need to be added to
469-
// token/js/src/instructions/types.ts to maintain @solana/spl-token compatability
469+
// token/js/src/instructions/types.ts to maintain @solana/spl-token compatibility
470470
}
471471
impl<'a> TokenInstruction<'a> {
472472
/// Unpacks a byte buffer into a [TokenInstruction](enum.TokenInstruction.html).

token/program/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ pub fn amount_to_ui_amount_string_trimmed(amount: u64, decimals: u8) -> String {
5353
s
5454
}
5555

56-
/// Try to convert a UI represenation of a token amount to its raw amount using the given decimals
56+
/// Try to convert a UI representation of a token amount to its raw amount using the given decimals
5757
/// field
5858
pub fn try_ui_amount_into_amount(ui_amount: String, decimals: u8) -> Result<u64, ProgramError> {
5959
let decimals = decimals as usize;
6060
let mut parts = ui_amount.split('.');
61-
let mut amount_str = parts.next().unwrap().to_string(); // splitting a string, even an empty one, will always yield an iterator of at least len == 1
61+
let mut amount_str = parts.next().unwrap().to_string(); // splitting a string, even an empty one, will always yield an iterator of at least length == 1
6262
let after_decimal = parts.next().unwrap_or("");
6363
let after_decimal = after_decimal.trim_end_matches('0');
6464
if (amount_str.is_empty() && after_decimal.is_empty())

token/program/src/processor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6066,7 +6066,7 @@ mod tests {
60666066
let account = Account::unpack_unchecked(&account_account.data).unwrap();
60676067
assert_eq!(account.amount, u64::MAX);
60686068

6069-
// atttempt to mint one more to the other account
6069+
// attempt to mint one more to the other account
60706070
assert_eq!(
60716071
Err(TokenError::Overflow.into()),
60726072
do_process_instruction(

0 commit comments

Comments
 (0)