Skip to content

Commit

Permalink
fix some comments (#6318)
Browse files Browse the repository at this point in the history
Signed-off-by: cui fliter <[email protected]>
  • Loading branch information
cuishuang committed Mar 3, 2024
1 parent 304e500 commit 387bfc5
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions account-compression/sdk/tests/accountCompression.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ describe('Account Compression', () => {

assert(
splCMT.getAuthority().equals(randomSigner),
`Upon transfering authority, authority should be ${randomSigner.toString()}, but was instead updated to ${splCMT.getAuthority()}`
`Upon transferring authority, authority should be ${randomSigner.toString()}, but was instead updated to ${splCMT.getAuthority()}`
);

// Attempting to replace with new authority now works
Expand Down Expand Up @@ -342,7 +342,7 @@ describe('Account Compression', () => {

try {
await execute(provider, [replaceIx], [payerKeypair]);
assert(false, 'Attacker was able to succesfully write fake existence of a leaf');
assert(false, 'Attacker was able to successfully write fake existence of a leaf');
} catch (e) {}

const splCMT = await ConcurrentMerkleTreeAccount.fromAccountAddress(connection, cmt);
Expand Down
2 changes: 1 addition & 1 deletion docs/src/transfer-hook-interface/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ instruction for some other program, which may not need them, if that program is
going to CPI to your transfer hook program, it needs to have the proper
accounts.

Additionally, in order to perform a succesful dynamic account resolution, the
Additionally, in order to perform a successful dynamic account resolution, the
proper instruction needs to be provided to align with the instruction that was
configured in the validation account - in this case the Transfer Hook
interface's `ExecuteInstruction`. This is why we first create an
Expand Down
2 changes: 1 addition & 1 deletion governance/program/src/state/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,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
Expand Down
2 changes: 1 addition & 1 deletion governance/program/src/state/proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,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,
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/math/src/precise_number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn zero() -> InnerUint {

impl PreciseNumber {
/// Correction to apply to avoid truncation errors on division. Since
/// integer operations will always floor the result, we artifically bump it
/// integer operations will always floor the result, we artificially bump it
/// up by one half to get the expect result.
fn rounding_correction() -> InnerUint {
InnerUint::from(ONE / 2)
Expand Down
2 changes: 1 addition & 1 deletion libraries/merkle-tree-reference/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn recompute(mut leaf: Node, proof: &[Node], index: u32) -> Node {
leaf
}

// Off-chain implentation to keep track of nodes
// Off-chain implementation to keep track of nodes
pub struct MerkleTree {
pub leaf_nodes: Vec<Rc<RefCell<TreeNode>>>,
pub root: Node,
Expand Down
2 changes: 1 addition & 1 deletion libraries/tlv-account-resolution/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub struct ExtraAccountMeta {
/// Whether the account should be writable
pub is_writable: PodBool,
}
/// Helper used to to know when the top bit is set, to interpret the
/// Helper used to know when the top bit is set, to interpret the
/// discriminator as an index rather than as a type
const U8_TOP_BIT: u8 = 1 << 7;
impl ExtraAccountMeta {
Expand Down
2 changes: 1 addition & 1 deletion libraries/type-length-value/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ let value2 = state.get_value_with_repetition::<MyOtherPodValue>(2).unwrap();

The Solana blockchain exposes slabs of bytes to on-chain programs, allowing program
writers to interpret these bytes and change them however they wish. Currently,
programs interpet account bytes as being only of one type. For example, an token
programs interpret account bytes as being only of one type. For example, an token
mint account is only ever a token mint, an AMM pool account is only ever an AMM pool,
a token metadata account can only hold token metadata, etc.

Expand Down
2 changes: 1 addition & 1 deletion name-service/program/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl Processor {
// Issue the name registry account
// The creation is done in three steps: transfer, allocate and assign, because
// one cannot `system_instruction::create` an account to which lamports have
// been transfered before.
// been transferred before.
invoke(
&system_instruction::transfer(payer_account.key, &name_account_key, lamports),
&[
Expand Down
2 changes: 1 addition & 1 deletion stake-pool/cli/scripts/withdraw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ create_keypair $authority
echo "Withdrawing stakes from stake pool"
withdraw_stakes "$stake_pool_pubkey" "$validator_list" "$withdraw_sol_amount"

echo "Withdrawing stakes from stake pool to recieve it in stake receiver account"
echo "Withdrawing stakes from stake pool to receive it in stake receiver account"
withdraw_stakes_to_stake_receiver "$stake_pool_pubkey" "$validator_list" "$withdraw_sol_amount"

echo "Withdrawing SOL from stake pool to authority"
Expand Down
2 changes: 1 addition & 1 deletion stake-pool/js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ export async function withdrawStake(
});
} else if (stakeReceiverAccount && stakeReceiverAccount?.type == 'delegated') {
const voteAccount = stakeReceiverAccount.info?.stake?.delegation.voter;
if (!voteAccount) throw new Error(`Invalid stake reciever ${stakeReceiver} delegation`);
if (!voteAccount) throw new Error(`Invalid stake receiver ${stakeReceiver} delegation`);
const validatorListAccount = await connection.getAccountInfo(
stakePool.account.data.validatorList,
);
Expand Down
2 changes: 1 addition & 1 deletion token-swap/program/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3852,7 +3852,7 @@ mod tests {
accounts.pool_mint_account = old_pool_account;
}

// deposit 1 pool token fails beacuse it equates to 0 swap tokens
// deposit 1 pool token fails because it equates to 0 swap tokens
{
let (
token_a_key,
Expand Down
2 changes: 1 addition & 1 deletion token/js/src/extensions/groupMemberPointer/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function getGroupMemberPointerState(mint: Mint): Partial<GroupMemberPoint
if (extensionData !== null) {
const { authority, memberAddress } = GroupMemberPointerLayout.decode(extensionData);

// Explicity set None/Zero keys to null
// Explicitly set None/Zero keys to null
return {
authority: authority.equals(PublicKey.default) ? null : authority,
memberAddress: memberAddress.equals(PublicKey.default) ? null : memberAddress,
Expand Down
2 changes: 1 addition & 1 deletion token/js/src/extensions/groupPointer/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function getGroupPointerState(mint: Mint): Partial<GroupPointer> | null {
if (extensionData !== null) {
const { authority, groupAddress } = GroupPointerLayout.decode(extensionData);

// Explicity set None/Zero keys to null
// Explicitly set None/Zero keys to null
return {
authority: authority.equals(PublicKey.default) ? null : authority,
groupAddress: groupAddress.equals(PublicKey.default) ? null : groupAddress,
Expand Down
2 changes: 1 addition & 1 deletion token/js/src/extensions/metadataPointer/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function getMetadataPointerState(mint: Mint): Partial<MetadataPointer> |
if (extensionData !== null) {
const { authority, metadataAddress } = MetadataPointerLayout.decode(extensionData);

// Explicity set None/Zero keys to null
// Explicitly set None/Zero keys to null
return {
authority: authority.equals(PublicKey.default) ? null : authority,
metadataAddress: metadataAddress.equals(PublicKey.default) ? null : metadataAddress,
Expand Down
2 changes: 1 addition & 1 deletion token/program-2022-test/tests/cpi_guard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ async fn test_cpi_guard_close_account() {
.unwrap_err();
assert_eq!(error, client_error(TokenError::CpiGuardCloseAccountBlocked));

// but close suceeds if lamports are returned to owner
// but close succeeds if lamports are returned to owner
token
.process_ixs(
&[mk_close(account, alice.pubkey(), authority.pubkey())],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ impl TransferWithFeeProofContextInfo {
/// of the transfer amount under the source public key of the transfer.
///
/// The `TransferProofContext` contains decryption handles for the low and high
/// bits of the transfer amount. Howver, these decryption handles were
/// bits of the transfer amount. However, these decryption handles were
/// (mistakenly) removed from the split proof contexts as a form of
/// optimization. These components should be added back into these split proofs
/// in `zk-token-sdk`. Until this modifications is made, include
Expand Down
2 changes: 1 addition & 1 deletion token/program-2022/src/extension/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ pub enum ExtensionType {
ImmutableOwner,
/// Require inbound transfers to have memo
MemoTransfer,
/// Indicates that the tokens from this mint can't be transfered
/// Indicates that the tokens from this mint can't be transferred
NonTransferable,
/// Tokens accrue interest over time,
InterestBearingConfig,
Expand Down
2 changes: 1 addition & 1 deletion token/program-2022/src/extension/non_transferable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use {
bytemuck::{Pod, Zeroable},
};

/// Indicates that the tokens from this mint can't be transfered
/// Indicates that the tokens from this mint can't be transferred
#[cfg_attr(feature = "serde-traits", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde-traits", serde(rename_all = "camelCase"))]
#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable)]
Expand Down
2 changes: 1 addition & 1 deletion token/program-2022/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,7 @@ impl Processor {
Ok(())
}

/// Withdraw Excess Lamports is used to recover Lamports transfered to any
/// Withdraw Excess Lamports is used to recover Lamports transferred to any
/// TokenProgram owned account by moving them to another account
/// of the source account.
pub fn process_withdraw_excess_lamports(
Expand Down

0 comments on commit 387bfc5

Please sign in to comment.