diff --git a/modules/collator-selection/src/lib.rs b/modules/collator-selection/src/lib.rs index 58d901a63e..6a62facd5d 100644 --- a/modules/collator-selection/src/lib.rs +++ b/modules/collator-selection/src/lib.rs @@ -251,7 +251,7 @@ pub mod pallet { #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { - /// Invulnurable was updated. + /// Invulnerable was updated. NewInvulnerables { new_invulnerables: Vec }, /// Desired candidates was updated. NewDesiredCandidates { new_desired_candidates: u32 }, diff --git a/modules/evm-accounts/src/lib.rs b/modules/evm-accounts/src/lib.rs index af85cee076..a12c905af3 100644 --- a/modules/evm-accounts/src/lib.rs +++ b/modules/evm-accounts/src/lib.rs @@ -240,13 +240,13 @@ impl Pallet { fn evm_account_domain_separator() -> [u8; 32] { let domain_hash = keccak256!("EIP712Domain(string name,string version,uint256 chainId,bytes32 salt)"); - let mut domain_seperator_msg = domain_hash.to_vec(); - domain_seperator_msg.extend_from_slice(keccak256!("Acala EVM claim")); // name - domain_seperator_msg.extend_from_slice(keccak256!("1")); // version - domain_seperator_msg.extend_from_slice(&to_bytes(T::ChainId::get())); // chain id - domain_seperator_msg + let mut domain_separator_msg = domain_hash.to_vec(); + domain_separator_msg.extend_from_slice(keccak256!("Acala EVM claim")); // name + domain_separator_msg.extend_from_slice(keccak256!("1")); // version + domain_separator_msg.extend_from_slice(&to_bytes(T::ChainId::get())); // chain id + domain_separator_msg .extend_from_slice(frame_system::Pallet::::block_hash(BlockNumberFor::::zero()).as_ref()); // genesis block hash - keccak_256(domain_seperator_msg.as_slice()) + keccak_256(domain_separator_msg.as_slice()) } fn do_claim_default_evm_address(who: T::AccountId) -> Result { diff --git a/modules/evm/src/lib.rs b/modules/evm/src/lib.rs index 0223006d6a..ae746b430b 100644 --- a/modules/evm/src/lib.rs +++ b/modules/evm/src/lib.rs @@ -719,14 +719,14 @@ pub mod module { ensure_root(origin)?; let _from_account = T::AddressMapping::get_account_id(&from); - let _payed: NegativeImbalanceOf; + let _paid: NegativeImbalanceOf; #[cfg(not(feature = "with-ethereum-compatibility"))] { // unreserve the transaction fee for gas_limit let weight = T::GasToWeight::convert(gas_limit); let (_, imbalance) = T::ChargeTransactionPayment::unreserve_and_charge_fee(&_from_account, weight) .map_err(|_| Error::::ChargeFeeFailed)?; - _payed = imbalance; + _paid = imbalance; } match T::Runner::call( @@ -786,7 +786,7 @@ pub mod module { let res = T::ChargeTransactionPayment::refund_fee( &_from_account, T::GasToWeight::convert(refund_gas), - _payed, + _paid, ); debug_assert!(res.is_ok()); } diff --git a/modules/evm/src/runner/state.rs b/modules/evm/src/runner/state.rs index 45fdd8437a..fb9af3bc5f 100644 --- a/modules/evm/src/runner/state.rs +++ b/modules/evm/src/runner/state.rs @@ -1625,7 +1625,7 @@ impl<'inner, 'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> Pr self.executor.state.refund_external_cost(ref_time, proof_size); } - /// Retreive the remaining gas. + /// Retrieve the remaining gas. fn remaining_gas(&self) -> u64 { self.executor.state.metadata().gasometer.gas() } @@ -1635,17 +1635,17 @@ impl<'inner, 'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> Pr Handler::log(self.executor, address, topics, data) } - /// Retreive the code address (what is the address of the precompile being called). + /// Retrieve the code address (what is the address of the precompile being called). fn code_address(&self) -> H160 { self.code_address } - /// Retreive the input data the precompile is called with. + /// Retrieve the input data the precompile is called with. fn input(&self) -> &[u8] { self.input } - /// Retreive the context in which the precompile is executed. + /// Retrieve the context in which the precompile is executed. fn context(&self) -> &Context { self.context } @@ -1655,7 +1655,7 @@ impl<'inner, 'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> Pr self.is_static } - /// Retreive the gas limit of this call. + /// Retrieve the gas limit of this call. fn gas_limit(&self) -> Option { self.gas_limit } diff --git a/modules/honzon/src/tests.rs b/modules/honzon/src/tests.rs index 5b8de3c5a7..1fb1adb0f1 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/prices/src/lib.rs b/modules/prices/src/lib.rs index e5a89a8b1b..a534871f7b 100644 --- a/modules/prices/src/lib.rs +++ b/modules/prices/src/lib.rs @@ -23,7 +23,7 @@ //! The data from Oracle cannot be used in business, prices module will do some //! process and feed prices for Acala. Process include: //! - specify a fixed price for stable currency -//! - feed price in USD or related price bewteen two currencies +//! - feed price in USD or related price between two currencies //! - lock/unlock the price data get from oracle #![cfg_attr(not(feature = "std"), no_std)] diff --git a/modules/support/src/lib.rs b/modules/support/src/lib.rs index 2973a63812..7f993c741b 100644 --- a/modules/support/src/lib.rs +++ b/modules/support/src/lib.rs @@ -120,7 +120,7 @@ pub trait TransactionPayment { who: &AccountId, weight: Weight, ) -> Result<(Balance, NegativeImbalance), TransactionValidityError>; - fn refund_fee(who: &AccountId, weight: Weight, payed: NegativeImbalance) -> Result<(), TransactionValidityError>; + fn refund_fee(who: &AccountId, weight: Weight, paid: NegativeImbalance) -> Result<(), TransactionValidityError>; fn charge_fee( who: &AccountId, len: u32, diff --git a/modules/support/src/mocks.rs b/modules/support/src/mocks.rs index fde6e20e26..e47e210f32 100644 --- a/modules/support/src/mocks.rs +++ b/modules/support/src/mocks.rs @@ -129,7 +129,7 @@ impl> fn refund_fee( _who: &AccountId, _weight: Weight, - _payed: NegativeImbalance, + _paid: NegativeImbalance, ) -> Result<(), TransactionValidityError> { Ok(()) } @@ -188,7 +188,7 @@ impl< fn refund_fee( _who: &AccountId, _weight: Weight, - _payed: NegativeImbalance, + _paid: NegativeImbalance, ) -> Result<(), TransactionValidityError> { Ok(()) } diff --git a/modules/transaction-payment/src/lib.rs b/modules/transaction-payment/src/lib.rs index 094d890143..e313f9329f 100644 --- a/modules/transaction-payment/src/lib.rs +++ b/modules/transaction-payment/src/lib.rs @@ -306,10 +306,10 @@ pub mod module { /// transaction fee paid, the second is the tip paid, if any. type OnTransactionPayment: OnUnbalanced>; - /// A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their + /// A fee multiplier for `Operational` extrinsics to compute "virtual tip" to boost their /// `priority` /// - /// This value is multipled by the `final_fee` to obtain a "virtual tip" that is later + /// This value is multiplied by the `final_fee` to obtain a "virtual tip" that is later /// added to a tip component in regular `priority` calculations. /// It means that a `Normal` transaction can front-run a similarly-sized `Operational` /// extrinsic (with no tip), by including a tip value greater than the virtual tip. @@ -371,7 +371,7 @@ pub mod module { /// Weight information for the extrinsics in this module. type WeightInfo: WeightInfo; - /// PalletId used to derivate sub account. + /// PalletId used to derivative sub account. #[pallet::constant] type PalletId: Get; @@ -379,11 +379,11 @@ pub mod module { #[pallet::constant] type TreasuryAccount: Get; - /// Custom fee surplus if not payed with native asset. + /// Custom fee surplus if not paid with native asset. #[pallet::constant] type CustomFeeSurplus: Get; - /// Alternative fee surplus if not payed with native asset. + /// Alternative fee surplus if not paid with native asset. #[pallet::constant] type AlternativeFeeSurplus: Get; @@ -1462,7 +1462,7 @@ where len: usize, _result: &DispatchResult, ) -> Result<(), TransactionValidityError> { - if let Some((tip, who, Some(payed), fee, surplus)) = pre { + if let Some((tip, who, Some(paid), fee, surplus)) = pre { let actual_fee = Pallet::::compute_actual_fee(len as u32, info, post_info, tip); let refund_fee = fee.saturating_sub(actual_fee); let mut refund = refund_fee; @@ -1489,7 +1489,7 @@ where let actual_payment = match ::Currency::deposit_into_existing(&who, refund) { Ok(refund_imbalance) => { - // The refund cannot be larger than the up front payed max weight. + // The refund cannot be larger than the up front paid max weight. // `PostDispatchInfo::calc_unspent` guards against such a case. match payed.offset(refund_imbalance) { SameOrOther::Same(actual_payment) => actual_payment, @@ -1499,7 +1499,7 @@ where } // We do not recreate the account using the refund. The up front payment // is gone in that case. - Err(_) => payed, + Err(_) => paid, }; let (tip, fee) = actual_payment.split(actual_tip); @@ -1570,14 +1570,14 @@ where fn refund_fee( who: &T::AccountId, refund_weight: Weight, - payed: NegativeImbalanceOf, + paid: NegativeImbalanceOf, ) -> Result<(), TransactionValidityError> { - log::debug!(target: "transaction-payment", "refund_fee: who: {:?}, refund_weight: {:?}, payed: {:?}", who, refund_weight, payed.peek()); + log::debug!(target: "transaction-payment", "refund_fee: who: {:?}, refund_weight: {:?}, paid: {:?}", who, refund_weight, payed.peek()); let refund = Pallet::::weight_to_fee(refund_weight); let actual_payment = match ::Currency::deposit_into_existing(who, refund) { Ok(refund_imbalance) => { - // The refund cannot be larger than the up front payed max weight. + // The refund cannot be larger than the up front paid max weight. match payed.offset(refund_imbalance) { SameOrOther::Same(actual_payment) => actual_payment, SameOrOther::None => Default::default(), @@ -1586,7 +1586,7 @@ where } // We do not recreate the account using the refund. The up front payment // is gone in that case. - Err(_) => payed, + Err(_) => paid, }; // distribute fee diff --git a/modules/xcm-interface/src/lib.rs b/modules/xcm-interface/src/lib.rs index df94b0e318..df3f514b05 100644 --- a/modules/xcm-interface/src/lib.rs +++ b/modules/xcm-interface/src/lib.rs @@ -195,8 +195,8 @@ pub mod module { fn withdraw_unbonded_from_sub_account(sub_account_index: u16, amount: Balance) -> DispatchResult { let (xcm_dest_weight, xcm_fee) = Self::xcm_dest_weight_and_fee(XcmInterfaceOperation::HomaWithdrawUnbonded); - // TODO: config xcm_dest_weight and fee for withdraw_unbonded and transfer seperately. - // Temperarily use double fee. + // TODO: config xcm_dest_weight and fee for withdraw_unbonded and transfer separately. + // Temporarily use double fee. let xcm_message = T::RelayChainCallBuilder::finalize_multiple_calls_into_xcm_message( vec![ ( diff --git a/primitives/src/unchecked_extrinsic.rs b/primitives/src/unchecked_extrinsic.rs index 1bd4ddcbf7..5a9675f84e 100644 --- a/primitives/src/unchecked_extrinsic.rs +++ b/primitives/src/unchecked_extrinsic.rs @@ -132,7 +132,7 @@ where target: "evm", "tx msg: {:?}", msg ); - let msg_hash = msg.hash(); // TODO: consider rewirte this to use `keccak_256` for hashing because it could be faster + let msg_hash = msg.hash(); // TODO: consider rewrite this to use `keccak_256` for hashing because it could be faster let signer = recover_signer(&sig, msg_hash.as_fixed_bytes()).ok_or(InvalidTransaction::BadProof)?; @@ -176,7 +176,7 @@ where target: "evm", "tx msg: {:?}", msg ); - let msg_hash = msg.hash(); // TODO: consider rewirte this to use `keccak_256` for hashing because it could be faster + let msg_hash = msg.hash(); // TODO: consider rewrite this to use `keccak_256` for hashing because it could be faster let signer = recover_signer(&sig, msg_hash.as_fixed_bytes()).ok_or(InvalidTransaction::BadProof)?; @@ -224,7 +224,7 @@ where target: "evm", "tx msg: {:?}", msg ); - let msg_hash = msg.hash(); // TODO: consider rewirte this to use `keccak_256` for hashing because it could be faster + let msg_hash = msg.hash(); // TODO: consider rewrite this to use `keccak_256` for hashing because it could be faster let signer = recover_signer(&sig, msg_hash.as_fixed_bytes()).ok_or(InvalidTransaction::BadProof)?; @@ -318,12 +318,12 @@ fn verify_eip712_signature(eth_msg: EthereumTransactionMessage, sig: [u8; 65]) - let access_list_type_hash = keccak256!("AccessList(address address,uint256[] storageKeys)"); let tx_type_hash = keccak256!("Transaction(string action,address to,uint256 nonce,uint256 tip,bytes data,uint256 value,uint256 gasLimit,uint256 storageLimit,AccessList[] accessList,uint256 validUntil)AccessList(address address,uint256[] storageKeys)"); - let mut domain_seperator_msg = domain_hash.to_vec(); - domain_seperator_msg.extend_from_slice(keccak256!("Acala EVM")); // name - domain_seperator_msg.extend_from_slice(keccak256!("1")); // version - domain_seperator_msg.extend_from_slice(&to_bytes(eth_msg.chain_id)); // chain id - domain_seperator_msg.extend_from_slice(eth_msg.genesis.as_bytes()); // salt - let domain_separator = keccak_256(domain_seperator_msg.as_slice()); + let mut domain_separator_msg = domain_hash.to_vec(); + domain_separator_msg.extend_from_slice(keccak256!("Acala EVM")); // name + domain_separator_msg.extend_from_slice(keccak256!("1")); // version + domain_separator_msg.extend_from_slice(&to_bytes(eth_msg.chain_id)); // chain id + domain_separator_msg.extend_from_slice(eth_msg.genesis.as_bytes()); // salt + let domain_separator = keccak_256(domain_separator_msg.as_slice()); let mut tx_msg = tx_type_hash.to_vec(); match eth_msg.action { diff --git a/runtime/integration-tests/src/honzon.rs b/runtime/integration-tests/src/honzon.rs index 3733c9fe2d..568e41170a 100644 --- a/runtime/integration-tests/src/honzon.rs +++ b/runtime/integration-tests/src/honzon.rs @@ -544,7 +544,7 @@ fn test_cdp_engine_module() { }); } -// Honzon's surplus can be transfered and DebitExchangeRate updates accordingly +// Honzon's surplus can be transferred and DebitExchangeRate updates accordingly #[test] fn cdp_treasury_handles_honzon_surplus_correctly() { ExtBuilder::default() @@ -612,10 +612,10 @@ fn cdp_treasury_handles_honzon_surplus_correctly() { assert_eq!(CdpTreasury::get_debit_pool(), 0); run_to_block(2); - // Empty treasury recieves stablecoins into surplus pool from loan + // Empty treasury receives stablecoins into surplus pool from loan assert_eq!(CdpTreasury::get_surplus_pool(), 270716741782); assert_eq!(CdpTreasury::get_debit_pool(), 0); - // Honzon generated cdp treasury surplus can be transfered + // Honzon generated cdp treasury surplus can be transferred assert_eq!(Currencies::free_balance(USD_CURRENCY, &AccountId::from(BOB)), 0); assert_eq!( CdpEngine::debit_exchange_rate(RELAY_CHAIN_CURRENCY), diff --git a/runtime/integration-tests/src/proxy.rs b/runtime/integration-tests/src/proxy.rs index f65c58f007..84d65bcf91 100644 --- a/runtime/integration-tests/src/proxy.rs +++ b/runtime/integration-tests/src/proxy.rs @@ -206,7 +206,7 @@ fn proxy_permissions_correct() { gov_call.clone() )); let hash = BlakeTwo256::hash_of(&(BlakeTwo256::hash(b"bob is awesome"), AccountId::from(BOB))); - // last event was sucessful tip call + // last event was successful tip call assert_eq!( System::events() .into_iter() diff --git a/runtime/integration-tests/src/treasury.rs b/runtime/integration-tests/src/treasury.rs index c6b05b53a0..fc65b9477b 100644 --- a/runtime/integration-tests/src/treasury.rs +++ b/runtime/integration-tests/src/treasury.rs @@ -120,7 +120,7 @@ fn treasury_handles_dust_correctly() { let liquid_ed = ExistentialDeposits::get(&LIQUID_CURRENCY); let usd_ed = ExistentialDeposits::get(&USD_CURRENCY); - // Test empty treasury recieves dust tokens of relay + // Test empty treasury receives dust tokens of relay assert_eq!( Currencies::free_balance(RELAY_CHAIN_CURRENCY, &TreasuryAccount::get()), 0 @@ -136,7 +136,7 @@ fn treasury_handles_dust_correctly() { relay_ed + 1 ); - // ALICE account is reaped and treasury recieves dust tokens + // ALICE account is reaped and treasury receives dust tokens assert_eq!( Currencies::free_balance(RELAY_CHAIN_CURRENCY, &AccountId::from(ALICE)), 0 @@ -201,7 +201,7 @@ fn treasury_handles_dust_correctly() { relay_ed - 1 ); - // Test empty treasury recieves dust tokens of Liquid Currency + // Test empty treasury receives dust tokens of Liquid Currency assert_eq!(Currencies::free_balance(LIQUID_CURRENCY, &TreasuryAccount::get()), 0); assert_ok!(Currencies::transfer( RuntimeOrigin::signed(AccountId::from(ALICE)), @@ -219,7 +219,7 @@ fn treasury_handles_dust_correctly() { liquid_ed - 1 ); - // Test empty treasury recieves dust tokens of USD Currency using Tokens pallet + // Test empty treasury receives dust tokens of USD Currency using Tokens pallet assert_eq!(Tokens::free_balance(USD_CURRENCY, &TreasuryAccount::get()), 0); assert_ok!(Tokens::transfer( RuntimeOrigin::signed(AccountId::from(ALICE)), diff --git a/runtime/integration-tests/src/weights.rs b/runtime/integration-tests/src/weights.rs index d5922a55fa..585a79f518 100644 --- a/runtime/integration-tests/src/weights.rs +++ b/runtime/integration-tests/src/weights.rs @@ -29,7 +29,7 @@ use frame_support::weights::constants::*; #[test] fn sanity_check_weight_per_time_constants_are_as_expected() { // These values comes from Substrate, we want to make sure that if it - // ever changes we don't accidently break Polkadot + // ever changes we don't accidentally break Polkadot assert_eq!(WEIGHT_REF_TIME_PER_SECOND, 1_000_000_000_000); assert_eq!(WEIGHT_REF_TIME_PER_MILLIS, WEIGHT_REF_TIME_PER_SECOND / 1000); assert_eq!(WEIGHT_REF_TIME_PER_MICROS, WEIGHT_REF_TIME_PER_MILLIS / 1000); diff --git a/runtime/mandala/src/authority.rs b/runtime/mandala/src/authority.rs index 3655b43789..d5a1a2e5bb 100644 --- a/runtime/mandala/src/authority.rs +++ b/runtime/mandala/src/authority.rs @@ -137,14 +137,14 @@ impl orml_authority::AsOriginId for AuthoritysOrigi } } -/// Compares privilages +/// Compares privileges fn cmp_privilege(left: &OriginCaller, right: &OriginCaller) -> Option { if left == right { return Some(Ordering::Equal); } match (left, right) { - // Root always has privilage + // Root always has privilege (OriginCaller::system(frame_system::RawOrigin::Root), _) => Some(Ordering::Greater), // Checks which one has more yes votes. diff --git a/runtime/mandala/src/benchmarking/nutsfinance_stable_asset.rs b/runtime/mandala/src/benchmarking/nutsfinance_stable_asset.rs index 9ed6ad1fb9..e995060486 100644 --- a/runtime/mandala/src/benchmarking/nutsfinance_stable_asset.rs +++ b/runtime/mandala/src/benchmarking/nutsfinance_stable_asset.rs @@ -50,11 +50,11 @@ runtime_benchmarks! { let mint_fee = 10000000u128; let swap_fee = 20000000u128; let redeem_fee = 50000000u128; - let intial_a = 10000u128; + let initial_a = 10000u128; let fee_recipient: AccountId = account("fee", 0, SEED); let yield_recipient: AccountId = account("yield", 1, SEED); register_stable_asset()?; - }: _(RawOrigin::Root, pool_asset, assets, precisions, mint_fee, swap_fee, redeem_fee, intial_a, fee_recipient, yield_recipient, 1_000_000_000_000u128) + }: _(RawOrigin::Root, pool_asset, assets, precisions, mint_fee, swap_fee, redeem_fee, initial_a, fee_recipient, yield_recipient, 1_000_000_000_000u128) modify_a { let assets = vec![LIQUID, STAKING];