Browse Source

Fix typos in comments (#2830)

cui fliter 1 năm trước cách đây
mục cha
commit
3e2cd0004c

+ 1 - 1
cli/src/lib.rs

@@ -2814,7 +2814,7 @@ fn account(
     idl_filepath: Option<String>,
 ) -> Result<()> {
     let (program_name, account_type_name) = account_type
-        .split_once('.') // Split at first occurance of dot
+        .split_once('.') // Split at first occurrence of dot
         .and_then(|(x, y)| y.find('.').map_or_else(|| Some((x, y)), |_| None)) // ensures no dots in second substring
         .ok_or_else(|| {
             anyhow!(

+ 2 - 2
lang/src/lib.rs

@@ -186,7 +186,7 @@ pub trait Lamports<'info>: AsRef<AccountInfo<'info>> {
 
     /// Add lamports to the account.
     ///
-    /// This method is useful for transfering lamports from a PDA.
+    /// This method is useful for transferring lamports from a PDA.
     ///
     /// # Requirements
     ///
@@ -203,7 +203,7 @@ pub trait Lamports<'info>: AsRef<AccountInfo<'info>> {
 
     /// Subtract lamports from the account.
     ///
-    /// This method is useful for transfering lamports from a PDA.
+    /// This method is useful for transferring lamports from a PDA.
     ///
     /// # Requirements
     ///

+ 1 - 1
lang/syn/src/codegen/accounts/__client_accounts.rs

@@ -117,7 +117,7 @@ pub fn generate(accs: &AccountsStruct) -> proc_macro2::TokenStream {
     // Re-export all composite account structs (i.e. other structs deriving
     // accounts embedded into this struct. Required because, these embedded
     // structs are *not* visible from the #[program] macro, which is responsible
-    // for generating the `accounts` mod, which aggregates all the the generated
+    // for generating the `accounts` mod, which aggregates all the generated
     // accounts used for structs.
     let re_exports: Vec<proc_macro2::TokenStream> = {
         // First, dedup the exports.

+ 1 - 1
lang/syn/src/codegen/accounts/__cpi_client_accounts.rs

@@ -130,7 +130,7 @@ pub fn generate(accs: &AccountsStruct) -> proc_macro2::TokenStream {
     // Re-export all composite account structs (i.e. other structs deriving
     // accounts embedded into this struct. Required because, these embedded
     // structs are *not* visible from the #[program] macro, which is responsible
-    // for generating the `accounts` mod, which aggregates all the the generated
+    // for generating the `accounts` mod, which aggregates all the generated
     // accounts used for structs.
     let re_exports: Vec<proc_macro2::TokenStream> = {
         // First, dedup the exports.

+ 1 - 1
lang/syn/src/codegen/accounts/try_accounts.rs

@@ -143,7 +143,7 @@ pub fn generate_constraints(accs: &AccountsStruct) -> proc_macro2::TokenStream {
         accs.fields.iter().filter(|af| !is_init(af)).collect();
 
     // Deserialization for each pda init field. This must be after
-    // the inital extraction from the accounts slice and before access_checks.
+    // the initial extraction from the accounts slice and before access_checks.
     let init_fields: Vec<proc_macro2::TokenStream> = accs
         .fields
         .iter()

+ 2 - 2
tests/lockup/docs/staking.md

@@ -31,7 +31,7 @@ to understand, contribute to, or modify the code.
 Accounts are the pieces of state owned by a Solana program. For reference while reading, here are all
 accounts used by the **Registry** program.
 
-* `Registrar` - Analagous to an SPL token `Mint`, the `Registrar` defines a staking instance. It has its own pool, and it's own set of rewards distributed amongst its own set of stakers.
+* `Registrar` - Analogous to an SPL token `Mint`, the `Registrar` defines a staking instance. It has its own pool, and it's own set of rewards distributed amongst its own set of stakers.
 * `Member` - Analogous to an SPL token `Account`, `Member` accounts represent a **beneficiary**'s (i.e. a wallet's) stake state. This account has several vaults, all of which represent the funds belonging to an individual user.
 * `PendingWithdrawal` - A transfer out of the staking pool (poorly named since it's not a withdrawal out of the program. But a withdrawal out of the staking pool and into a `Member`'s freely available balances).
 * `RewardVendor` - A reward that has been dropped onto stakers and is distributed pro rata to staked `Member` beneficiaries.
@@ -118,7 +118,7 @@ recreating a BFT system off chain.
 
 Another solution considerered was to use a uniswap-style AMM pool (without the swapping).
 This has a lot of advantages. First it's easy to reason about and implement in a single transaction.
-To drop rewards gloablly onto the pool, one can deposit funds directly into the pool, in which case
+To drop rewards globally onto the pool, one can deposit funds directly into the pool, in which case
 the reward is automatically received by owners of the staking pool token upon redemption, a process
 known as "gulping"--since dropping rewards increases the total value of the pool
 while their proportion of the pool remained constant.

+ 2 - 2
ts/packages/spl-governance/program/lib.rs

@@ -813,7 +813,7 @@ pub struct ProposalV1 {
     /// The number of instructions included in the proposal
     pub instructions_count: u16,
 
-    /// The index of the the next instruction to be added
+    /// The index of the next instruction to be added
     pub instructions_next_index: u16,
 
     /// When the Proposal was created and entered Draft state
@@ -1232,7 +1232,7 @@ pub struct ProposalOption {
     /// The number of transactions included in the option
     pub transactions_count: u16,
 
-    /// The index of the the next transaction to be added
+    /// The index of the next transaction to be added
     pub transactions_next_index: u16,
 }