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 typo #1401

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion bin/collator/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ pub fn para_benchmark_inherent_data(
}

/// Interpret client's native runtime version name (at genesis block).
/// This is valid only for benchmarking, since genesis block is alreways refered to.
/// This is valid only for benchmarking, since genesis block is alreways referred to.
macro_rules! with_runtime {
{
$client:expr,
Expand Down
2 changes: 1 addition & 1 deletion chain-extensions/types/unified-accounts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ num_enum = { workspace = true }
parity-scale-codec = { workspace = true }
scale-info = { workspace = true }

#substarte
#substrate
sp-core = { workspace = true }
sp-runtime = { workspace = true }

Expand Down
10 changes: 5 additions & 5 deletions pallets/dapp-staking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Projects, or _dApps_, must be registered into protocol to participate.
Only a privileged `ManagerOrigin` can perform dApp registration.
The pallet itself does not make assumptions who the privileged origin is, and it can differ from runtime to runtime.

Once dApp has been registered, stakers can stake on it immediatelly.
Once dApp has been registered, stakers can stake on it immediately.

When contract is registered, it is assigned a unique compact numeric Id - 16 bit unsigned integer. This is important for the inner workings of the pallet, and is not directly exposed to the users.

Expand All @@ -89,7 +89,7 @@ After a dApp has been registered, it is possible to modify reward beneficiary or

#### Unregistration

dApp can be removed from the procotol by unregistering it.
dApp can be removed from the protocol by unregistering it.
This is a privileged action that only `ManagerOrigin` can perform.

After a dApp has been unregistered, it's no longer eligible to receive rewards.
Expand Down Expand Up @@ -165,7 +165,7 @@ Stakers can claim rewards for passed eras during which they were staking. Even i

Only rewards for passed eras can be claimed. It is possible that a successful reward claim call will claim rewards for multiple eras. This can happen if staker hasn't claimed rewards in some time, and many eras have passed since then, accumulating pending rewards.

To achieve this, the pallet's underyling storage organizes **era reward information** into **spans**. A single span covers multiple eras, e.g. from **1** to **16**. In case user has staked during era 1, and hasn't claimed rewards until era 17, they will be eligible to claim 15 rewards in total (from era 2 to 16). All of this will be done in a single claim reward call.
To achieve this, the pallet's underlying storage organizes **era reward information** into **spans**. A single span covers multiple eras, e.g. from **1** to **16**. In case user has staked during era 1, and hasn't claimed rewards until era 17, they will be eligible to claim 15 rewards in total (from era 2 to 16). All of this will be done in a single claim reward call.

In case unclaimed history has built up past one span, multiple reward claim calls will be needed to claim all of the rewards.

Expand Down Expand Up @@ -225,9 +225,9 @@ In the case a dApp doesn't satisfy the entry threshold for any tier, even though
be left out of tiers and won't earn **any** reward.

In a special and unlikely case that two or more dApps have the exact same score and satisfy tier entry threshold, but there isn't enough
leftover tier capacity to accomodate them all, this is considered _undefined_ behavior. Some of the dApps will manage to enter the tier, while
leftover tier capacity to accommodate them all, this is considered _undefined_ behavior. Some of the dApps will manage to enter the tier, while
others will be left out. There is no strict rule which defines this behavior - instead dApps are encouraged to ensure their tier entry by
having a larger stake than the other dApp(s). Tehnically, at the moment, the dApp with the lower `dApp Id` will have the advantage over a dApp with
having a larger stake than the other dApp(s). Ethnically, at the moment, the dApp with the lower `dApp Id` will have the advantage over a dApp with
the larger Id.

### Reward Expiry
Expand Down
2 changes: 1 addition & 1 deletion pallets/dapp-staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2442,7 +2442,7 @@ pub mod pallet {
/// ### Invariants of EraRewards
///
/// 1. Era number in [`DAppTiers`] must also be stored in one of the span of [`EraRewards`].
/// 2. Each span lenght entry in [`EraRewards`] should be lower than or equal to the [`T::EraRewardSpanLength`] constant.
/// 2. Each span length entry in [`EraRewards`] should be lower than or equal to the [`T::EraRewardSpanLength`] constant.
#[cfg(any(feature = "try-runtime", test))]
pub fn try_state_era_rewards() -> Result<(), sp_runtime::TryRuntimeError> {
let era_rewards = EraRewards::<T>::iter().collect::<Vec<_>>();
Expand Down
2 changes: 1 addition & 1 deletion pallets/dapp-staking/src/test/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ fn relock_unlocking_insufficient_lock_amount_fails() {
// Otherwise we always have a guarantee that the latest unlocking chunk at least covers the
// minimum staking amount.
// To test this, we will do a "dirty trick", and swap the two unlocking chunks that were just created.
// This shoudl ensure that the latest unlocking chunk is below the minimum staking amount.
// This should ensure that the latest unlocking chunk is below the minimum staking amount.
Ledger::<Test>::mutate(&account, |ledger| {
ledger.unlocking = ledger
.unlocking
Expand Down
2 changes: 1 addition & 1 deletion pallets/dynamic-evm-base-fee/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ fn bfpg_matches_expected_value_for_so_called_average_transaction() {
BaseFeePerGas::<TestRuntime>::set(init_bfpg);
let init_adj_factor = <TestRuntime as pallet::Config>::AdjustmentFactor::get();

// Slighly increase the adjustment factor, and calculate the new base fee per gas
// Slightly increase the adjustment factor, and calculate the new base fee per gas
//
// To keep it closer to reality, let's assume we're using the proposed variability factor of 0.000_015.
// Let's also assume that block fullness difference is 0.01 (1%).
Expand Down
8 changes: 4 additions & 4 deletions pallets/unified-accounts/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fn on_killed_account_hook() {
// create the mappings
connect_accounts(&ALICE, &alice_secret());

// kill alice by transfering everything to bob
// kill alice by transferring everything to bob
Balances::set_balance(&ALICE, 0);

// check killed account events
Expand Down Expand Up @@ -162,7 +162,7 @@ fn account_claim_should_work() {
signature
));

// check if all of balances is transfered to new account (ALICE) from
// check if all of balances is transferred to new account (ALICE) from
// old account (alice_eth_old_account)
assert!(System::events().iter().any(|r| matches!(
&r.event,
Expand Down Expand Up @@ -242,7 +242,7 @@ fn account_default_claim_should_not_work_if_collision() {
let bob_default_h160 = <UnifiedAccounts as UnifiedAddressMapper<_>>::to_default_h160(&BOB);

// create mapping of alice native with bob's default address
// in real world possibilty of this happening is minuscule
// in real world possibility of this happening is minuscule
EvmToNative::<TestRuntime>::insert(&bob_default_h160, &ALICE);
NativeToEvm::<TestRuntime>::insert(&ALICE, &bob_default_h160);

Expand Down Expand Up @@ -362,7 +362,7 @@ fn charging_storage_fee_should_not_reap_account() {
);

//
// With sufficent funds, claim should succeed
// With sufficient funds, claim should succeed
//
assert_ok!(UnifiedAccounts::claim_evm_address(
RuntimeOrigin::signed(ALICE),
Expand Down
2 changes: 1 addition & 1 deletion pallets/xc-asset-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ pub mod pallet {
#[pallet::event]
#[pallet::generate_deposit(pub(crate) fn deposit_event)]
pub enum Event<T: Config> {
/// Registed mapping between asset type and asset Id.
/// Registered mapping between asset type and asset Id.
AssetRegistered {
asset_location: VersionedLocation,
asset_id: T::AssetId,
Expand Down
6 changes: 3 additions & 3 deletions precompiles/assets-erc20/ERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@
external returns (bool);

/**
* @dev Event emited when a transfer has been performed.
* @dev Event emitted when a transfer has been performed.
* Selector: ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
* @param from address The address sending the tokens
* @param to address The address receiving the tokens.
* @param value uint256 The amount of tokens transfered.
* @param value uint256 The amount of tokens transferred.
*/
event Transfer(
address indexed from,
Expand All @@ -97,7 +97,7 @@
);

/**
* @dev Event emited when an approval has been registered.
* @dev Event emitted when an approval has been registered.
* Selector: 8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925
* @param owner address Owner of the tokens.
* @param spender address Allowed spender.
Expand Down
2 changes: 1 addition & 1 deletion precompiles/assets-erc20/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl pallet_evm::Config for Runtime {
}

// These parameters dont matter much as this will only be called by root with the forced arguments
// No deposit is substracted with those methods
// No deposit is subtracted with those methods
parameter_types! {
pub const AssetDeposit: Balance = 0;
pub const AssetAccountDeposit: Balance = 0;
Expand Down
2 changes: 1 addition & 1 deletion precompiles/dapp-staking/src/test/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl CycleConfiguration for DummyCycleConfiguration {
}
}

// Just to satsify the trait bound
// Just to satisfy the trait bound
#[cfg(feature = "runtime-benchmarks")]
pub struct BenchmarkHelper<SC, ACC>(sp_std::marker::PhantomData<(SC, ACC)>);
#[cfg(feature = "runtime-benchmarks")]
Expand Down
10 changes: 5 additions & 5 deletions precompiles/xcm/XCM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface XCM {
*
* How method check that assets list is valid:
* - all assets resolved to multi-location (on runtime level)
* - all assets has corresponded amount (lenght of assets list matched to amount list)
* - all assets has corresponded amount (length of assets list matched to amount list)
*/
function assets_withdraw(
address[] calldata asset_id,
Expand All @@ -38,7 +38,7 @@ interface XCM {
*
* How method check that assets list is valid:
* - all assets resolved to multi-location (on runtime level)
* - all assets has corresponded amount (lenght of assets list matched to amount list)
* - all assets has corresponded amount (length of assets list matched to amount list)
*/
function assets_withdraw(
address[] calldata asset_id,
Expand All @@ -52,7 +52,7 @@ interface XCM {
/**
* @param parachain_id - destination parachain Id (ignored if is_relay is true)
* @param is_relay - if true, destination is relay_chain, if false it is parachain (see previous argument)
* @param payment_asset_id - ETH address of the local asset derivate used to pay for execution in the destination chain
* @param payment_asset_id - ETH address of the local asset derivative used to pay for execution in the destination chain
* @param payment_amount - amount of payment asset to use for execution payment - should cover cost of XCM instructions + Transact call weight.
* @param call - encoded call data (must be decodable by remote chain)
* @param transact_weight - max weight that the encoded call is allowed to consume in the destination chain
Expand All @@ -78,7 +78,7 @@ interface XCM {
*
* How method check that assets list is valid:
* - all assets resolved to multi-location (on runtime level)
* - all assets has corresponded amount (lenght of assets list matched to amount list)
* - all assets has corresponded amount (length of assets list matched to amount list)
*/
function assets_reserve_transfer(
address[] calldata asset_id,
Expand All @@ -100,7 +100,7 @@ interface XCM {
*
* How method check that assets list is valid:
* - all assets resolved to multi-location (on runtime level)
* - all assets has corresponded amount (lenght of assets list matched to amount list)
* - all assets has corresponded amount (length of assets list matched to amount list)
*/
function assets_reserve_transfer(
address[] calldata asset_id,
Expand Down
2 changes: 1 addition & 1 deletion precompiles/xcm/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ impl pallet_balances::Config for Runtime {
}

// These parameters dont matter much as this will only be called by root with the forced arguments
// No deposit is substracted with those methods
// No deposit is subtracted with those methods
parameter_types! {
pub const AssetDeposit: Balance = 0;
pub const AssetAccountDeposit: Balance = 0;
Expand Down
2 changes: 1 addition & 1 deletion precompiles/xcm/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ mod xcm_new_interface_test {
}]),
);
let weight = WeightV2::from(3_000_000_000u64, 1024);
// we only allow upto 2 currencies to be transfered
// we only allow upto 2 currencies to be transferred
let currencies = vec![
(
Address::from(Runtime::asset_id_to_address(2u128)),
Expand Down
4 changes: 2 additions & 2 deletions primitives/src/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ where
assert_ok!(pallet_assets::Pallet::<T>::force_create(
RawOrigin::Root.into(),
(i as u128).into(),
// min balance, no significane in holding
// min balance, no significance in holding
Address::Id([0u8; 32].into()).into(),
true,
// min balance, no significane in holding
// min balance, no significance in holding
1u128.into()
));

Expand Down
6 changes: 3 additions & 3 deletions primitives/src/xcm/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ fn fixed_rate_of_foreign_asset_buy_is_ok() {
};
let weight: Weight = Weight::from_parts(1_000_000_000, 0);
let ctx = XcmContext {
// arbitary ML
// arbitrary ML
origin: Some(Location::here()),
message_id: XcmHash::default(),
topic: None,
Expand Down Expand Up @@ -255,7 +255,7 @@ fn fixed_rate_of_foreign_asset_buy_execution_fails() {
};
let weight: Weight = Weight::from_parts(3_000_000_000, 0);
let ctx = XcmContext {
// arbitary ML
// arbitrary ML
origin: Some(Location::here()),
message_id: XcmHash::default(),
topic: None,
Expand Down Expand Up @@ -298,7 +298,7 @@ fn fixed_rate_of_foreign_asset_refund_is_ok() {
};
let weight: Weight = Weight::from_parts(1_000_000_000, 0);
let ctx = XcmContext {
// arbitary ML
// arbitrary ML
origin: Some(Location::here()),
message_id: XcmHash::default(),
topic: None,
Expand Down
2 changes: 1 addition & 1 deletion runtime/astar/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl_opaque_keys! {
}
}

/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers.
/// We assume that ~10% of the block weight is consumed by `on_initialize` handlers.
/// This is used to limit the maximal weight of a single extrinsic.
const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);
/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used
Expand Down
2 changes: 1 addition & 1 deletion runtime/shibuya/src/genesis_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub fn default_config(para_id: u32) -> serde_json::Value {
Permill::from_percent(30),
Permill::from_percent(40),
],
// percentages below are calulated based on a total issuance at the time when dApp staking v3 was launched (147M)
// percentages below are calculated based on a total issuance at the time when dApp staking v3 was launched (147M)
tier_thresholds: vec![
TierThreshold::DynamicPercentage {
percentage: Perbill::from_parts(20_000), // 0.0020%
Expand Down
2 changes: 1 addition & 1 deletion runtime/shibuya/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ impl_opaque_keys! {
}
}

/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers.
/// We assume that ~10% of the block weight is consumed by `on_initialize` handlers.
/// This is used to limit the maximal weight of a single extrinsic.
const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);
/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used
Expand Down
2 changes: 1 addition & 1 deletion runtime/shiden/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl_opaque_keys! {
}
}

/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers.
/// We assume that ~10% of the block weight is consumed by `on_initialize` handlers.
/// This is used to limit the maximal weight of a single extrinsic.
const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);
/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used
Expand Down
4 changes: 2 additions & 2 deletions tests/xcm-simulator/src/mocks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ pub fn advance_parachain_block_to(block_number: u64) {
/// Register and configure the asset for use in XCM
/// It first create the asset in `pallet_assets` and then register the asset multilocation
/// mapping in `pallet_xc_asset_config`, and lastly set the asset per second for calculating
/// XCM execution cost (only applicable if `is_sufficent` is true)
/// XCM execution cost (only applicable if `is_sufficient` is true)
pub fn register_and_setup_xcm_asset<Runtime, AssetId>(
origin: Runtime::RuntimeOrigin,
// AssetId for the new asset
Expand All @@ -205,7 +205,7 @@ pub fn register_and_setup_xcm_asset<Runtime, AssetId>(
// Asset controller
asset_controller: <Runtime::Lookup as StaticLookup>::Source,
// make asset payable, default true
is_sufficent: Option<bool>,
is_sufficient: Option<bool>,
// minimum balance for account to exist (ED), default, 0
min_balance: Option<Runtime::Balance>,
// Asset unit per second for calculating execution cost for XCM, default 1_000_000_000_000
Expand Down
6 changes: 3 additions & 3 deletions tests/xcm-simulator/src/tests/experimental.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn basic_xcmp_transact_outcome_query_response() {
},
);

// priveleged root call
// privileged root call
let root_call =
parachain::RuntimeCall::System(frame_system::Call::<parachain::Runtime>::set_storage {
items: vec![(vec![0], vec![1])],
Expand Down Expand Up @@ -99,7 +99,7 @@ fn basic_xcmp_transact_outcome_query_response() {
System::reset_events();
});

// check the outcome we recieved from ParaB
// check the outcome we received from ParaB
ParaA::execute_with(move || {
let xcms = parachain::MsgQueue::received_xcmp();
// sanity check
Expand Down Expand Up @@ -146,7 +146,7 @@ fn basic_xcmp_transact_outcome_query_response() {
)));
});

// check the outcome we recieved from ParaB
// check the outcome we received from ParaB
ParaA::execute_with(|| {
let xcms = parachain::MsgQueue::received_xcmp();
// sanity check
Expand Down
Loading