diff --git a/.codespell/codespellrc b/.codespell/codespellrc new file mode 100644 index 0000000000..54e8375450 --- /dev/null +++ b/.codespell/codespellrc @@ -0,0 +1,5 @@ +[codespell] +skip = .git,node_modules,yarn.lock,Cargo.lock,evm-tests,audit,ecosystem-modules,target,ts-tests,orml +count = +quiet-level = 3 +ignore-words = ./.codespell/ignore.txt diff --git a/.codespell/ignore.txt b/.codespell/ignore.txt new file mode 100644 index 0000000000..b17d646af3 --- /dev/null +++ b/.codespell/ignore.txt @@ -0,0 +1 @@ +nome diff --git a/.codespell/requirements.txt b/.codespell/requirements.txt new file mode 100644 index 0000000000..1bb55fb1cc --- /dev/null +++ b/.codespell/requirements.txt @@ -0,0 +1 @@ +codespell==2.4.1 diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000000..5861a3927e --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,35 @@ +# A Github action that using codespell to check spelling. +# see .codespell/* for configs +# https://github.com/codespell-project/codespell + +name: codespell + +on: + # Triggers the workflow on push or pull request against main + push: + branches: [master] + pull_request: + branches: [master] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + codespell: + runs-on: ubuntu-latest + + steps: + - name: Checkout the repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install codespell requirements + run: pip install -r ./.codespell/requirements.txt + + - name: Spell check + run: codespell --config=./.codespell/codespellrc diff --git a/modules/aggregated-dex/src/lib.rs b/modules/aggregated-dex/src/lib.rs index 17c4d54bb8..89c8a7e53a 100644 --- a/modules/aggregated-dex/src/lib.rs +++ b/modules/aggregated-dex/src/lib.rs @@ -434,7 +434,7 @@ impl Swap for DexSwap { /// Swap by Taiga pool. pub struct TaigaSwap(PhantomData); impl Swap for TaigaSwap { - // !!! Note: if ths limit is `ExactTarget` and the `max_supply_amount` will cause overflow in + // !!! Note: if the limit is `ExactTarget` and the `max_supply_amount` will cause overflow in // StableAsset, will return `None`. Because the `get_best_route` of StableAsset treats it as the // actual input amount. However, it will fail so will not cause loss. Maybe need to modiry // StableAsset impl to avoid this risk. diff --git a/modules/cdp-engine/src/lib.rs b/modules/cdp-engine/src/lib.rs index 22afca1bc1..3e0f0643ad 100644 --- a/modules/cdp-engine/src/lib.rs +++ b/modules/cdp-engine/src/lib.rs @@ -973,7 +973,7 @@ impl Pallet { /// and the collateral ratio will be reduced but CDP must still be at valid risk. /// For single token collateral, try to swap collateral by DEX. For lp token collateral, /// try to swap lp components by DEX first, then add liquidity to obtain lp token, - /// CDP owner may receive some remainer assets. + /// CDP owner may receive some remainder assets. #[transactional] pub fn expand_position_collateral( who: &T::AccountId, @@ -1015,21 +1015,21 @@ impl Pallet { )?; // refund unused lp component tokens - if let Some(remainer) = available_0.checked_sub(consumption_0) { + if let Some(remainder) = available_0.checked_sub(consumption_0) { ::Currency::transfer( token_0, &loans_module_account, who, - remainer, + remainder, ExistenceRequirement::AllowDeath, )?; } - if let Some(remainer) = available_1.checked_sub(consumption_1) { + if let Some(remainder) = available_1.checked_sub(consumption_1) { ::Currency::transfer( token_1, &loans_module_account, who, - remainer, + remainder, ExistenceRequirement::AllowDeath, )?; } diff --git a/modules/cdp-treasury/src/lib.rs b/modules/cdp-treasury/src/lib.rs index de705af303..14a4163c13 100644 --- a/modules/cdp-treasury/src/lib.rs +++ b/modules/cdp-treasury/src/lib.rs @@ -206,10 +206,10 @@ pub mod module { /// - `currency_id`: collateral type /// - `amount`: collateral amount /// - `target`: target amount - /// - `splited`: split collateral to multiple auction according to the config size + /// - `split`: split collateral to multiple auction according to the config size #[pallet::call_index(1)] #[pallet::weight( - if *splited { + if *split { T::WeightInfo::auction_collateral(T::MaxAuctionsCount::get()) } else { T::WeightInfo::auction_collateral(1) @@ -220,7 +220,7 @@ pub mod module { currency_id: CurrencyId, #[pallet::compact] amount: Balance, #[pallet::compact] target: Balance, - splited: bool, + split: bool, ) -> DispatchResultWithPostInfo { T::UpdateOrigin::ensure_origin(origin)?; let created_auctions = >::create_collateral_auctions( @@ -228,7 +228,7 @@ pub mod module { amount, target, Self::account_id(), - splited, + split, )?; Ok(Some(T::WeightInfo::auction_collateral(created_auctions)).into()) } @@ -525,7 +525,7 @@ impl CDPTreasuryExtended for Pallet { amount: Balance, target: Balance, refund_receiver: T::AccountId, - splited: bool, + split: bool, ) -> Result { ensure!( Self::total_collaterals_not_in_auction(currency_id) >= amount, @@ -536,7 +536,7 @@ impl CDPTreasuryExtended for Pallet { let mut unhandled_target = target; let expected_collateral_auction_size = Self::expected_collateral_auction_size(currency_id); let max_auctions_count: Balance = T::MaxAuctionsCount::get().into(); - let lots_count = if !splited + let lots_count = if !split || max_auctions_count.is_zero() || expected_collateral_auction_size.is_zero() || amount <= expected_collateral_auction_size diff --git a/modules/collator-selection/src/lib.rs b/modules/collator-selection/src/lib.rs index dd7765bf35..037ede9d2c 100644 --- a/modules/collator-selection/src/lib.rs +++ b/modules/collator-selection/src/lib.rs @@ -104,7 +104,7 @@ pub mod pallet { type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; - /// A convertor from collators id. Since this pallet does not have stash/controller, this is + /// A converter from collators id. Since this pallet does not have stash/controller, this is /// just identity. pub struct IdentityCollator; impl sp_runtime::traits::Convert> for IdentityCollator { diff --git a/modules/honzon/src/tests.rs b/modules/honzon/src/tests.rs index d576d33072..8e9cc69d6a 100644 --- a/modules/honzon/src/tests.rs +++ b/modules/honzon/src/tests.rs @@ -266,7 +266,7 @@ fn transfer_debit_works() { HonzonModule::transfer_debit(RuntimeOrigin::signed(BOB), BTC, DOT, 1000), ArithmeticError::Underflow ); - // Won't work when transfering more debit than is present + // Won't work when transferring more debit than is present assert_noop!( HonzonModule::transfer_debit(RuntimeOrigin::signed(ALICE), BTC, DOT, 10_000), ArithmeticError::Underflow diff --git a/modules/support/src/honzon.rs b/modules/support/src/honzon.rs index 3fd0e723be..2c1b8a0f67 100644 --- a/modules/support/src/honzon.rs +++ b/modules/support/src/honzon.rs @@ -135,7 +135,7 @@ pub trait CDPTreasuryExtended: CDPTreasury { amount: Self::Balance, target: Self::Balance, refund_receiver: AccountId, - splited: bool, + split: bool, ) -> sp_std::result::Result; fn remove_liquidity_for_lp_collateral( diff --git a/modules/support/src/incentives.rs b/modules/support/src/incentives.rs index 52da5a0f60..36e55805b1 100644 --- a/modules/support/src/incentives.rs +++ b/modules/support/src/incentives.rs @@ -48,7 +48,7 @@ pub trait IncentivesManager { fn withdraw_dex_share(who: &AccountId, lp_currency_id: CurrencyId, amount: Balance) -> DispatchResult; /// Claim all available rewards for specific `PoolId` fn claim_rewards(who: AccountId, pool_id: PoolId) -> DispatchResult; - /// Gets deduction reate for claiming reward early + /// Gets deduction rate for claiming reward early fn get_claim_reward_deduction_rate(pool_id: PoolId) -> Rate; /// Gets the pending rewards for a pool, for an account fn get_pending_rewards(pool_id: PoolId, who: AccountId, reward_currency: Vec) -> Vec; diff --git a/predeploy-contracts b/predeploy-contracts index 38f8576cf6..b074c00f3e 160000 --- a/predeploy-contracts +++ b/predeploy-contracts @@ -1 +1 @@ -Subproject commit 38f8576cf624f55c7bc941aaaf64ba9ad3b77ded +Subproject commit b074c00f3e3d432c965cd9cc395122ec718a779a diff --git a/runtime/acala/src/lib.rs b/runtime/acala/src/lib.rs index 27002b3518..75b5ac5f9a 100644 --- a/runtime/acala/src/lib.rs +++ b/runtime/acala/src/lib.rs @@ -743,7 +743,7 @@ parameter_types! { pub const MinimumCount: u32 = 5; pub const ExpiresIn: Moment = 1000 * 60 * 60; // 1 hours pub RootOperatorAccountId: AccountId = AccountId::from([0xffu8; 32]); - pub const MaxFeedValues: u32 = 10; // max 10 values allowd to feed in one call. + pub const MaxFeedValues: u32 = 10; // max 10 values allowed to feed in one call. } #[cfg(feature = "runtime-benchmarks")] diff --git a/runtime/common/src/precompile/mock.rs b/runtime/common/src/precompile/mock.rs index 870f7f1a2d..4b4ab0a4f0 100644 --- a/runtime/common/src/precompile/mock.rs +++ b/runtime/common/src/precompile/mock.rs @@ -88,7 +88,7 @@ impl SortedMembers for Members { } parameter_types! { - pub const MaxFeedValues: u32 = 10; // max 10 values allowd to feed in one call. + pub const MaxFeedValues: u32 = 10; // max 10 values allowed to feed in one call. } #[cfg(feature = "runtime-benchmarks")] diff --git a/runtime/common/src/xcm_impl.rs b/runtime/common/src/xcm_impl.rs index 5515615773..083260fc91 100644 --- a/runtime/common/src/xcm_impl.rs +++ b/runtime/common/src/xcm_impl.rs @@ -73,7 +73,7 @@ where } } -/// `DropAssets` implementation support asset amount lower thant ED handled by `TakeRevenue`. +/// `DropAssets` implementation support asset amount lower that ED handled by `TakeRevenue`. /// /// parameters type: /// - `NC`: native currency_id type. diff --git a/runtime/integration-tests/src/proxy.rs b/runtime/integration-tests/src/proxy.rs index 09f4095bd4..b7abd93a82 100644 --- a/runtime/integration-tests/src/proxy.rs +++ b/runtime/integration-tests/src/proxy.rs @@ -178,7 +178,7 @@ fn proxy_permissions_correct() { stake_increment_share: false, })); - // Proxy calls do not bypass root permision + // Proxy calls do not bypass root permission assert_ok!(Proxy::proxy( RuntimeOrigin::signed(AccountId::from(ALICE)), MultiAddress::Id(AccountId::from(BOB)), @@ -299,7 +299,7 @@ fn proxy_permissions_correct() { .into(), ); - // Tests that adding more ProxyType permssions does not effect others + // Tests that adding more ProxyType permissions does not effect others assert_ok!(Proxy::proxy( RuntimeOrigin::signed(AccountId::from(BOB)), MultiAddress::Id(AccountId::from(ALICE)), diff --git a/runtime/karura/src/lib.rs b/runtime/karura/src/lib.rs index 60237a9d24..34dd361240 100644 --- a/runtime/karura/src/lib.rs +++ b/runtime/karura/src/lib.rs @@ -752,7 +752,7 @@ parameter_types! { pub const MinimumCount: u32 = 5; pub const ExpiresIn: Moment = 1000 * 60 * 60; // 1 hours pub RootOperatorAccountId: AccountId = AccountId::from([0xffu8; 32]); - pub const MaxFeedValues: u32 = 10; // max 10 values allowd to feed in one call. + pub const MaxFeedValues: u32 = 10; // max 10 values allowed to feed in one call. } #[cfg(feature = "runtime-benchmarks")] diff --git a/runtime/mandala/src/lib.rs b/runtime/mandala/src/lib.rs index d4d2755040..e0b75a5cd1 100644 --- a/runtime/mandala/src/lib.rs +++ b/runtime/mandala/src/lib.rs @@ -793,7 +793,7 @@ parameter_types! { pub const MinimumCount: u32 = 1; pub const ExpiresIn: Moment = 1000 * 60 * 60; // 1 hours pub RootOperatorAccountId: AccountId = AccountId::from([0xffu8; 32]); - pub const MaxFeedValues: u32 = 10; // max 10 values allowd to feed in one call. + pub const MaxFeedValues: u32 = 10; // max 10 values allowed to feed in one call. } #[cfg(feature = "runtime-benchmarks")]