mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 17:01:02 +00:00
Fix spelling mistakes across the whole repository (#3808)
**Update:** Pushed additional changes based on the review comments. **This pull request fixes various spelling mistakes in this repository.** Most of the changes are contained in the first **3** commits: - `Fix spelling mistakes in comments and docs` - `Fix spelling mistakes in test names` - `Fix spelling mistakes in error messages, panic messages, logs and tracing` Other source code spelling mistakes are separated into individual commits for easier reviewing: - `Fix the spelling of 'authority'` - `Fix the spelling of 'REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY'` - `Fix the spelling of 'prev_enqueud_messages'` - `Fix the spelling of 'endpoint'` - `Fix the spelling of 'children'` - `Fix the spelling of 'PenpalSiblingSovereignAccount'` - `Fix the spelling of 'PenpalSudoAccount'` - `Fix the spelling of 'insufficient'` - `Fix the spelling of 'PalletXcmExtrinsicsBenchmark'` - `Fix the spelling of 'subtracted'` - `Fix the spelling of 'CandidatePendingAvailability'` - `Fix the spelling of 'exclusive'` - `Fix the spelling of 'until'` - `Fix the spelling of 'discriminator'` - `Fix the spelling of 'nonexistent'` - `Fix the spelling of 'subsystem'` - `Fix the spelling of 'indices'` - `Fix the spelling of 'committed'` - `Fix the spelling of 'topology'` - `Fix the spelling of 'response'` - `Fix the spelling of 'beneficiary'` - `Fix the spelling of 'formatted'` - `Fix the spelling of 'UNKNOWN_PROOF_REQUEST'` - `Fix the spelling of 'succeeded'` - `Fix the spelling of 'reopened'` - `Fix the spelling of 'proposer'` - `Fix the spelling of 'InstantiationNonce'` - `Fix the spelling of 'depositor'` - `Fix the spelling of 'expiration'` - `Fix the spelling of 'phantom'` - `Fix the spelling of 'AggregatedKeyValue'` - `Fix the spelling of 'randomness'` - `Fix the spelling of 'defendant'` - `Fix the spelling of 'AquaticMammal'` - `Fix the spelling of 'transactions'` - `Fix the spelling of 'PassingTracingSubscriber'` - `Fix the spelling of 'TxSignaturePayload'` - `Fix the spelling of 'versioning'` - `Fix the spelling of 'descendant'` - `Fix the spelling of 'overridden'` - `Fix the spelling of 'network'` Let me know if this structure is adequate. **Note:** The usage of the words `Merkle`, `Merkelize`, `Merklization`, `Merkelization`, `Merkleization`, is somewhat inconsistent but I left it as it is. ~~**Note:** In some places the term `Receival` is used to refer to message reception, IMO `Reception` is the correct word here, but I left it as it is.~~ ~~**Note:** In some places the term `Overlayed` is used instead of the more acceptable version `Overlaid` but I also left it as it is.~~ ~~**Note:** In some places the term `Applyable` is used instead of the correct version `Applicable` but I also left it as it is.~~ **Note:** Some usage of British vs American english e.g. `judgement` vs `judgment`, `initialise` vs `initialize`, `optimise` vs `optimize` etc. are both present in different places, but I suppose that's understandable given the number of contributors. ~~**Note:** There is a spelling mistake in `.github/CODEOWNERS` but it triggers errors in CI when I make changes to it, so I left it as it is.~~
This commit is contained in:
@@ -158,7 +158,7 @@ where
|
||||
/// the limit passed to the constructor.
|
||||
///
|
||||
/// If the given level is found to have a number of blocks greater than or equal the limit
|
||||
/// then the limit is enforced by chosing one (or more) blocks to remove.
|
||||
/// then the limit is enforced by choosing one (or more) blocks to remove.
|
||||
///
|
||||
/// The removal strategy is driven by the block freshness.
|
||||
///
|
||||
|
||||
@@ -832,7 +832,7 @@ fn restore_limit_monitor() {
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
// Scenario before limit application (with B11 imported as best)
|
||||
// Import order (freshess): B00, B10, B11, B12, B20, B21
|
||||
// Import order (freshness): B00, B10, B11, B12, B20, B21
|
||||
//
|
||||
// B00 --+-- B10 --+-- B20
|
||||
// | +-- B21
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
//!
|
||||
//! A parachain needs to build PoVs that are send to the relay chain to progress. These PoVs are
|
||||
//! erasure encoded and one piece of it is stored by each relay chain validator. As the relay chain
|
||||
//! decides on which PoV per parachain to include and thus, to progess the parachain it can happen
|
||||
//! decides on which PoV per parachain to include and thus, to progress the parachain it can happen
|
||||
//! that the block corresponding to this PoV isn't propagated in the parachain network. This can
|
||||
//! have several reasons, either a malicious collator that managed to include its own PoV and
|
||||
//! doesn't want to share it with the rest of the network or maybe a collator went down before it
|
||||
@@ -338,8 +338,8 @@ where
|
||||
let mut blocks_to_delete = vec![hash];
|
||||
|
||||
while let Some(delete) = blocks_to_delete.pop() {
|
||||
if let Some(childs) = self.waiting_for_parent.remove(&delete) {
|
||||
blocks_to_delete.extend(childs.iter().map(BlockT::hash));
|
||||
if let Some(children) = self.waiting_for_parent.remove(&delete) {
|
||||
blocks_to_delete.extend(children.iter().map(BlockT::hash));
|
||||
}
|
||||
}
|
||||
self.clear_waiting_recovery(&hash);
|
||||
@@ -448,7 +448,7 @@ where
|
||||
|
||||
/// Import the given `block`.
|
||||
///
|
||||
/// This will also recursivley drain `waiting_for_parent` and import them as well.
|
||||
/// This will also recursively drain `waiting_for_parent` and import them as well.
|
||||
fn import_block(&mut self, block: Block) {
|
||||
let mut blocks = VecDeque::new();
|
||||
|
||||
@@ -495,7 +495,7 @@ where
|
||||
tracing::debug!(
|
||||
target: LOG_TARGET,
|
||||
block_hash = ?hash,
|
||||
"Cound not recover. Block was never announced as candidate"
|
||||
"Could not recover. Block was never announced as candidate"
|
||||
);
|
||||
return
|
||||
},
|
||||
|
||||
@@ -293,7 +293,8 @@ impl ReconnectingWebsocketWorker {
|
||||
/// listeners. If an error occurs during sending, the receiver has been closed and we remove
|
||||
/// the sender from the list.
|
||||
/// - Find a new valid RPC server to connect to in case the websocket connection is terminated.
|
||||
/// If the worker is not able to connec to an RPC server from the list, the worker shuts down.
|
||||
/// If the worker is not able to connect to an RPC server from the list, the worker shuts
|
||||
/// down.
|
||||
pub async fn run(mut self) {
|
||||
let mut pending_requests = FuturesUnordered::new();
|
||||
|
||||
|
||||
@@ -464,7 +464,7 @@ pub mod pallet {
|
||||
// One complication here, is that the `host_configuration` is updated by an inherent
|
||||
// and those are processed after the block initialization phase. Therefore, we have to
|
||||
// be content only with the configuration as per the previous block. That means that
|
||||
// the configuration can be either stale (or be abscent altogether in case of the
|
||||
// the configuration can be either stale (or be absent altogether in case of the
|
||||
// beginning of the chain).
|
||||
//
|
||||
// In order to mitigate this, we do the following. At the time, we are only concerned
|
||||
|
||||
@@ -90,7 +90,7 @@ pub enum Error {
|
||||
DmqMqcHead(ReadEntryErr),
|
||||
/// Relay dispatch queue cannot be extracted.
|
||||
RelayDispatchQueueRemainingCapacity(ReadEntryErr),
|
||||
/// The hrmp inress channel index cannot be extracted.
|
||||
/// The hrmp ingress channel index cannot be extracted.
|
||||
HrmpIngressChannelIndex(ReadEntryErr),
|
||||
/// The hrmp egress channel index cannot be extracted.
|
||||
HrmpEgressChannelIndex(ReadEntryErr),
|
||||
|
||||
@@ -462,7 +462,7 @@ impl<T: Config> Pallet<T> {
|
||||
// Max message size refers to aggregates, or pages. Not to individual fragments.
|
||||
let max_message_size = channel_info.max_message_size as usize;
|
||||
let format_size = format.encoded_size();
|
||||
// We check the encoded fragment length plus the format size agains the max message size
|
||||
// We check the encoded fragment length plus the format size against the max message size
|
||||
// because the format is concatenated if a new page is needed.
|
||||
let size_to_check = encoded_fragment
|
||||
.len()
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ use sp_core::{sr25519, storage::Storage};
|
||||
// Cumulus
|
||||
use emulated_integration_tests_common::{
|
||||
accounts, build_genesis_storage, collators, get_account_id_from_seed,
|
||||
PenpalSiblingSovereigAccount, PenpalTeleportableAssetLocation, RESERVABLE_ASSET_ID,
|
||||
PenpalSiblingSovereignAccount, PenpalTeleportableAssetLocation, RESERVABLE_ASSET_ID,
|
||||
SAFE_XCM_VERSION,
|
||||
};
|
||||
use parachains_common::{AccountId, Balance};
|
||||
@@ -76,7 +76,7 @@ pub fn genesis() -> Storage {
|
||||
// Penpal's teleportable asset representation
|
||||
(
|
||||
PenpalTeleportableAssetLocation::get(),
|
||||
PenpalSiblingSovereigAccount::get(),
|
||||
PenpalSiblingSovereignAccount::get(),
|
||||
true,
|
||||
ED,
|
||||
),
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ use sp_core::{sr25519, storage::Storage};
|
||||
// Cumulus
|
||||
use emulated_integration_tests_common::{
|
||||
accounts, build_genesis_storage, collators, get_account_id_from_seed,
|
||||
PenpalSiblingSovereigAccount, PenpalTeleportableAssetLocation, RESERVABLE_ASSET_ID,
|
||||
PenpalSiblingSovereignAccount, PenpalTeleportableAssetLocation, RESERVABLE_ASSET_ID,
|
||||
SAFE_XCM_VERSION,
|
||||
};
|
||||
use parachains_common::{AccountId, Balance};
|
||||
@@ -72,7 +72,7 @@ pub fn genesis() -> Storage {
|
||||
// Penpal's teleportable asset representation
|
||||
(
|
||||
PenpalTeleportableAssetLocation::get(),
|
||||
PenpalSiblingSovereigAccount::get(),
|
||||
PenpalSiblingSovereignAccount::get(),
|
||||
true,
|
||||
ED,
|
||||
),
|
||||
|
||||
+3
-3
@@ -31,8 +31,8 @@ pub const PARA_ID_B: u32 = 2001;
|
||||
pub const ED: Balance = penpal_runtime::EXISTENTIAL_DEPOSIT;
|
||||
|
||||
parameter_types! {
|
||||
pub PenpalSudoAcccount: AccountId = get_account_id_from_seed::<sr25519::Public>("Alice");
|
||||
pub PenpalAssetOwner: AccountId = PenpalSudoAcccount::get();
|
||||
pub PenpalSudoAccount: AccountId = get_account_id_from_seed::<sr25519::Public>("Alice");
|
||||
pub PenpalAssetOwner: AccountId = PenpalSudoAccount::get();
|
||||
}
|
||||
|
||||
pub fn genesis(para_id: u32) -> Storage {
|
||||
@@ -66,7 +66,7 @@ pub fn genesis(para_id: u32) -> Storage {
|
||||
safe_xcm_version: Some(SAFE_XCM_VERSION),
|
||||
..Default::default()
|
||||
},
|
||||
sudo: penpal_runtime::SudoConfig { key: Some(PenpalSudoAcccount::get()) },
|
||||
sudo: penpal_runtime::SudoConfig { key: Some(PenpalSudoAccount::get()) },
|
||||
assets: penpal_runtime::AssetsConfig {
|
||||
assets: vec![(
|
||||
penpal_runtime::xcm_config::TELEPORTABLE_ASSET_ID,
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
mod genesis;
|
||||
pub use genesis::{genesis, PenpalAssetOwner, PenpalSudoAcccount, ED, PARA_ID_A, PARA_ID_B};
|
||||
pub use genesis::{genesis, PenpalAssetOwner, PenpalSudoAccount, ED, PARA_ID_A, PARA_ID_B};
|
||||
pub use penpal_runtime::xcm_config::{
|
||||
CustomizableAssetFromSystemAssetHub, LocalTeleportableToAssetHub, XcmConfig,
|
||||
};
|
||||
|
||||
@@ -114,7 +114,7 @@ where
|
||||
.expect("Bridge message does not exist")
|
||||
.into();
|
||||
let payload = Vec::<u8>::decode(&mut &encoded_payload[..])
|
||||
.expect("Decodign XCM message failed");
|
||||
.expect("Decoding XCM message failed");
|
||||
let id: u32 = LaneIdWrapper(*lane).into();
|
||||
let message = BridgeMessage { id, nonce, payload };
|
||||
|
||||
@@ -265,7 +265,7 @@ macro_rules! impl_assert_events_helpers_for_relay_chain {
|
||||
$crate::impls::assert_expected_events!(
|
||||
Self,
|
||||
vec![
|
||||
// XCM is successfully received and proccessed
|
||||
// XCM is successfully received and processed
|
||||
[<$chain RuntimeEvent>]::<N>::MessageQueue($crate::impls::pallet_message_queue::Event::Processed {
|
||||
origin: $crate::impls::AggregateMessageOrigin::Ump($crate::impls::UmpQueueId::Para(id)),
|
||||
weight_used,
|
||||
@@ -343,7 +343,7 @@ macro_rules! impl_hrmp_channels_helpers_for_relay_chain {
|
||||
<Self as Chain>::Runtime,
|
||||
>::contains_key(&channel_id);
|
||||
|
||||
// Check the HRMP channel has been successfully registrered
|
||||
// Check the HRMP channel has been successfully registered
|
||||
assert!(hrmp_channel_exist)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ parameter_types! {
|
||||
xcm::v3::Junction::GeneralIndex(TELEPORTABLE_ASSET_ID.into()),
|
||||
]
|
||||
);
|
||||
pub PenpalSiblingSovereigAccount: AccountId = Sibling::from(PENPAL_ID).into_account_truncating();
|
||||
pub PenpalSiblingSovereignAccount: AccountId = Sibling::from(PENPAL_ID).into_account_truncating();
|
||||
}
|
||||
|
||||
/// Helper function to generate a crypto pair from seed
|
||||
|
||||
+1
-1
@@ -1052,7 +1052,7 @@ fn reserve_transfer_native_asset_from_para_to_para_trough_relay() {
|
||||
// fund the Parachain Origin's SA on Relay Chain with the native tokens held in reserve
|
||||
Rococo::fund_accounts(vec![(sov_of_sender_on_relay.into(), amount_to_send * 2)]);
|
||||
|
||||
// Init values for Parachain Desitnation
|
||||
// Init values for Parachain Destination
|
||||
let receiver = PenpalBReceiver::get();
|
||||
|
||||
// Init Test
|
||||
|
||||
+3
-3
@@ -215,7 +215,7 @@ fn para_to_system_para_assets_sender_assertions(t: ParaToSystemParaTest) {
|
||||
let system_para_native_asset_location =
|
||||
v3::Location::try_from(RelayLocation::get()).expect("conversion works");
|
||||
let reservable_asset_location =
|
||||
v3::Location::try_from(PenpalLocalReservableFromAssetHub::get()).expect("coversion works");
|
||||
v3::Location::try_from(PenpalLocalReservableFromAssetHub::get()).expect("conversion works");
|
||||
PenpalA::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(864_610_000, 8799)));
|
||||
assert_expected_events!(
|
||||
PenpalA,
|
||||
@@ -246,7 +246,7 @@ fn para_to_system_para_assets_sender_assertions(t: ParaToSystemParaTest) {
|
||||
fn system_para_to_para_assets_receiver_assertions(t: SystemParaToParaTest) {
|
||||
type RuntimeEvent = <PenpalA as Chain>::RuntimeEvent;
|
||||
let system_para_asset_location =
|
||||
v3::Location::try_from(PenpalLocalReservableFromAssetHub::get()).expect("coversion works");
|
||||
v3::Location::try_from(PenpalLocalReservableFromAssetHub::get()).expect("conversion works");
|
||||
PenpalA::assert_xcmp_queue_success(None);
|
||||
assert_expected_events!(
|
||||
PenpalA,
|
||||
@@ -1054,7 +1054,7 @@ fn reserve_transfer_native_asset_from_para_to_para_trough_relay() {
|
||||
// fund the Parachain Origin's SA on Relay Chain with the native tokens held in reserve
|
||||
Westend::fund_accounts(vec![(sov_of_sender_on_relay.into(), amount_to_send * 2)]);
|
||||
|
||||
// Init values for Parachain Desitnation
|
||||
// Init values for Parachain Destination
|
||||
let receiver = PenpalBReceiver::get();
|
||||
|
||||
// Init Test
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@ use rococo_westend_system_emulated_network::BridgeHubRococoParaSender as BridgeH
|
||||
use snowbridge_core::outbound::OperatingMode;
|
||||
use snowbridge_pallet_inbound_queue_fixtures::{
|
||||
register_token::make_register_token_message,
|
||||
register_token_with_insufficient_fee::make_register_token_with_infufficient_fee_message,
|
||||
register_token_with_insufficient_fee::make_register_token_with_insufficient_fee_message,
|
||||
send_token::make_send_token_message, send_token_to_penpal::make_send_token_to_penpal_message,
|
||||
InboundQueueFixture,
|
||||
};
|
||||
@@ -514,7 +514,7 @@ fn register_weth_token_in_asset_hub_fail_for_insufficient_fee() {
|
||||
type RuntimeEvent = <BridgeHubRococo as Chain>::RuntimeEvent;
|
||||
|
||||
// Construct RegisterToken message and sent to inbound queue
|
||||
let message = make_register_token_with_infufficient_fee_message();
|
||||
let message = make_register_token_with_insufficient_fee_message();
|
||||
send_inbound_message(message).unwrap();
|
||||
|
||||
assert_expected_events!(
|
||||
|
||||
@@ -192,7 +192,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter<
|
||||
LocationToAccountId,
|
||||
// Our chain's account ID type (we can't get away without mentioning it explicitly):
|
||||
AccountId,
|
||||
// We dont need to check teleports here.
|
||||
// We don't need to check teleports here.
|
||||
NoChecking,
|
||||
// The account to use for tracking teleports.
|
||||
CheckingAccount,
|
||||
|
||||
@@ -185,7 +185,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter<
|
||||
LocationToAccountId,
|
||||
// Our chain's account ID type (we can't get away without mentioning it explicitly):
|
||||
AccountId,
|
||||
// We dont need to check teleports here.
|
||||
// We don't need to check teleports here.
|
||||
NoChecking,
|
||||
// The account to use for tracking teleports.
|
||||
CheckingAccount,
|
||||
|
||||
@@ -618,7 +618,7 @@ fn test_asset_xcm_take_first_trader_with_refund() {
|
||||
// We actually use half of the weight
|
||||
let weight_used = bought / 2;
|
||||
|
||||
// Make sure refurnd works.
|
||||
// Make sure refund works.
|
||||
let amount_refunded = WeightToFee::weight_to_fee(&(bought - weight_used));
|
||||
|
||||
assert_eq!(
|
||||
@@ -745,7 +745,7 @@ fn test_that_buying_ed_refund_does_not_refund_for_take_first_trader() {
|
||||
// Buy weight should work
|
||||
assert_ok!(trader.buy_weight(bought, asset.into(), &ctx));
|
||||
|
||||
// Should return None. We have a specific check making sure we dont go below ED for
|
||||
// Should return None. We have a specific check making sure we don't go below ED for
|
||||
// drop payment
|
||||
assert_eq!(trader.refund_weight(bought, &ctx), None);
|
||||
|
||||
|
||||
@@ -1120,7 +1120,7 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_parachain_assets_wor
|
||||
AssetId: Clone,
|
||||
AssetIdConverter: MaybeEquivalence<Location, AssetId>,
|
||||
{
|
||||
// foreign parachain with the same consenus currency as asset
|
||||
// foreign parachain with the same consensus currency as asset
|
||||
let foreign_asset_id_location = Location::new(1, [Parachain(2222), GeneralIndex(1234567)]);
|
||||
let asset_id = AssetIdConverter::convert(&foreign_asset_id_location).unwrap();
|
||||
|
||||
|
||||
@@ -386,7 +386,7 @@ pub fn receive_reserve_asset_deposited_from_different_consensus_works<
|
||||
existential_deposit,
|
||||
);
|
||||
|
||||
// create foreign asset for wrapped/derivated representation
|
||||
// create foreign asset for wrapped/derived representation
|
||||
assert_ok!(
|
||||
<pallet_assets::Pallet<Runtime, ForeignAssetsPalletInstance>>::force_create(
|
||||
RuntimeHelper::<Runtime, AllPalletsWithoutSystem>::root_origin(),
|
||||
|
||||
@@ -456,7 +456,7 @@ mod benches {
|
||||
[cumulus_pallet_xcmp_queue, XcmpQueue]
|
||||
[pallet_collator_selection, CollatorSelection]
|
||||
// XCM
|
||||
[pallet_xcm, PalletXcmExtrinsiscsBenchmark::<Runtime>]
|
||||
[pallet_xcm, PalletXcmExtrinsicsBenchmark::<Runtime>]
|
||||
[pallet_xcm_benchmarks::fungible, XcmBalances]
|
||||
[pallet_xcm_benchmarks::generic, XcmGeneric]
|
||||
);
|
||||
@@ -644,7 +644,7 @@ impl_runtime_apis! {
|
||||
use frame_support::traits::StorageInfoTrait;
|
||||
use frame_system_benchmarking::Pallet as SystemBench;
|
||||
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
|
||||
use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsiscsBenchmark;
|
||||
use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
|
||||
|
||||
// This is defined once again in dispatch_benchmark, because list_benchmarks!
|
||||
// and add_benchmarks! are macros exported by define_benchmarks! macros and those types
|
||||
@@ -680,7 +680,7 @@ impl_runtime_apis! {
|
||||
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
|
||||
impl cumulus_pallet_session_benchmarking::Config for Runtime {}
|
||||
|
||||
use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsiscsBenchmark;
|
||||
use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
|
||||
impl pallet_xcm::benchmarking::Config for Runtime {
|
||||
type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper<
|
||||
xcm_config::XcmConfig,
|
||||
|
||||
@@ -344,7 +344,7 @@ parameter_types! {
|
||||
pub const StakingAdminBodyId: BodyId = BodyId::Defense;
|
||||
}
|
||||
|
||||
/// We allow Root and the `StakingAdmi` to execute privileged collator selection operations.
|
||||
/// We allow Root and the `StakingAdmin` to execute privileged collator selection operations.
|
||||
pub type CollatorSelectionUpdateOrigin = EitherOfDiverse<
|
||||
EnsureRoot<AccountId>,
|
||||
EnsureXcm<IsVoiceOfBody<GovernanceLocation, StakingAdminBodyId>>,
|
||||
@@ -456,7 +456,7 @@ mod benches {
|
||||
[cumulus_pallet_xcmp_queue, XcmpQueue]
|
||||
[pallet_collator_selection, CollatorSelection]
|
||||
// XCM
|
||||
[pallet_xcm, PalletXcmExtrinsiscsBenchmark::<Runtime>]
|
||||
[pallet_xcm, PalletXcmExtrinsicsBenchmark::<Runtime>]
|
||||
[pallet_xcm_benchmarks::fungible, XcmBalances]
|
||||
[pallet_xcm_benchmarks::generic, XcmGeneric]
|
||||
);
|
||||
@@ -644,7 +644,7 @@ impl_runtime_apis! {
|
||||
use frame_support::traits::StorageInfoTrait;
|
||||
use frame_system_benchmarking::Pallet as SystemBench;
|
||||
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
|
||||
use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsiscsBenchmark;
|
||||
use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
|
||||
|
||||
// This is defined once again in dispatch_benchmark, because list_benchmarks!
|
||||
// and add_benchmarks! are macros exported by define_benchmarks! macros and those types
|
||||
@@ -680,7 +680,7 @@ impl_runtime_apis! {
|
||||
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
|
||||
impl cumulus_pallet_session_benchmarking::Config for Runtime {}
|
||||
|
||||
use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsiscsBenchmark;
|
||||
use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
|
||||
impl pallet_xcm::benchmarking::Config for Runtime {
|
||||
type DeliveryHelper = cumulus_primitives_utility::ToParentDeliveryHelper<
|
||||
xcm_config::XcmConfig,
|
||||
|
||||
@@ -145,7 +145,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter<
|
||||
LocationToAccountId,
|
||||
// Our chain's account ID type (we can't get away without mentioning it explicitly):
|
||||
AccountId,
|
||||
// We dont need to check teleports here.
|
||||
// We don't need to check teleports here.
|
||||
NoChecking,
|
||||
// The account to use for tracking teleports.
|
||||
CheckingAccount,
|
||||
|
||||
@@ -135,7 +135,7 @@ fn runtime(id: &str) -> Runtime {
|
||||
fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
|
||||
let (id, _, para_id) = extract_parachain_id(id);
|
||||
Ok(match id {
|
||||
// - Defaul-like
|
||||
// - Default-like
|
||||
"staging" =>
|
||||
Box::new(chain_spec::rococo_parachain::staging_rococo_parachain_local_config()),
|
||||
"tick" => Box::new(GenericChainSpec::from_json_bytes(
|
||||
|
||||
@@ -421,7 +421,7 @@ mod tests {
|
||||
.unwrap();
|
||||
assert_eq!(pre, Some(100));
|
||||
|
||||
// The `CheckWeight` extension will refunt `actual_weight` from `PostDispatchInfo`
|
||||
// The `CheckWeight` extension will refund `actual_weight` from `PostDispatchInfo`
|
||||
// we always need to call `post_dispatch` to verify that they interoperate correctly.
|
||||
assert_ok!(CheckWeight::<Test>::post_dispatch(None, &info, &post_info, 0, &Ok(())));
|
||||
assert_ok!(StorageWeightReclaim::<Test>::post_dispatch(
|
||||
@@ -456,7 +456,7 @@ mod tests {
|
||||
.unwrap();
|
||||
assert_eq!(pre, Some(100));
|
||||
|
||||
// The `CheckWeight` extension will refunt `actual_weight` from `PostDispatchInfo`
|
||||
// The `CheckWeight` extension will refund `actual_weight` from `PostDispatchInfo`
|
||||
// we always need to call `post_dispatch` to verify that they interoperate correctly.
|
||||
assert_ok!(CheckWeight::<Test>::post_dispatch(None, &info, &post_info, 0, &Ok(())));
|
||||
assert_ok!(StorageWeightReclaim::<Test>::post_dispatch(
|
||||
@@ -500,7 +500,7 @@ mod tests {
|
||||
&Ok(())
|
||||
));
|
||||
// `CheckWeight` gets called after `StorageWeightReclaim` this time.
|
||||
// The `CheckWeight` extension will refunt `actual_weight` from `PostDispatchInfo`
|
||||
// The `CheckWeight` extension will refund `actual_weight` from `PostDispatchInfo`
|
||||
// we always need to call `post_dispatch` to verify that they interoperate correctly.
|
||||
assert_ok!(CheckWeight::<Test>::post_dispatch(None, &info, &post_info, 0, &Ok(())));
|
||||
|
||||
@@ -536,7 +536,7 @@ mod tests {
|
||||
&Ok(())
|
||||
));
|
||||
// `CheckWeight` gets called after `StorageWeightReclaim` this time.
|
||||
// The `CheckWeight` extension will refunt `actual_weight` from `PostDispatchInfo`
|
||||
// The `CheckWeight` extension will refund `actual_weight` from `PostDispatchInfo`
|
||||
// we always need to call `post_dispatch` to verify that they interoperate correctly.
|
||||
assert_ok!(CheckWeight::<Test>::post_dispatch(None, &info, &post_info, 0, &Ok(())));
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//! access to any clock from the runtime the timestamp is always passed as an inherent into the
|
||||
//! runtime. To check this inherent when validating the block, we will use the relay chain slot. As
|
||||
//! the relay chain slot is derived from a timestamp, we can easily convert it back to a timestamp
|
||||
//! by muliplying it with the slot duration. By comparing the relay chain slot derived timestamp
|
||||
//! by multiplying it with the slot duration. By comparing the relay chain slot derived timestamp
|
||||
//! with the timestamp we can ensure that the parachain timestamp is reasonable.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
@@ -141,7 +141,7 @@ impl<
|
||||
) -> Result<xcm_executor::AssetsInHolding, XcmError> {
|
||||
log::trace!(target: "xcm::weight", "TakeFirstAssetTrader::buy_weight weight: {:?}, payment: {:?}, context: {:?}", weight, payment, context);
|
||||
|
||||
// Make sure we dont enter twice
|
||||
// Make sure we don't enter twice
|
||||
if self.0.is_some() {
|
||||
return Err(XcmError::NotWithdrawable)
|
||||
}
|
||||
@@ -176,7 +176,7 @@ impl<
|
||||
// Convert to the same kind of asset, with the required fungible balance
|
||||
let required = first.id.clone().into_asset(asset_balance.into());
|
||||
|
||||
// Substract payment
|
||||
// Subtract payment
|
||||
let unused = payment.checked_sub(required.clone()).map_err(|_| XcmError::TooExpensive)?;
|
||||
|
||||
// record weight and asset
|
||||
@@ -203,7 +203,7 @@ impl<
|
||||
|
||||
// Calculate asset_balance
|
||||
// This read should have already be cached in buy_weight
|
||||
let (asset_balance, outstanding_minus_substracted) =
|
||||
let (asset_balance, outstanding_minus_subtracted) =
|
||||
FeeCharger::charge_weight_in_fungibles(local_asset_id, weight).ok().map(
|
||||
|asset_balance| {
|
||||
// Require at least a drop of minimum_balance
|
||||
@@ -221,16 +221,15 @@ impl<
|
||||
)?;
|
||||
|
||||
// Convert balances into u128
|
||||
let outstanding_minus_substracted: u128 =
|
||||
outstanding_minus_substracted.saturated_into();
|
||||
let outstanding_minus_subtracted: u128 = outstanding_minus_subtracted.saturated_into();
|
||||
let asset_balance: u128 = asset_balance.saturated_into();
|
||||
|
||||
// Construct outstanding_concrete_asset with the same location id and substracted
|
||||
// Construct outstanding_concrete_asset with the same location id and subtracted
|
||||
// balance
|
||||
let outstanding_concrete_asset: Asset =
|
||||
(id.clone(), outstanding_minus_substracted).into();
|
||||
(id.clone(), outstanding_minus_subtracted).into();
|
||||
|
||||
// Substract from existing weight and balance
|
||||
// Subtract from existing weight and balance
|
||||
weight_outstanding = weight_outstanding.saturating_sub(weight);
|
||||
|
||||
// Override AssetTraderRefunder
|
||||
@@ -263,9 +262,10 @@ impl<
|
||||
}
|
||||
}
|
||||
|
||||
/// XCM fee depositor to which we implement the TakeRevenue trait
|
||||
/// It receives a Transact implemented argument, a 32 byte convertible acocuntId, and the fee
|
||||
/// receiver account FungiblesMutateAdapter should be identical to that implemented by WithdrawAsset
|
||||
/// XCM fee depositor to which we implement the `TakeRevenue` trait.
|
||||
/// It receives a `Transact` implemented argument and a 32 byte convertible `AccountId`, and the fee
|
||||
/// receiver account's `FungiblesMutateAdapter` should be identical to that implemented by
|
||||
/// `WithdrawAsset`.
|
||||
pub struct XcmFeesTo32ByteAccount<FungiblesMutateAdapter, AccountId, ReceiverAccount>(
|
||||
PhantomData<(FungiblesMutateAdapter, AccountId, ReceiverAccount)>,
|
||||
);
|
||||
@@ -763,7 +763,8 @@ mod test_trader {
|
||||
/// Implementation of `xcm_builder::EnsureDelivery` which helps to ensure delivery to the
|
||||
/// parent relay chain. Deposits existential deposit for origin (if needed).
|
||||
/// Deposits estimated fee to the origin account (if needed).
|
||||
/// Allows to trigger additional logic for specific `ParaId` (e.g. open HRMP channel) (if neeeded).
|
||||
/// Allows triggering of additional logic for a specific `ParaId` (e.g. to open an HRMP channel) if
|
||||
/// needed.
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
pub struct ToParentDeliveryHelper<XcmConfig, ExistentialDeposit, PriceForDelivery>(
|
||||
sp_std::marker::PhantomData<(XcmConfig, ExistentialDeposit, PriceForDelivery)>,
|
||||
|
||||
@@ -19,14 +19,14 @@ async function connect(endpoint, types = {}) {
|
||||
}
|
||||
|
||||
if (!process.argv[2] || !process.argv[3]) {
|
||||
console.log("usage: node generate_keys <input json> <scale output file> [rpc enpoint]");
|
||||
console.log("usage: node generate_keys <input json> <scale output file> [rpc endpoint]");
|
||||
exit();
|
||||
}
|
||||
|
||||
const input = process.argv[2];
|
||||
const output = process.argv[3];
|
||||
// default to localhost and the default Substrate port
|
||||
const rpcEnpoint = process.argv[4] || "ws://localhost:9944";
|
||||
const rpcEndpoint = process.argv[4] || "ws://localhost:9944";
|
||||
|
||||
console.log("Processing", input, output);
|
||||
fs.readFile(input, "utf8", (err, data) => {
|
||||
@@ -38,8 +38,8 @@ fs.readFile(input, "utf8", (err, data) => {
|
||||
const genesis = JSON.parse(data);
|
||||
|
||||
console.log("loaded genesis, length = ", genesis.length);
|
||||
console.log(`Connecting to RPC endpoint: ${rpcEnpoint}`);
|
||||
connect(rpcEnpoint)
|
||||
console.log(`Connecting to RPC endpoint: ${rpcEndpoint}`);
|
||||
connect(rpcEndpoint)
|
||||
.then((api) => {
|
||||
console.log('Connected');
|
||||
const setStorage = api.tx.system.setStorage(genesis);
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
"validity_votes": "Vec<ValidityAttestation>",
|
||||
"validator_indices": "BitVec"
|
||||
},
|
||||
"CandidatePendingAvailablility": {
|
||||
"CandidatePendingAvailability": {
|
||||
"core": "u32",
|
||||
"descriptor": "CandidateDescriptor",
|
||||
"availability_votes": "BitVec",
|
||||
|
||||
@@ -139,7 +139,7 @@ pub fn native_version() -> NativeVersion {
|
||||
NativeVersion { runtime_version: VERSION, can_author_with: Default::default() }
|
||||
}
|
||||
|
||||
/// 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
|
||||
|
||||
@@ -47,7 +47,7 @@ fn create_extrinsics(
|
||||
src_accounts: &[sr25519::Pair],
|
||||
dst_accounts: &[sr25519::Pair],
|
||||
) -> (usize, Vec<UncheckedExtrinsic>) {
|
||||
// Add as many tranfer extrinsics as possible into a single block.
|
||||
// Add as many transfer extrinsics as possible into a single block.
|
||||
let mut block_builder = BlockBuilderBuilder::new(client)
|
||||
.on_parent_block(client.chain_info().best_hash)
|
||||
.with_parent_block_number(client.chain_info().best_number)
|
||||
|
||||
@@ -735,7 +735,7 @@ pub fn node_config(
|
||||
tokio_handle: tokio::runtime::Handle,
|
||||
key: Sr25519Keyring,
|
||||
nodes: Vec<MultiaddrWithPeerId>,
|
||||
nodes_exlusive: bool,
|
||||
nodes_exclusive: bool,
|
||||
para_id: ParaId,
|
||||
is_collator: bool,
|
||||
endowed_accounts: Vec<AccountId>,
|
||||
@@ -759,7 +759,7 @@ pub fn node_config(
|
||||
None,
|
||||
);
|
||||
|
||||
if nodes_exlusive {
|
||||
if nodes_exclusive {
|
||||
network_config.default_peers_set.reserved_nodes = nodes;
|
||||
network_config.default_peers_set.non_reserved_mode =
|
||||
sc_network::config::NonReservedPeerMode::Deny;
|
||||
|
||||
Reference in New Issue
Block a user