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

Fix typos and Spell check auto integration #3411

Closed
wants to merge 14 commits into from
5 changes: 5 additions & 0 deletions .codespell/.codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[codespell]
skip = .git,node_modules,yarn.lock,Cargo.lock
count =
quiet-level = 3
ignore-words = ./.codespell/wordlist.txt
1 change: 1 addition & 0 deletions .codespell/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
codespell==2.2.5
2 changes: 2 additions & 0 deletions .codespell/wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
crate
receipient
30 changes: 30 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# A Github action that using codespell to check spell.
# .codespellrc/.codespellrc is a config file.
# .codespellrc/wordlist.txt is a list of words that will ignore word checks.
# More details please check the following link:
# https://github.com/codespell-project/codespell

name: Codespell

on: pull_request

jobs:
codespell:
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: pip cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-

- name: Install prerequisites
run: sudo pip install -r ./.codespellrc/requirements.txt

- name: Spell check
run: codespell --config=./.codespellrc/.codespellrc
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ This CoC applies to all members of the Hyperlane Network's community including,
1. Never harass or bully anyone. Not verbally, not physically, not sexually. Harassment will not be tolerated.
2. Never discrimnate on the basis of personal characteristics or group membership.
3. Treat your fellow contributors with respect, fairness, and professionalism, especially in situations of high pressure.
4. Seek, offer, and accept objective critism of yours and others work, strive to acknowledge the contributions of others.
4. Seek, offer, and accept objective criticism of yours and others work, strive to acknowledge the contributions of others.
5. Be transparent and honest about your qualifications and any potential conflicts of interest. Transparency is a key tenant of the Hyperlane project and we expect it from all contributors.
6. Bring an open and curious mind, the Hyperlane project is designed to enable developers to express their curiousity, experiment, and build things we couldn't have imagined ourselves.
6. Bring an open and curious mind, the Hyperlane project is designed to enable developers to express their curiosity, experiment, and build things we couldn't have imagined ourselves.
7. Stay on track - Do your best to avoid off-topic discussion and make sure you are posting to the correct channel and repositories. Distractions are costly and it is far too easy for work to go off track.
8. Step down properly - Think of your fellow contributors when you step down from the project. Contributors of open-source projects come and go. It is crucial that when you leave the project or reduce your contribution significantly you do so in a way that minimizes disruption and keeps continuity in mind. Concretely this means telling your fellow contributors you are leaving and taking the proper steps to enable a smooth transition for other contributors to pick up where you left off.
9. Respect the privacy of others, and take extreme care to protect confidential data when you are exposed to it.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to Hyperlane

We'd love for you to contribue to Hyperlane! Here are the guidelines to follow when contributing:
We'd love for you to contribute to Hyperlane! Here are the guidelines to follow when contributing:

- [Code of Conduct](#coc)
- [Questions and Problems](#question)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl MigrationTrait for Migration {
"origin_tx"."{tx_egp}" AS "origin_tx_effective_gas_price",
"origin_tx"."{tx_nonce}" AS "origin_tx_nonce",
"origin_tx"."{tx_sender}" AS "origin_tx_sender",
"origin_tx"."{tx_receipient}" AS "origin_tx_recipient",
"origin_tx"."{tx_recipient}" AS "origin_tx_recipient",
Copy link
Contributor

@jmrossy jmrossy Mar 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to please also revert the changes to this database migration file or it will break the Hyperlane explorer

"origin_tx"."{tx_gas_used}" AS "origin_tx_gas_used",
"origin_tx"."{tx_cgu}" AS "origin_tx_cumulative_gas_used",

Expand All @@ -152,7 +152,7 @@ impl MigrationTrait for Migration {
"dest_tx"."{tx_egp}" AS "destination_tx_effective_gas_price",
"dest_tx"."{tx_nonce}" AS "destination_tx_nonce",
"dest_tx"."{tx_sender}" AS "destination_tx_sender",
"dest_tx"."{tx_receipient}" AS "destination_tx_recipient",
"dest_tx"."{tx_recipient}" AS "destination_tx_recipient",
"dest_tx"."{tx_gas_used}" AS "destination_tx_gas_used",
"dest_tx"."{tx_cgu}" AS "destination_tx_cumulative_gas_used",

Expand Down Expand Up @@ -214,7 +214,7 @@ impl MigrationTrait for Migration {
tx_egp = Transaction::EffectiveGasPrice.to_string(),
tx_nonce = Transaction::Nonce.to_string(),
tx_sender = Transaction::Sender.to_string(),
tx_receipient = Transaction::Recipient.to_string(),
tx_recipient = Transaction::Recipient.to_string(),
tx_gas_used = Transaction::GasUsed.to_string(),
tx_cgu = Transaction::CumulativeGasUsed.to_string(),
block_table = Block::Table.to_string(),
Expand Down
2 changes: 1 addition & 1 deletion rust/chains/hyperlane-cosmos/src/trait_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct ConnectionConf {
chain_id: String,
/// The human readable address prefix for the chains using bech32.
bech32_prefix: String,
/// Canoncial Assets Denom
/// Canonical Assets Denom
canonical_asset: String,
/// The gas price set by the cosmos-sdk validator. Note that this represents the
/// minimum price set by the validator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ mod test {
let expected_range = 900..=1000;
assert_eq!(range, expected_range);

// Update the cursor with some paritally bogus logs:
// Update the cursor with some partially bogus logs:
// - Three logs of sequence 99, i.e. duplicated
// - A log at sequence 100, which was already indexed and should be ignored
cursor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ pub(crate) mod test {
let expected_range = 90..=100;
assert_eq!(range, expected_range);

// Update the cursor with some paritally bogus logs:
// Update the cursor with some partially bogus logs:
// - A log at sequence 4, which was already indexed and should be ignored
// - Three logs of sequence 5, i.e. duplicated
// - A log at sequence 6, which is unexpected, but tolerated nonetheless
Expand Down
2 changes: 1 addition & 1 deletion rust/hyperlane-base/src/types/gcs_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl GcsStorageClientBuilder {
}

impl GcsStorageClient {
// convinience formatter
// convenience formatter
fn get_checkpoint_key(index: u32) -> String {
format!("checkpoint_{index}_with_id.json")
}
Expand Down
4 changes: 2 additions & 2 deletions rust/hyperlane-core/src/accumulator/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
// - remove ring dependency
// In accordance with its license terms, the apache2 license is reproduced below

// Can't initialize this using `lazy_static` because of a constaint in Solana: static variables cannot be writable.
// Can't initialize this using `lazy_static` because of a constraint in Solana: static variables cannot be writable.
// See the following links for more info:
// https://stackoverflow.com/questions/70630344/failed-to-deploy-my-solana-smart-contract
// https://docs.solana.com/developing/on-chain-programs/limitations#static-writable-data
Expand Down Expand Up @@ -474,7 +474,7 @@ mod tests {

let leaf_b11 = H256::from([0xDD; 32]);
tree.push_leaf(leaf_b11, depth)
.expect("Pushing in outtermost leaf failed");
.expect("Pushing in outermost leaf failed");
let expected_tree = MerkleTree::create(&[leaf_b00, leaf_b01, leaf_b10, leaf_b11], depth);
assert_eq!(tree.hash(), expected_tree.hash());

Expand Down
2 changes: 1 addition & 1 deletion rust/hyperlane-core/src/config/str_or_int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub enum StrOrIntParseError {
/// The provided integer does not match the type requirements.
#[error("Provided number is an invalid integer: {0}")]
InvalidInt(#[from] TryFromIntError),
/// Some other error occured.
/// Some other error occurred.
#[error("Could not parse integer: {0}")]
Other(String),
}
2 changes: 1 addition & 1 deletion rust/hyperlane-core/src/rpc_clients/fallback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ impl<T, B> FallbackProviderBuilder<T, B> {
}

/// Only used for testing purposes.
/// TODO: Move tests into this crate to control the visiblity with conditional compilation.
/// TODO: Move tests into this crate to control the visibility with conditional compilation.
pub fn with_max_block_time(mut self, max_block_time: Duration) -> Self {
self.max_block_time = max_block_time;
self
Expand Down
2 changes: 1 addition & 1 deletion rust/hyperlane-core/src/traits/validator_announce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ pub trait ValidatorAnnounce: HyperlaneContract + Send + Sync + Debug {
) -> ChainResult<TxOutcome>;

/// Returns the number of additional tokens needed to pay for the announce
/// transaction. Return `None` if the needed tokens canno tbe determined.
/// transaction. Return `None` if the needed tokens canno the determined.
async fn announce_tokens_needed(&self, announcement: SignedType<Announcement>) -> Option<U256>;
}
4 changes: 2 additions & 2 deletions rust/sealevel/programs/mailbox/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ fn inbox_process(
.map_err(|e| ProgramError::BorshIoError(e.to_string()))?;

// Now call into the recipient program with the verified message!
let handle_intruction = Instruction::new_with_bytes(
let handle_instruction = Instruction::new_with_bytes(
recipient_program_id,
&MessageRecipientInstruction::Handle(HandleInstruction::new(
message.origin,
Expand All @@ -388,7 +388,7 @@ fn inbox_process(
recipient_account_metas,
);
invoke_signed(
&handle_intruction,
&handle_instruction,
&recipient_infos,
&[mailbox_process_authority_pda_seeds!(
&recipient_program_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {AbstractMultisigIsm} from "../multisig/AbstractMultisigIsm.sol";
* @title AbstractCcipReadIsm
* @notice An ISM that allows arbitrary payloads to be submitted and verified on chain
* @dev https://eips.ethereum.org/EIPS/eip-3668
* @dev The AbstractCcipReadIsm provided by Hyperlane is left intentially minimalist as
* @dev The AbstractCcipReadIsm provided by Hyperlane is left intentionally minimalist as
* the range of applications that could be supported by a CcipReadIsm are so broad. However
* there are few things to note when building a custom CcipReadIsm.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Ini

/**
* @title AbstractMessageIdAuthorizedIsm
* @notice Uses external verfication options to verify interchain messages which need a authorized caller
* @notice Uses external verification options to verify interchain messages which need a authorized caller
*/
abstract contract AbstractMessageIdAuthorizedIsm is
IInterchainSecurityModule,
Expand Down
2 changes: 1 addition & 1 deletion solidity/contracts/token/extensions/FastHypERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ contract FastHypERC20 is FastTokenRouter, HypERC20 {
* @dev Burns `_amount` of tokens from `_recipient`.
* @inheritdoc FastTokenRouter
*/
function _fastRecieveFrom(
function _fastReceiveFrom(
address _sender,
uint256 _amount
) internal override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ contract FastHypERC20Collateral is FastTokenRouter, HypERC20Collateral {
* @dev Transfers in `_amount` of `wrappedToken` from `_recipient`.
* @inheritdoc FastTokenRouter
*/
function _fastRecieveFrom(
function _fastReceiveFrom(
address _sender,
uint256 _amount
) internal override {
Expand Down
2 changes: 1 addition & 1 deletion solidity/contracts/token/extensions/HypNativeScaled.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ contract HypNativeScaled is HypNative {
}

/**
* @dev Sends scaled `_amount` (multipled by `scale`) to `_recipient`.
* @dev Sends scaled `_amount` (multiplied by `scale`) to `_recipient`.
* @inheritdoc TokenRouter
*/
function _transferTo(
Expand Down
12 changes: 6 additions & 6 deletions solidity/contracts/token/libs/FastTokenRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ abstract contract FastTokenRouter is TokenRouter {

/**
* @dev allows an external user to full an unfilled fast transfer order.
* @param _recipient The recepient of the wrapped token on base chain.
* @param _recipient The recipient of the wrapped token on base chain.
* @param _amount The amount of wrapped tokens that is being bridged.
* @param _fastFee The fee the bridging entity will pay.
* @param _fastTransferId Id assigned on the remote chain to uniquely identify the transfer.
Expand All @@ -82,7 +82,7 @@ abstract contract FastTokenRouter is TokenRouter {

filledFastTransfers[filledFastTransfersKey] = msg.sender;

_fastRecieveFrom(msg.sender, _amount - _fastFee);
_fastReceiveFrom(msg.sender, _amount - _fastFee);
_fastTransferTo(_recipient, _amount - _fastFee);
}

Expand Down Expand Up @@ -126,13 +126,13 @@ abstract contract FastTokenRouter is TokenRouter {
uint256 _fastFee,
uint256 _fastTransferId
) internal virtual returns (bytes memory) {
_fastRecieveFrom(msg.sender, _amount);
_fastReceiveFrom(msg.sender, _amount);
return abi.encode(_fastFee, _fastTransferId);
}

/**
* @dev returns an address that indicates who should recieve the bridged tokens.
* @dev if _fastFees was inlcuded and someone filled the order before the mailbox made the contract call, the filler gets the funds.
* @dev returns an address that indicates who should receive the bridged tokens.
* @dev if _fastFees was included and someone filled the order before the mailbox made the contract call, the filler gets the funds.
*/
function _getTokenRecipient(
address _recipient,
Expand Down Expand Up @@ -201,7 +201,7 @@ abstract contract FastTokenRouter is TokenRouter {
* @dev Should collect `amount` of tokens from `_sender`.
* @dev The implementation is delegated.
*/
function _fastRecieveFrom(
function _fastReceiveFrom(
address _sender,
uint256 _amount
) internal virtual;
Expand Down
2 changes: 1 addition & 1 deletion solidity/test/LiquidityLayerRouter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ contract LiquidityLayerRouterTest is Test {

// ==== dispatchWithTokens ====

function testDispatchWithTokensRevertsWithUnkownBridgeAdapter() public {
function testDispatchWithTokensRevertsWithUnknownBridgeAdapter() public {
vm.expectRevert("No adapter found for bridge");
originLiquidityLayerRouter.dispatchWithTokens(
destinationDomain,
Expand Down
2 changes: 1 addition & 1 deletion solidity/test/isms/OPStackIsm.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ contract OPStackIsmTest is Test {

vm.selectFork(optimismFork);

// needs to be called by the cannonical messenger on Optimism
// needs to be called by the canonical messenger on Optimism
vm.expectRevert(NotCrossChainCall.selector);
opISM.verifyMessageId(messageId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ contract PortalAdapterTest is Test {
function testAdapter(uint256 amount) public {
// Transfers of 0 are invalid
vm.assume(amount > 0);
// Calls MockPortalBridge with the right paramters
// Calls MockPortalBridge with the right parameters
vm.expectCall(
address(portalBridge),
abi.encodeCall(
Expand Down
2 changes: 1 addition & 1 deletion solidity/test/token/HypNativeScaled.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ contract HypNativeScaledTest is Test {
environment.processNextPendingMessage();
}

function test_tranferRemote(uint256 amount) public {
function test_transferRemote(uint256 amount) public {
vm.assume(amount <= mintAmount);

uint256 nativeValue = amount * (10 ** nativeDecimals);
Expand Down
4 changes: 2 additions & 2 deletions typescript/ccip-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ProofsServiceAbi } from './abis/ProofsServiceAbi';
import * as config from './config';
import { ProofsService } from './services/ProofsService';

// Initalize Services
// Initialize Services
const proofsService = new ProofsService(
config.LIGHT_CLIENT_ADDR,
config.RPC_ADDRESS,
Expand All @@ -14,7 +14,7 @@ const proofsService = new ProofsService(
config.SUCCINCT_API_KEY,
);

// Initalize Server and add Service handlers
// Initialize Server and add Service handlers
const server = new Server();

server.add(ProofsServiceAbi, [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class LightClientService {
}

/**
* Calculates the slot given a timestamp, and the LightClient's configured Genesis Time and Secods Per Slot
* Calculates the slot given a timestamp, and the LightClient's configured Genesis Time and Seconds Per Slot
* @param timestamp timestamp to calculate slot with
*/
async calculateSlot(timestamp: bigint): Promise<bigint> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ Regardless, workload identities are a more attractive long-term option, and movi

## What is external-secrets?

The [documentation](https://external-secrets.io/v0.4.4/) is the best source. In short, it allows Kuberenetes Secrets to get their secrets from an external secret provided (like GCP's Secret Manager), all without a developer/deployer needing to touch the secrets themselves.
The [documentation](https://external-secrets.io/v0.4.4/) is the best source. In short, it allows Kubernetes Secrets to get their secrets from an external secret provided (like GCP's Secret Manager), all without a developer/deployer needing to touch the secrets themselves.

The general idea is there are `SecretStore`s (or `ClusterSecretStore`s, which are the cluster-wide version), that specify how the cluster can authenticate with the external secret provider. `ExternalSecret`s can then be specified in "application" infrastructure, which allow developers to specify a template for a Secret that will be created using the secret values from the external provider (& using the credentials from the SecretStore).
2 changes: 1 addition & 1 deletion typescript/sdk/src/core/CoreDeployer.hardhat-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe('core', async () => {
sinon.restore(); // restore normal deployer behavior and test3 will be deployed
const result = await deployer.deploy(coreConfig);
expect(result).to.have.keys(['test1', 'test2', 'test3']);
// Each test network key has entries about the other test networks, whre ISM details are stored.
// Each test network key has entries about the other test networks, where ISM details are stored.
// With this exception, the keys should be the same, so we check the intersections for equality.
const testnetKeysIntersection = Object.keys(result.test1).filter(
(key) =>
Expand Down
4 changes: 2 additions & 2 deletions typescript/sdk/src/core/HyperlaneCoreChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ export class HyperlaneCoreChecker extends HyperlaneAppChecker<
],
(bytecode) =>
// This is obviously super janky but basically we are searching
// for the ocurrences of localDomain in the bytecode and remove
// that to compare, but some coincidental ocurrences of
// for the occurrences of localDomain in the bytecode and remove
// that to compare, but some coincidental occurrences of
// localDomain in the bytecode should be not be removed which
// are just done via an offset guard
bytecode
Expand Down
2 changes: 1 addition & 1 deletion typescript/sdk/src/deploy/verify/ContractVerifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export class ContractVerifier {
contractname: `${sourceName}:${input.name}`,
contractaddress: input.address,
// TYPO IS ENFORCED BY API
constructorArguements: strip0x(input.constructorArguments ?? ''),
constructorArguments: strip0x(input.constructorArguments ?? ''),
...this.compilerOptions,
};

Expand Down
2 changes: 1 addition & 1 deletion typescript/sdk/src/deploy/verify/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export type FormOptions<Action extends ExplorerApiActions> =
contractaddress: string;
sourceCode: string;
contractname: string;
constructorArguements?: string; // TYPO IS ENFORCED BY API
constructorArguments?: string; // TYPO IS ENFORCED BY API
}
: Action extends ExplorerApiActions.MARK_PROXY
? {
Expand Down