Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,evm-tests,audit,ecosystem-modules,target,ts-tests,orml
count =
quiet-level = 3
ignore-words = ./.codespell/ignore.txt
1 change: 1 addition & 0 deletions .codespell/ignore.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nome
1 change: 1 addition & 0 deletions .codespell/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
codespell==2.4.1
35 changes: 35 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion modules/aggregated-dex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ impl<T: Config> Swap<T::AccountId, Balance, CurrencyId> for DexSwap<T> {
/// Swap by Taiga pool.
pub struct TaigaSwap<T>(PhantomData<T>);
impl<T: Config> Swap<T::AccountId, Balance, CurrencyId> for TaigaSwap<T> {
// !!! 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.
Expand Down
10 changes: 5 additions & 5 deletions modules/cdp-engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ impl<T: Config> Pallet<T> {
/// 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,
Expand Down Expand Up @@ -1015,21 +1015,21 @@ impl<T: Config> Pallet<T> {
)?;

// 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) {
<T as Config>::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) {
<T as Config>::Currency::transfer(
token_1,
&loans_module_account,
who,
remainer,
remainder,
ExistenceRequirement::AllowDeath,
)?;
}
Expand Down
12 changes: 6 additions & 6 deletions modules/cdp-treasury/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -220,15 +220,15 @@ 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 = <Self as CDPTreasuryExtended<T::AccountId>>::create_collateral_auctions(
currency_id,
amount,
target,
Self::account_id(),
splited,
split,
)?;
Ok(Some(T::WeightInfo::auction_collateral(created_auctions)).into())
}
Expand Down Expand Up @@ -525,7 +525,7 @@ impl<T: Config> CDPTreasuryExtended<T::AccountId> for Pallet<T> {
amount: Balance,
target: Balance,
refund_receiver: T::AccountId,
splited: bool,
split: bool,
) -> Result<u32, DispatchError> {
ensure!(
Self::total_collaterals_not_in_auction(currency_id) >= amount,
Expand All @@ -536,7 +536,7 @@ impl<T: Config> CDPTreasuryExtended<T::AccountId> for Pallet<T> {
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
Expand Down
2 changes: 1 addition & 1 deletion modules/collator-selection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub mod pallet {

type BalanceOf<T> = <<T as Config>::Currency as Currency<<T as SystemConfig>::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<T> sp_runtime::traits::Convert<T, Option<T>> for IdentityCollator {
Expand Down
2 changes: 1 addition & 1 deletion modules/honzon/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/support/src/honzon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub trait CDPTreasuryExtended<AccountId>: CDPTreasury<AccountId> {
amount: Self::Balance,
target: Self::Balance,
refund_receiver: AccountId,
splited: bool,
split: bool,
) -> sp_std::result::Result<u32, DispatchError>;

fn remove_liquidity_for_lp_collateral(
Expand Down
2 changes: 1 addition & 1 deletion modules/support/src/incentives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub trait IncentivesManager<AccountId, Balance, CurrencyId, PoolId> {
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<CurrencyId>) -> Vec<Balance>;
Expand Down
2 changes: 1 addition & 1 deletion runtime/acala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/precompile/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl SortedMembers<AccountId> 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")]
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/xcm_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions runtime/integration-tests/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down Expand Up @@ -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)),
Expand Down
2 changes: 1 addition & 1 deletion runtime/karura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion runtime/mandala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down