Browse Source

token: Fix some spelling mistakes (#3777)

Jon Cinque 2 years ago
parent
commit
bf6444776d
4 changed files with 5 additions and 5 deletions
  1. 1 1
      program/src/instruction.rs
  2. 2 2
      program/src/lib.rs
  3. 1 1
      program/src/processor.rs
  4. 1 1
      program/src/state.rs

+ 1 - 1
program/src/instruction.rs

@@ -466,7 +466,7 @@ pub enum TokenInstruction<'a> {
     },
     // Any new variants also need to be added to program-2022 `TokenInstruction`, so that the
     // latter remains a superset of this instruction set. New variants also need to be added to
-    // token/js/src/instructions/types.ts to maintain @solana/spl-token compatability
+    // token/js/src/instructions/types.ts to maintain @solana/spl-token compatibility
 }
 impl<'a> TokenInstruction<'a> {
     /// Unpacks a byte buffer into a [TokenInstruction](enum.TokenInstruction.html).

+ 2 - 2
program/src/lib.rs

@@ -53,12 +53,12 @@ pub fn amount_to_ui_amount_string_trimmed(amount: u64, decimals: u8) -> String {
     s
 }
 
-/// Try to convert a UI represenation of a token amount to its raw amount using the given decimals
+/// Try to convert a UI representation of a token amount to its raw amount using the given decimals
 /// field
 pub fn try_ui_amount_into_amount(ui_amount: String, decimals: u8) -> Result<u64, ProgramError> {
     let decimals = decimals as usize;
     let mut parts = ui_amount.split('.');
-    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
+    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
     let after_decimal = parts.next().unwrap_or("");
     let after_decimal = after_decimal.trim_end_matches('0');
     if (amount_str.is_empty() && after_decimal.is_empty())

+ 1 - 1
program/src/processor.rs

@@ -6066,7 +6066,7 @@ mod tests {
         let account = Account::unpack_unchecked(&account_account.data).unwrap();
         assert_eq!(account.amount, u64::MAX);
 
-        // atttempt to mint one more to the other account
+        // attempt to mint one more to the other account
         assert_eq!(
             Err(TokenError::Overflow.into()),
             do_process_instruction(

+ 1 - 1
program/src/state.rs

@@ -435,7 +435,7 @@ mod tests {
         let result = Account::unpack_account_owner(&src);
         assert_eq!(result, Option::None);
 
-        // The right account data size and intialized, unpack will return some key
+        // The right account data size and initialized, unpack will return some key
         let mut src: [u8; Account::LEN] = [0; Account::LEN];
         src[ACCOUNT_INITIALIZED_INDEX] = AccountState::Initialized as u8;
         let result = Account::unpack_account_owner(&src);