mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 08:11:03 +00:00
Fix Clippy (#2522)
* Import Clippy config from Polkadot Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Auto clippy fix Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * No tabs in comments Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Prefer matches Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Dont drop references Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Trivial Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Refactor Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fmt Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * add clippy to ci * Clippy reborrow Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update client/pov-recovery/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update client/pov-recovery/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Partially revert 'Prefer matches' Using matches! instead of match does give less compiler checks as per review from @chevdor. Partially reverts 8c0609677f3ea040f77fffd5be6facf7c3fec95c Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update .cargo/config.toml Co-authored-by: Chevdor <chevdor@users.noreply.github.com> * Revert revert 💩 Should be fine to use matches! macro since it is an explicit whitelist, not wildcard matching. --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: alvicsam <alvicsam@gmail.com> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: Chevdor <chevdor@users.noreply.github.com> Co-authored-by: parity-processbot <>
This commit is contained in:
committed by
GitHub
parent
b72ae577a0
commit
299d25ba4b
@@ -278,7 +278,6 @@ mod tests {
|
||||
}
|
||||
|
||||
let asset_location = SomeSiblingParachain::get()
|
||||
.clone()
|
||||
.pushed_with_interior(GeneralIndex(42))
|
||||
.expect("multilocation will only have 2 junctions; qed");
|
||||
let asset = MultiAsset { id: Concrete(asset_location), fun: 1_000_000u128.into() };
|
||||
|
||||
@@ -53,7 +53,7 @@ pub mod pallet {
|
||||
#[pallet::genesis_build]
|
||||
impl<T: Config> GenesisBuild<T> for GenesisConfig {
|
||||
fn build(&self) {
|
||||
<ParachainId<T>>::put(&self.parachain_id);
|
||||
<ParachainId<T>>::put(self.parachain_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ where
|
||||
asset_location: &MultiLocation,
|
||||
) -> sp_std::result::Result<Self::Success, RuntimeOrigin> {
|
||||
let origin_location = EnsureXcm::<Everything>::try_origin(origin.clone())?;
|
||||
if !IsForeign::contains(&asset_location, &origin_location) {
|
||||
if !IsForeign::contains(asset_location, &origin_location) {
|
||||
return Err(origin)
|
||||
}
|
||||
AccountOf::convert(origin_location).map_err(|_| origin)
|
||||
@@ -51,6 +51,6 @@ where
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
fn try_successful_origin(a: &MultiLocation) -> Result<RuntimeOrigin, ()> {
|
||||
Ok(pallet_xcm::Origin::Xcm(a.clone()).into())
|
||||
Ok(pallet_xcm::Origin::Xcm(*a).into())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,10 +42,7 @@ impl<Network: Get<NetworkId>> Contains<MultiLocation>
|
||||
for StartsWithExplicitGlobalConsensus<Network>
|
||||
{
|
||||
fn contains(t: &MultiLocation) -> bool {
|
||||
match t.interior.global_consensus() {
|
||||
Ok(requested_network) if requested_network.eq(&Network::get()) => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(t.interior.global_consensus(), Ok(requested_network) if requested_network.eq(&Network::get()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +58,7 @@ impl<IsForeign: ContainsPair<MultiLocation, MultiLocation>> ContainsPair<MultiAs
|
||||
{
|
||||
fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool {
|
||||
log::trace!(target: "xcm::contains", "IsForeignConcreteAsset asset: {:?}, origin: {:?}", asset, origin);
|
||||
matches!(asset.id, Concrete(ref id) if IsForeign::contains(id, &origin))
|
||||
matches!(asset.id, Concrete(ref id) if IsForeign::contains(id, origin))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,18 +70,14 @@ impl<SelfParaId: Get<ParaId>> ContainsPair<MultiLocation, MultiLocation>
|
||||
{
|
||||
fn contains(&a: &MultiLocation, b: &MultiLocation) -> bool {
|
||||
// `a` needs to be from `b` at least
|
||||
if !a.starts_with(&b) {
|
||||
if !a.starts_with(b) {
|
||||
return false
|
||||
}
|
||||
|
||||
// here we check if sibling
|
||||
match a {
|
||||
MultiLocation { parents: 1, interior } => match interior.first() {
|
||||
Some(Parachain(sibling_para_id))
|
||||
if sibling_para_id.ne(&u32::from(SelfParaId::get())) =>
|
||||
true,
|
||||
_ => false,
|
||||
},
|
||||
MultiLocation { parents: 1, interior } =>
|
||||
matches!(interior.first(), Some(Parachain(sibling_para_id)) if sibling_para_id.ne(&u32::from(SelfParaId::get()))),
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ impl pallet_balances::Config for Runtime {
|
||||
|
||||
parameter_types! {
|
||||
/// Relay Chain `TransactionByteFee` / 10
|
||||
pub const TransactionByteFee: Balance = 1 * MILLICENTS;
|
||||
pub const TransactionByteFee: Balance = MILLICENTS;
|
||||
}
|
||||
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
@@ -1026,7 +1026,7 @@ impl_runtime_apis! {
|
||||
list_benchmarks!(list, extra);
|
||||
|
||||
let storage_info = AllPalletsWithSystem::storage_info();
|
||||
return (list, storage_info)
|
||||
(list, storage_info)
|
||||
}
|
||||
|
||||
fn dispatch_benchmark(
|
||||
@@ -1062,7 +1062,6 @@ impl_runtime_apis! {
|
||||
id: Concrete(GeneralIndex(i as u128).into()),
|
||||
fun: Fungible(fungibles_amount * i as u128),
|
||||
}
|
||||
.into()
|
||||
})
|
||||
.chain(core::iter::once(MultiAsset { id: Concrete(Here.into()), fun: Fungible(u128::MAX) }))
|
||||
.chain((0..holding_non_fungibles).map(|i| MultiAsset {
|
||||
@@ -1082,7 +1081,7 @@ impl_runtime_apis! {
|
||||
parameter_types! {
|
||||
pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some((
|
||||
KsmLocation::get(),
|
||||
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(KsmLocation::get()) },
|
||||
MultiAsset { fun: Fungible(UNITS), id: Concrete(KsmLocation::get()) },
|
||||
));
|
||||
pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None;
|
||||
|
||||
@@ -1097,7 +1096,7 @@ impl_runtime_apis! {
|
||||
fn get_multi_asset() -> MultiAsset {
|
||||
MultiAsset {
|
||||
id: Concrete(KsmLocation::get()),
|
||||
fun: Fungible(1 * UNITS),
|
||||
fun: Fungible(UNITS),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1201,7 +1200,7 @@ cumulus_pallet_parachain_system::register_validate_block! {
|
||||
#[cfg(feature = "state-trie-version-1")]
|
||||
parameter_types! {
|
||||
// The deposit configuration for the singed migration. Specially if you want to allow any signed account to do the migration (see `SignedFilter`, these deposits should be high)
|
||||
pub const MigrationSignedDepositPerItem: Balance = 1 * CENTS;
|
||||
pub const MigrationSignedDepositPerItem: Balance = CENTS;
|
||||
pub const MigrationSignedDepositBase: Balance = 2_000 * CENTS;
|
||||
pub const MigrationMaxKeyLen: u32 = 512;
|
||||
}
|
||||
|
||||
@@ -33,8 +33,7 @@ const MAX_ASSETS: u64 = 100;
|
||||
impl WeighMultiAssets for MultiAssetFilter {
|
||||
fn weigh_multi_assets(&self, weight: Weight) -> Weight {
|
||||
match self {
|
||||
Self::Definite(assets) =>
|
||||
weight.saturating_mul(assets.inner().into_iter().count() as u64),
|
||||
Self::Definite(assets) => weight.saturating_mul(assets.inner().iter().count() as u64),
|
||||
Self::Wild(asset) => match asset {
|
||||
All => weight.saturating_mul(MAX_ASSETS),
|
||||
AllOf { fun, .. } => match fun {
|
||||
@@ -53,7 +52,7 @@ impl WeighMultiAssets for MultiAssetFilter {
|
||||
|
||||
impl WeighMultiAssets for MultiAssets {
|
||||
fn weigh_multi_assets(&self, weight: Weight) -> Weight {
|
||||
weight.saturating_mul(self.inner().into_iter().count() as u64)
|
||||
weight.saturating_mul(self.inner().iter().count() as u64)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +64,7 @@ impl<Call> XcmWeightInfo<Call> for StatemineXcmWeight<Call> {
|
||||
// Currently there is no trusted reserve
|
||||
fn reserve_asset_deposited(_assets: &MultiAssets) -> Weight {
|
||||
// TODO: hardcoded - fix https://github.com/paritytech/cumulus/issues/1974
|
||||
Weight::from_parts(1_000_000_000 as u64, 0)
|
||||
Weight::from_parts(1_000_000_000_u64, 0)
|
||||
}
|
||||
fn receive_teleported_asset(assets: &MultiAssets) -> Weight {
|
||||
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::receive_teleported_asset())
|
||||
@@ -123,7 +122,7 @@ impl<Call> XcmWeightInfo<Call> for StatemineXcmWeight<Call> {
|
||||
|
||||
fn deposit_asset(assets: &MultiAssetFilter, _dest: &MultiLocation) -> Weight {
|
||||
// Hardcoded till the XCM pallet is fixed
|
||||
let hardcoded_weight = Weight::from_parts(1_000_000_000 as u64, 0);
|
||||
let hardcoded_weight = Weight::from_parts(1_000_000_000_u64, 0);
|
||||
let weight = assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::deposit_asset());
|
||||
hardcoded_weight.min(weight)
|
||||
}
|
||||
|
||||
@@ -197,151 +197,146 @@ impl Contains<RuntimeCall> for SafeCallFilter {
|
||||
}
|
||||
}
|
||||
|
||||
match call {
|
||||
matches!(
|
||||
call,
|
||||
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) |
|
||||
RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) |
|
||||
RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { .. } |
|
||||
pallet_collator_selection::Call::set_candidacy_bond { .. } |
|
||||
pallet_collator_selection::Call::register_as_candidate { .. } |
|
||||
pallet_collator_selection::Call::leave_intent { .. },
|
||||
) |
|
||||
RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::DmpQueue(..) |
|
||||
RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. }) |
|
||||
RuntimeCall::Assets(
|
||||
RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) | RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { .. } |
|
||||
pallet_collator_selection::Call::set_candidacy_bond { .. } |
|
||||
pallet_collator_selection::Call::register_as_candidate { .. } |
|
||||
pallet_collator_selection::Call::leave_intent { .. },
|
||||
) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::DmpQueue(..) |
|
||||
RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. }) |
|
||||
RuntimeCall::Assets(
|
||||
pallet_assets::Call::create { .. } |
|
||||
pallet_assets::Call::force_create { .. } |
|
||||
pallet_assets::Call::start_destroy { .. } |
|
||||
pallet_assets::Call::destroy_accounts { .. } |
|
||||
pallet_assets::Call::destroy_approvals { .. } |
|
||||
pallet_assets::Call::finish_destroy { .. } |
|
||||
pallet_assets::Call::mint { .. } |
|
||||
pallet_assets::Call::burn { .. } |
|
||||
pallet_assets::Call::transfer { .. } |
|
||||
pallet_assets::Call::transfer_keep_alive { .. } |
|
||||
pallet_assets::Call::force_transfer { .. } |
|
||||
pallet_assets::Call::freeze { .. } |
|
||||
pallet_assets::Call::thaw { .. } |
|
||||
pallet_assets::Call::freeze_asset { .. } |
|
||||
pallet_assets::Call::thaw_asset { .. } |
|
||||
pallet_assets::Call::transfer_ownership { .. } |
|
||||
pallet_assets::Call::set_team { .. } |
|
||||
pallet_assets::Call::clear_metadata { .. } |
|
||||
pallet_assets::Call::force_clear_metadata { .. } |
|
||||
pallet_assets::Call::force_asset_status { .. } |
|
||||
pallet_assets::Call::approve_transfer { .. } |
|
||||
pallet_assets::Call::cancel_approval { .. } |
|
||||
pallet_assets::Call::force_cancel_approval { .. } |
|
||||
pallet_assets::Call::transfer_approved { .. } |
|
||||
pallet_assets::Call::touch { .. } |
|
||||
pallet_assets::Call::refund { .. },
|
||||
) | RuntimeCall::ForeignAssets(
|
||||
pallet_assets::Call::create { .. } |
|
||||
pallet_assets::Call::force_create { .. } |
|
||||
pallet_assets::Call::start_destroy { .. } |
|
||||
pallet_assets::Call::destroy_accounts { .. } |
|
||||
pallet_assets::Call::destroy_approvals { .. } |
|
||||
pallet_assets::Call::finish_destroy { .. } |
|
||||
pallet_assets::Call::mint { .. } |
|
||||
pallet_assets::Call::burn { .. } |
|
||||
pallet_assets::Call::transfer { .. } |
|
||||
pallet_assets::Call::transfer_keep_alive { .. } |
|
||||
pallet_assets::Call::force_transfer { .. } |
|
||||
pallet_assets::Call::freeze { .. } |
|
||||
pallet_assets::Call::thaw { .. } |
|
||||
pallet_assets::Call::freeze_asset { .. } |
|
||||
pallet_assets::Call::thaw_asset { .. } |
|
||||
pallet_assets::Call::transfer_ownership { .. } |
|
||||
pallet_assets::Call::set_team { .. } |
|
||||
pallet_assets::Call::clear_metadata { .. } |
|
||||
pallet_assets::Call::force_clear_metadata { .. } |
|
||||
pallet_assets::Call::force_asset_status { .. } |
|
||||
pallet_assets::Call::approve_transfer { .. } |
|
||||
pallet_assets::Call::cancel_approval { .. } |
|
||||
pallet_assets::Call::force_cancel_approval { .. } |
|
||||
pallet_assets::Call::transfer_approved { .. } |
|
||||
pallet_assets::Call::touch { .. } |
|
||||
pallet_assets::Call::refund { .. },
|
||||
) |
|
||||
RuntimeCall::ForeignAssets(
|
||||
pallet_assets::Call::create { .. } |
|
||||
pallet_assets::Call::force_create { .. } |
|
||||
pallet_assets::Call::start_destroy { .. } |
|
||||
pallet_assets::Call::destroy_accounts { .. } |
|
||||
pallet_assets::Call::destroy_approvals { .. } |
|
||||
pallet_assets::Call::finish_destroy { .. } |
|
||||
pallet_assets::Call::mint { .. } |
|
||||
pallet_assets::Call::burn { .. } |
|
||||
pallet_assets::Call::transfer { .. } |
|
||||
pallet_assets::Call::transfer_keep_alive { .. } |
|
||||
pallet_assets::Call::force_transfer { .. } |
|
||||
pallet_assets::Call::freeze { .. } |
|
||||
pallet_assets::Call::thaw { .. } |
|
||||
pallet_assets::Call::freeze_asset { .. } |
|
||||
pallet_assets::Call::thaw_asset { .. } |
|
||||
pallet_assets::Call::transfer_ownership { .. } |
|
||||
pallet_assets::Call::set_team { .. } |
|
||||
pallet_assets::Call::set_metadata { .. } |
|
||||
pallet_assets::Call::clear_metadata { .. } |
|
||||
pallet_assets::Call::force_clear_metadata { .. } |
|
||||
pallet_assets::Call::force_asset_status { .. } |
|
||||
pallet_assets::Call::approve_transfer { .. } |
|
||||
pallet_assets::Call::cancel_approval { .. } |
|
||||
pallet_assets::Call::force_cancel_approval { .. } |
|
||||
pallet_assets::Call::transfer_approved { .. } |
|
||||
pallet_assets::Call::touch { .. } |
|
||||
pallet_assets::Call::refund { .. },
|
||||
) |
|
||||
RuntimeCall::Nfts(
|
||||
pallet_assets::Call::force_create { .. } |
|
||||
pallet_assets::Call::start_destroy { .. } |
|
||||
pallet_assets::Call::destroy_accounts { .. } |
|
||||
pallet_assets::Call::destroy_approvals { .. } |
|
||||
pallet_assets::Call::finish_destroy { .. } |
|
||||
pallet_assets::Call::mint { .. } |
|
||||
pallet_assets::Call::burn { .. } |
|
||||
pallet_assets::Call::transfer { .. } |
|
||||
pallet_assets::Call::transfer_keep_alive { .. } |
|
||||
pallet_assets::Call::force_transfer { .. } |
|
||||
pallet_assets::Call::freeze { .. } |
|
||||
pallet_assets::Call::thaw { .. } |
|
||||
pallet_assets::Call::freeze_asset { .. } |
|
||||
pallet_assets::Call::thaw_asset { .. } |
|
||||
pallet_assets::Call::transfer_ownership { .. } |
|
||||
pallet_assets::Call::set_team { .. } |
|
||||
pallet_assets::Call::set_metadata { .. } |
|
||||
pallet_assets::Call::clear_metadata { .. } |
|
||||
pallet_assets::Call::force_clear_metadata { .. } |
|
||||
pallet_assets::Call::force_asset_status { .. } |
|
||||
pallet_assets::Call::approve_transfer { .. } |
|
||||
pallet_assets::Call::cancel_approval { .. } |
|
||||
pallet_assets::Call::force_cancel_approval { .. } |
|
||||
pallet_assets::Call::transfer_approved { .. } |
|
||||
pallet_assets::Call::touch { .. } |
|
||||
pallet_assets::Call::refund { .. },
|
||||
) | RuntimeCall::Nfts(
|
||||
pallet_nfts::Call::create { .. } |
|
||||
pallet_nfts::Call::force_create { .. } |
|
||||
pallet_nfts::Call::destroy { .. } |
|
||||
pallet_nfts::Call::mint { .. } |
|
||||
pallet_nfts::Call::force_mint { .. } |
|
||||
pallet_nfts::Call::burn { .. } |
|
||||
pallet_nfts::Call::transfer { .. } |
|
||||
pallet_nfts::Call::lock_item_transfer { .. } |
|
||||
pallet_nfts::Call::unlock_item_transfer { .. } |
|
||||
pallet_nfts::Call::lock_collection { .. } |
|
||||
pallet_nfts::Call::transfer_ownership { .. } |
|
||||
pallet_nfts::Call::set_team { .. } |
|
||||
pallet_nfts::Call::force_collection_owner { .. } |
|
||||
pallet_nfts::Call::force_collection_config { .. } |
|
||||
pallet_nfts::Call::approve_transfer { .. } |
|
||||
pallet_nfts::Call::cancel_approval { .. } |
|
||||
pallet_nfts::Call::clear_all_transfer_approvals { .. } |
|
||||
pallet_nfts::Call::lock_item_properties { .. } |
|
||||
pallet_nfts::Call::set_attribute { .. } |
|
||||
pallet_nfts::Call::force_set_attribute { .. } |
|
||||
pallet_nfts::Call::clear_attribute { .. } |
|
||||
pallet_nfts::Call::approve_item_attributes { .. } |
|
||||
pallet_nfts::Call::cancel_item_attributes_approval { .. } |
|
||||
pallet_nfts::Call::set_metadata { .. } |
|
||||
pallet_nfts::Call::clear_metadata { .. } |
|
||||
pallet_nfts::Call::set_collection_metadata { .. } |
|
||||
pallet_nfts::Call::clear_collection_metadata { .. } |
|
||||
pallet_nfts::Call::set_accept_ownership { .. } |
|
||||
pallet_nfts::Call::set_collection_max_supply { .. } |
|
||||
pallet_nfts::Call::update_mint_settings { .. } |
|
||||
pallet_nfts::Call::set_price { .. } |
|
||||
pallet_nfts::Call::buy_item { .. } |
|
||||
pallet_nfts::Call::pay_tips { .. } |
|
||||
pallet_nfts::Call::create_swap { .. } |
|
||||
pallet_nfts::Call::cancel_swap { .. } |
|
||||
pallet_nfts::Call::claim_swap { .. },
|
||||
) |
|
||||
RuntimeCall::Uniques(
|
||||
pallet_nfts::Call::force_create { .. } |
|
||||
pallet_nfts::Call::destroy { .. } |
|
||||
pallet_nfts::Call::mint { .. } |
|
||||
pallet_nfts::Call::force_mint { .. } |
|
||||
pallet_nfts::Call::burn { .. } |
|
||||
pallet_nfts::Call::transfer { .. } |
|
||||
pallet_nfts::Call::lock_item_transfer { .. } |
|
||||
pallet_nfts::Call::unlock_item_transfer { .. } |
|
||||
pallet_nfts::Call::lock_collection { .. } |
|
||||
pallet_nfts::Call::transfer_ownership { .. } |
|
||||
pallet_nfts::Call::set_team { .. } |
|
||||
pallet_nfts::Call::force_collection_owner { .. } |
|
||||
pallet_nfts::Call::force_collection_config { .. } |
|
||||
pallet_nfts::Call::approve_transfer { .. } |
|
||||
pallet_nfts::Call::cancel_approval { .. } |
|
||||
pallet_nfts::Call::clear_all_transfer_approvals { .. } |
|
||||
pallet_nfts::Call::lock_item_properties { .. } |
|
||||
pallet_nfts::Call::set_attribute { .. } |
|
||||
pallet_nfts::Call::force_set_attribute { .. } |
|
||||
pallet_nfts::Call::clear_attribute { .. } |
|
||||
pallet_nfts::Call::approve_item_attributes { .. } |
|
||||
pallet_nfts::Call::cancel_item_attributes_approval { .. } |
|
||||
pallet_nfts::Call::set_metadata { .. } |
|
||||
pallet_nfts::Call::clear_metadata { .. } |
|
||||
pallet_nfts::Call::set_collection_metadata { .. } |
|
||||
pallet_nfts::Call::clear_collection_metadata { .. } |
|
||||
pallet_nfts::Call::set_accept_ownership { .. } |
|
||||
pallet_nfts::Call::set_collection_max_supply { .. } |
|
||||
pallet_nfts::Call::update_mint_settings { .. } |
|
||||
pallet_nfts::Call::set_price { .. } |
|
||||
pallet_nfts::Call::buy_item { .. } |
|
||||
pallet_nfts::Call::pay_tips { .. } |
|
||||
pallet_nfts::Call::create_swap { .. } |
|
||||
pallet_nfts::Call::cancel_swap { .. } |
|
||||
pallet_nfts::Call::claim_swap { .. },
|
||||
) | RuntimeCall::Uniques(
|
||||
pallet_uniques::Call::create { .. } |
|
||||
pallet_uniques::Call::force_create { .. } |
|
||||
pallet_uniques::Call::destroy { .. } |
|
||||
pallet_uniques::Call::mint { .. } |
|
||||
pallet_uniques::Call::burn { .. } |
|
||||
pallet_uniques::Call::transfer { .. } |
|
||||
pallet_uniques::Call::freeze { .. } |
|
||||
pallet_uniques::Call::thaw { .. } |
|
||||
pallet_uniques::Call::freeze_collection { .. } |
|
||||
pallet_uniques::Call::thaw_collection { .. } |
|
||||
pallet_uniques::Call::transfer_ownership { .. } |
|
||||
pallet_uniques::Call::set_team { .. } |
|
||||
pallet_uniques::Call::approve_transfer { .. } |
|
||||
pallet_uniques::Call::cancel_approval { .. } |
|
||||
pallet_uniques::Call::force_item_status { .. } |
|
||||
pallet_uniques::Call::set_attribute { .. } |
|
||||
pallet_uniques::Call::clear_attribute { .. } |
|
||||
pallet_uniques::Call::set_metadata { .. } |
|
||||
pallet_uniques::Call::clear_metadata { .. } |
|
||||
pallet_uniques::Call::set_collection_metadata { .. } |
|
||||
pallet_uniques::Call::clear_collection_metadata { .. } |
|
||||
pallet_uniques::Call::set_accept_ownership { .. } |
|
||||
pallet_uniques::Call::set_collection_max_supply { .. } |
|
||||
pallet_uniques::Call::set_price { .. } |
|
||||
pallet_uniques::Call::buy_item { .. },
|
||||
) => true,
|
||||
_ => false,
|
||||
}
|
||||
pallet_uniques::Call::force_create { .. } |
|
||||
pallet_uniques::Call::destroy { .. } |
|
||||
pallet_uniques::Call::mint { .. } |
|
||||
pallet_uniques::Call::burn { .. } |
|
||||
pallet_uniques::Call::transfer { .. } |
|
||||
pallet_uniques::Call::freeze { .. } |
|
||||
pallet_uniques::Call::thaw { .. } |
|
||||
pallet_uniques::Call::freeze_collection { .. } |
|
||||
pallet_uniques::Call::thaw_collection { .. } |
|
||||
pallet_uniques::Call::transfer_ownership { .. } |
|
||||
pallet_uniques::Call::set_team { .. } |
|
||||
pallet_uniques::Call::approve_transfer { .. } |
|
||||
pallet_uniques::Call::cancel_approval { .. } |
|
||||
pallet_uniques::Call::force_item_status { .. } |
|
||||
pallet_uniques::Call::set_attribute { .. } |
|
||||
pallet_uniques::Call::clear_attribute { .. } |
|
||||
pallet_uniques::Call::set_metadata { .. } |
|
||||
pallet_uniques::Call::clear_metadata { .. } |
|
||||
pallet_uniques::Call::set_collection_metadata { .. } |
|
||||
pallet_uniques::Call::clear_collection_metadata { .. } |
|
||||
pallet_uniques::Call::set_accept_ownership { .. } |
|
||||
pallet_uniques::Call::set_collection_max_supply { .. } |
|
||||
pallet_uniques::Call::set_price { .. } |
|
||||
pallet_uniques::Call::buy_item { .. }
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,19 +77,16 @@ fn test_asset_xcm_trader() {
|
||||
// Lets pay with: asset_amount_needed + asset_amount_extra
|
||||
let asset_amount_extra = 100_u128;
|
||||
let asset: MultiAsset =
|
||||
(asset_multilocation.clone(), asset_amount_needed + asset_amount_extra).into();
|
||||
(asset_multilocation, asset_amount_needed + asset_amount_extra).into();
|
||||
|
||||
let mut trader = <XcmConfig as xcm_executor::Config>::Trader::new();
|
||||
|
||||
// Lets buy_weight and make sure buy_weight does not return an error
|
||||
match trader.buy_weight(bought, asset.into()) {
|
||||
Ok(unused_assets) => {
|
||||
// Check whether a correct amount of unused assets is returned
|
||||
assert_ok!(unused_assets
|
||||
.ensure_contains(&(asset_multilocation, asset_amount_extra).into()));
|
||||
},
|
||||
Err(e) => assert!(false, "Expected Ok(_). Got {:#?}", e),
|
||||
}
|
||||
let unused_assets = trader.buy_weight(bought, asset.into()).expect("Expected Ok");
|
||||
// Check whether a correct amount of unused assets is returned
|
||||
assert_ok!(
|
||||
unused_assets.ensure_contains(&(asset_multilocation, asset_amount_extra).into())
|
||||
);
|
||||
|
||||
// Drop trader
|
||||
drop(trader);
|
||||
@@ -150,7 +147,7 @@ fn test_asset_xcm_trader_with_refund() {
|
||||
// lets calculate amount needed
|
||||
let amount_bought = WeightToFee::weight_to_fee(&bought);
|
||||
|
||||
let asset: MultiAsset = (asset_multilocation.clone(), amount_bought).into();
|
||||
let asset: MultiAsset = (asset_multilocation, amount_bought).into();
|
||||
|
||||
// Make sure buy_weight does not return an error
|
||||
assert_ok!(trader.buy_weight(bought, asset.clone().into()));
|
||||
@@ -224,7 +221,7 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() {
|
||||
"we are testing what happens when the amount does not exceed ED"
|
||||
);
|
||||
|
||||
let asset: MultiAsset = (asset_multilocation.clone(), amount_bought).into();
|
||||
let asset: MultiAsset = (asset_multilocation, amount_bought).into();
|
||||
|
||||
// Buy weight should return an error
|
||||
assert_noop!(trader.buy_weight(bought, asset.into()), XcmError::TooExpensive);
|
||||
@@ -277,11 +274,11 @@ fn test_that_buying_ed_refund_does_not_refund() {
|
||||
|
||||
// We know we will have to buy at least ED, so lets make sure first it will
|
||||
// fail with a payment of less than ED
|
||||
let asset: MultiAsset = (asset_multilocation.clone(), amount_bought).into();
|
||||
let asset: MultiAsset = (asset_multilocation, amount_bought).into();
|
||||
assert_noop!(trader.buy_weight(bought, asset.into()), XcmError::TooExpensive);
|
||||
|
||||
// Now lets buy ED at least
|
||||
let asset: MultiAsset = (asset_multilocation.clone(), ExistentialDeposit::get()).into();
|
||||
let asset: MultiAsset = (asset_multilocation, ExistentialDeposit::get()).into();
|
||||
|
||||
// Buy weight should work
|
||||
assert_ok!(trader.buy_weight(bought, asset.into()));
|
||||
@@ -416,7 +413,7 @@ fn test_assets_balances_api_works() {
|
||||
let foreign_asset_minimum_asset_balance = 3333333_u128;
|
||||
assert_ok!(ForeignAssets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
foreign_asset_id_multilocation.clone().into(),
|
||||
foreign_asset_id_multilocation,
|
||||
AccountId::from(SOME_ASSET_ADMIN).into(),
|
||||
false,
|
||||
foreign_asset_minimum_asset_balance
|
||||
@@ -425,7 +422,7 @@ fn test_assets_balances_api_works() {
|
||||
// We first mint enough asset for the account to exist for assets
|
||||
assert_ok!(ForeignAssets::mint(
|
||||
RuntimeHelper::<Runtime>::origin_of(AccountId::from(SOME_ASSET_ADMIN)),
|
||||
foreign_asset_id_multilocation.clone().into(),
|
||||
foreign_asset_id_multilocation,
|
||||
AccountId::from(ALICE).into(),
|
||||
6 * foreign_asset_minimum_asset_balance
|
||||
));
|
||||
|
||||
@@ -223,7 +223,7 @@ impl pallet_balances::Config for Runtime {
|
||||
|
||||
parameter_types! {
|
||||
/// Relay Chain `TransactionByteFee` / 10
|
||||
pub const TransactionByteFee: Balance = 1 * MILLICENTS;
|
||||
pub const TransactionByteFee: Balance = MILLICENTS;
|
||||
}
|
||||
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
@@ -925,7 +925,7 @@ impl_runtime_apis! {
|
||||
list_benchmarks!(list, extra);
|
||||
|
||||
let storage_info = AllPalletsWithSystem::storage_info();
|
||||
return (list, storage_info)
|
||||
(list, storage_info)
|
||||
}
|
||||
|
||||
fn dispatch_benchmark(
|
||||
@@ -960,7 +960,6 @@ impl_runtime_apis! {
|
||||
id: Concrete(GeneralIndex(i as u128).into()),
|
||||
fun: Fungible(fungibles_amount * i as u128),
|
||||
}
|
||||
.into()
|
||||
})
|
||||
.chain(core::iter::once(MultiAsset { id: Concrete(Here.into()), fun: Fungible(u128::MAX) }))
|
||||
.chain((0..holding_non_fungibles).map(|i| MultiAsset {
|
||||
@@ -980,7 +979,7 @@ impl_runtime_apis! {
|
||||
parameter_types! {
|
||||
pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some((
|
||||
DotLocation::get(),
|
||||
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(DotLocation::get()) },
|
||||
MultiAsset { fun: Fungible(UNITS), id: Concrete(DotLocation::get()) },
|
||||
));
|
||||
pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None;
|
||||
}
|
||||
@@ -994,7 +993,7 @@ impl_runtime_apis! {
|
||||
fn get_multi_asset() -> MultiAsset {
|
||||
MultiAsset {
|
||||
id: Concrete(DotLocation::get()),
|
||||
fun: Fungible(1 * UNITS),
|
||||
fun: Fungible(UNITS),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,8 +33,7 @@ const MAX_ASSETS: u64 = 100;
|
||||
impl WeighMultiAssets for MultiAssetFilter {
|
||||
fn weigh_multi_assets(&self, weight: Weight) -> Weight {
|
||||
match self {
|
||||
Self::Definite(assets) =>
|
||||
weight.saturating_mul(assets.inner().into_iter().count() as u64),
|
||||
Self::Definite(assets) => weight.saturating_mul(assets.inner().iter().count() as u64),
|
||||
Self::Wild(asset) => match asset {
|
||||
All => weight.saturating_mul(MAX_ASSETS),
|
||||
AllOf { fun, .. } => match fun {
|
||||
@@ -53,7 +52,7 @@ impl WeighMultiAssets for MultiAssetFilter {
|
||||
|
||||
impl WeighMultiAssets for MultiAssets {
|
||||
fn weigh_multi_assets(&self, weight: Weight) -> Weight {
|
||||
weight.saturating_mul(self.inner().into_iter().count() as u64)
|
||||
weight.saturating_mul(self.inner().iter().count() as u64)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +64,7 @@ impl<Call> XcmWeightInfo<Call> for StatemintXcmWeight<Call> {
|
||||
// Currently there is no trusted reserve
|
||||
fn reserve_asset_deposited(_assets: &MultiAssets) -> Weight {
|
||||
// TODO: hardcoded - fix https://github.com/paritytech/cumulus/issues/1974
|
||||
Weight::from_parts(1_000_000_000 as u64, 0)
|
||||
Weight::from_parts(1_000_000_000_u64, 0)
|
||||
}
|
||||
fn receive_teleported_asset(assets: &MultiAssets) -> Weight {
|
||||
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::receive_teleported_asset())
|
||||
@@ -123,7 +122,7 @@ impl<Call> XcmWeightInfo<Call> for StatemintXcmWeight<Call> {
|
||||
|
||||
fn deposit_asset(assets: &MultiAssetFilter, _dest: &MultiLocation) -> Weight {
|
||||
// Hardcoded till the XCM pallet is fixed
|
||||
let hardcoded_weight = Weight::from_parts(1_000_000_000 as u64, 0);
|
||||
let hardcoded_weight = Weight::from_parts(1_000_000_000_u64, 0);
|
||||
let weight = assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::deposit_asset());
|
||||
hardcoded_weight.min(weight)
|
||||
}
|
||||
|
||||
@@ -166,85 +166,82 @@ impl Contains<RuntimeCall> for SafeCallFilter {
|
||||
}
|
||||
}
|
||||
|
||||
match call {
|
||||
matches!(
|
||||
call,
|
||||
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) |
|
||||
RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) |
|
||||
RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { .. } |
|
||||
pallet_collator_selection::Call::set_candidacy_bond { .. } |
|
||||
pallet_collator_selection::Call::register_as_candidate { .. } |
|
||||
pallet_collator_selection::Call::leave_intent { .. } |
|
||||
pallet_collator_selection::Call::set_invulnerables { .. },
|
||||
) |
|
||||
RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::DmpQueue(..) |
|
||||
RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. }) |
|
||||
RuntimeCall::Assets(
|
||||
pallet_assets::Call::create { .. } |
|
||||
pallet_assets::Call::force_create { .. } |
|
||||
pallet_assets::Call::start_destroy { .. } |
|
||||
pallet_assets::Call::destroy_accounts { .. } |
|
||||
pallet_assets::Call::destroy_approvals { .. } |
|
||||
pallet_assets::Call::finish_destroy { .. } |
|
||||
pallet_assets::Call::mint { .. } |
|
||||
pallet_assets::Call::burn { .. } |
|
||||
pallet_assets::Call::transfer { .. } |
|
||||
pallet_assets::Call::transfer_keep_alive { .. } |
|
||||
pallet_assets::Call::force_transfer { .. } |
|
||||
pallet_assets::Call::freeze { .. } |
|
||||
pallet_assets::Call::thaw { .. } |
|
||||
pallet_assets::Call::freeze_asset { .. } |
|
||||
pallet_assets::Call::thaw_asset { .. } |
|
||||
pallet_assets::Call::transfer_ownership { .. } |
|
||||
pallet_assets::Call::set_team { .. } |
|
||||
pallet_assets::Call::clear_metadata { .. } |
|
||||
pallet_assets::Call::force_clear_metadata { .. } |
|
||||
pallet_assets::Call::force_asset_status { .. } |
|
||||
pallet_assets::Call::approve_transfer { .. } |
|
||||
pallet_assets::Call::cancel_approval { .. } |
|
||||
pallet_assets::Call::force_cancel_approval { .. } |
|
||||
pallet_assets::Call::transfer_approved { .. } |
|
||||
pallet_assets::Call::touch { .. } |
|
||||
pallet_assets::Call::refund { .. },
|
||||
) |
|
||||
RuntimeCall::Uniques(
|
||||
RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) | RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { .. } |
|
||||
pallet_collator_selection::Call::set_candidacy_bond { .. } |
|
||||
pallet_collator_selection::Call::register_as_candidate { .. } |
|
||||
pallet_collator_selection::Call::leave_intent { .. } |
|
||||
pallet_collator_selection::Call::set_invulnerables { .. },
|
||||
) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::DmpQueue(..) |
|
||||
RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. }) |
|
||||
RuntimeCall::Assets(
|
||||
pallet_assets::Call::create { .. } |
|
||||
pallet_assets::Call::force_create { .. } |
|
||||
pallet_assets::Call::start_destroy { .. } |
|
||||
pallet_assets::Call::destroy_accounts { .. } |
|
||||
pallet_assets::Call::destroy_approvals { .. } |
|
||||
pallet_assets::Call::finish_destroy { .. } |
|
||||
pallet_assets::Call::mint { .. } |
|
||||
pallet_assets::Call::burn { .. } |
|
||||
pallet_assets::Call::transfer { .. } |
|
||||
pallet_assets::Call::transfer_keep_alive { .. } |
|
||||
pallet_assets::Call::force_transfer { .. } |
|
||||
pallet_assets::Call::freeze { .. } |
|
||||
pallet_assets::Call::thaw { .. } |
|
||||
pallet_assets::Call::freeze_asset { .. } |
|
||||
pallet_assets::Call::thaw_asset { .. } |
|
||||
pallet_assets::Call::transfer_ownership { .. } |
|
||||
pallet_assets::Call::set_team { .. } |
|
||||
pallet_assets::Call::clear_metadata { .. } |
|
||||
pallet_assets::Call::force_clear_metadata { .. } |
|
||||
pallet_assets::Call::force_asset_status { .. } |
|
||||
pallet_assets::Call::approve_transfer { .. } |
|
||||
pallet_assets::Call::cancel_approval { .. } |
|
||||
pallet_assets::Call::force_cancel_approval { .. } |
|
||||
pallet_assets::Call::transfer_approved { .. } |
|
||||
pallet_assets::Call::touch { .. } |
|
||||
pallet_assets::Call::refund { .. },
|
||||
) | RuntimeCall::Uniques(
|
||||
pallet_uniques::Call::create { .. } |
|
||||
pallet_uniques::Call::force_create { .. } |
|
||||
pallet_uniques::Call::destroy { .. } |
|
||||
pallet_uniques::Call::mint { .. } |
|
||||
pallet_uniques::Call::burn { .. } |
|
||||
pallet_uniques::Call::transfer { .. } |
|
||||
pallet_uniques::Call::freeze { .. } |
|
||||
pallet_uniques::Call::thaw { .. } |
|
||||
pallet_uniques::Call::freeze_collection { .. } |
|
||||
pallet_uniques::Call::thaw_collection { .. } |
|
||||
pallet_uniques::Call::transfer_ownership { .. } |
|
||||
pallet_uniques::Call::set_team { .. } |
|
||||
pallet_uniques::Call::approve_transfer { .. } |
|
||||
pallet_uniques::Call::cancel_approval { .. } |
|
||||
pallet_uniques::Call::force_item_status { .. } |
|
||||
pallet_uniques::Call::set_attribute { .. } |
|
||||
pallet_uniques::Call::clear_attribute { .. } |
|
||||
pallet_uniques::Call::set_metadata { .. } |
|
||||
pallet_uniques::Call::clear_metadata { .. } |
|
||||
pallet_uniques::Call::set_collection_metadata { .. } |
|
||||
pallet_uniques::Call::clear_collection_metadata { .. } |
|
||||
pallet_uniques::Call::set_accept_ownership { .. } |
|
||||
pallet_uniques::Call::set_collection_max_supply { .. } |
|
||||
pallet_uniques::Call::set_price { .. } |
|
||||
pallet_uniques::Call::buy_item { .. },
|
||||
) => true,
|
||||
_ => false,
|
||||
}
|
||||
pallet_uniques::Call::force_create { .. } |
|
||||
pallet_uniques::Call::destroy { .. } |
|
||||
pallet_uniques::Call::mint { .. } |
|
||||
pallet_uniques::Call::burn { .. } |
|
||||
pallet_uniques::Call::transfer { .. } |
|
||||
pallet_uniques::Call::freeze { .. } |
|
||||
pallet_uniques::Call::thaw { .. } |
|
||||
pallet_uniques::Call::freeze_collection { .. } |
|
||||
pallet_uniques::Call::thaw_collection { .. } |
|
||||
pallet_uniques::Call::transfer_ownership { .. } |
|
||||
pallet_uniques::Call::set_team { .. } |
|
||||
pallet_uniques::Call::approve_transfer { .. } |
|
||||
pallet_uniques::Call::cancel_approval { .. } |
|
||||
pallet_uniques::Call::force_item_status { .. } |
|
||||
pallet_uniques::Call::set_attribute { .. } |
|
||||
pallet_uniques::Call::clear_attribute { .. } |
|
||||
pallet_uniques::Call::set_metadata { .. } |
|
||||
pallet_uniques::Call::clear_metadata { .. } |
|
||||
pallet_uniques::Call::set_collection_metadata { .. } |
|
||||
pallet_uniques::Call::clear_collection_metadata { .. } |
|
||||
pallet_uniques::Call::set_accept_ownership { .. } |
|
||||
pallet_uniques::Call::set_collection_max_supply { .. } |
|
||||
pallet_uniques::Call::set_price { .. } |
|
||||
pallet_uniques::Call::buy_item { .. },
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,19 +80,16 @@ fn test_asset_xcm_trader() {
|
||||
// Lets pay with: asset_amount_needed + asset_amount_extra
|
||||
let asset_amount_extra = 100_u128;
|
||||
let asset: MultiAsset =
|
||||
(asset_multilocation.clone(), asset_amount_needed + asset_amount_extra).into();
|
||||
(asset_multilocation, asset_amount_needed + asset_amount_extra).into();
|
||||
|
||||
let mut trader = <XcmConfig as xcm_executor::Config>::Trader::new();
|
||||
|
||||
// Lets buy_weight and make sure buy_weight does not return an error
|
||||
match trader.buy_weight(bought, asset.into()) {
|
||||
Ok(unused_assets) => {
|
||||
// Check whether a correct amount of unused assets is returned
|
||||
assert_ok!(unused_assets
|
||||
.ensure_contains(&(asset_multilocation, asset_amount_extra).into()));
|
||||
},
|
||||
Err(e) => assert!(false, "Expected Ok(_). Got {:#?}", e),
|
||||
}
|
||||
let unused_assets = trader.buy_weight(bought, asset.into()).expect("Expected Ok");
|
||||
// Check whether a correct amount of unused assets is returned
|
||||
assert_ok!(
|
||||
unused_assets.ensure_contains(&(asset_multilocation, asset_amount_extra).into())
|
||||
);
|
||||
|
||||
// Drop trader
|
||||
drop(trader);
|
||||
@@ -156,7 +153,7 @@ fn test_asset_xcm_trader_with_refund() {
|
||||
// lets calculate amount needed
|
||||
let amount_bought = WeightToFee::weight_to_fee(&bought);
|
||||
|
||||
let asset: MultiAsset = (asset_multilocation.clone(), amount_bought).into();
|
||||
let asset: MultiAsset = (asset_multilocation, amount_bought).into();
|
||||
|
||||
// Make sure buy_weight does not return an error
|
||||
assert_ok!(trader.buy_weight(bought, asset.clone().into()));
|
||||
@@ -233,7 +230,7 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() {
|
||||
"we are testing what happens when the amount does not exceed ED"
|
||||
);
|
||||
|
||||
let asset: MultiAsset = (asset_multilocation.clone(), amount_bought).into();
|
||||
let asset: MultiAsset = (asset_multilocation, amount_bought).into();
|
||||
|
||||
// Buy weight should return an error
|
||||
assert_noop!(trader.buy_weight(bought, asset.into()), XcmError::TooExpensive);
|
||||
@@ -286,11 +283,11 @@ fn test_that_buying_ed_refund_does_not_refund() {
|
||||
|
||||
// We know we will have to buy at least ED, so lets make sure first it will
|
||||
// fail with a payment of less than ED
|
||||
let asset: MultiAsset = (asset_multilocation.clone(), amount_bought).into();
|
||||
let asset: MultiAsset = (asset_multilocation, amount_bought).into();
|
||||
assert_noop!(trader.buy_weight(bought, asset.into()), XcmError::TooExpensive);
|
||||
|
||||
// Now lets buy ED at least
|
||||
let asset: MultiAsset = (asset_multilocation.clone(), ExistentialDeposit::get()).into();
|
||||
let asset: MultiAsset = (asset_multilocation, ExistentialDeposit::get()).into();
|
||||
|
||||
// Buy weight should work
|
||||
assert_ok!(trader.buy_weight(bought, asset.into()));
|
||||
|
||||
@@ -134,12 +134,12 @@ impl<
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
pallet_balances::GenesisConfig::<Runtime> { balances: self.balances.into() }
|
||||
pallet_balances::GenesisConfig::<Runtime> { balances: self.balances }
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
|
||||
pallet_collator_selection::GenesisConfig::<Runtime> {
|
||||
invulnerables: self.collators.clone().into(),
|
||||
invulnerables: self.collators.clone(),
|
||||
candidacy_bond: Default::default(),
|
||||
desired_candidates: Default::default(),
|
||||
}
|
||||
@@ -303,11 +303,10 @@ impl<Runtime: frame_system::Config + pallet_xcm::Config> RuntimeHelper<Runtime>
|
||||
.find_map(|e| match e {
|
||||
pallet_xcm::Event::Attempted(outcome) => Some(outcome),
|
||||
_ => None,
|
||||
});
|
||||
match outcome {
|
||||
Some(outcome) => assert_outcome(outcome),
|
||||
None => assert!(false, "No `pallet_xcm::Event::Attempted(outcome)` event found!"),
|
||||
}
|
||||
})
|
||||
.expect("No `pallet_xcm::Event::Attempted(outcome)` event found!");
|
||||
|
||||
assert_outcome(outcome);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,8 +361,11 @@ pub fn mock_open_hrmp_channel<
|
||||
recipient: ParaId,
|
||||
) {
|
||||
let n = 1_u32;
|
||||
let mut sproof_builder = RelayStateSproofBuilder::default();
|
||||
sproof_builder.para_id = sender;
|
||||
let mut sproof_builder = RelayStateSproofBuilder {
|
||||
para_id: sender,
|
||||
hrmp_egress_channel_index: Some(vec![recipient]),
|
||||
..Default::default()
|
||||
};
|
||||
sproof_builder.hrmp_channels.insert(
|
||||
HrmpChannelId { sender, recipient },
|
||||
AbridgedHrmpChannel {
|
||||
@@ -375,7 +377,6 @@ pub fn mock_open_hrmp_channel<
|
||||
mqc_head: None,
|
||||
},
|
||||
);
|
||||
sproof_builder.hrmp_egress_channel_index = Some(vec![recipient]);
|
||||
|
||||
let (relay_parent_storage_root, relay_chain_state) = sproof_builder.into_state_root_and_proof();
|
||||
let vfp = PersistedValidationData {
|
||||
@@ -388,7 +389,7 @@ pub fn mock_open_hrmp_channel<
|
||||
let inherent_data = {
|
||||
let mut inherent_data = InherentData::default();
|
||||
let system_inherent_data = ParachainInherentData {
|
||||
validation_data: vfp.clone(),
|
||||
validation_data: vfp,
|
||||
relay_chain_state,
|
||||
downward_messages: Default::default(),
|
||||
horizontal_messages: Default::default(),
|
||||
|
||||
@@ -134,7 +134,7 @@ pub fn teleports_for_native_asset_works<
|
||||
BuyExecution {
|
||||
fees: MultiAsset {
|
||||
id: Concrete(native_asset_id),
|
||||
fun: Fungible(buy_execution_fee_amount_eta.into()),
|
||||
fun: Fungible(buy_execution_fee_amount_eta),
|
||||
},
|
||||
weight_limit: Limited(Weight::from_parts(303531000, 65536)),
|
||||
},
|
||||
@@ -190,7 +190,7 @@ pub fn teleports_for_native_asset_works<
|
||||
RuntimeHelper::<Runtime>::origin_of(target_account.clone()),
|
||||
dest,
|
||||
dest_beneficiary,
|
||||
(native_asset_id, native_asset_to_teleport_away.clone().into()),
|
||||
(native_asset_id, native_asset_to_teleport_away.into()),
|
||||
None,
|
||||
));
|
||||
// check balances
|
||||
@@ -235,7 +235,7 @@ pub fn teleports_for_native_asset_works<
|
||||
RuntimeHelper::<Runtime>::origin_of(target_account.clone()),
|
||||
dest,
|
||||
dest_beneficiary,
|
||||
(native_asset_id, native_asset_to_teleport_away.clone().into()),
|
||||
(native_asset_id, native_asset_to_teleport_away.into()),
|
||||
Some((runtime_para_id, other_para_id)),
|
||||
));
|
||||
|
||||
@@ -366,7 +366,7 @@ pub fn teleports_for_foreign_assets_works<
|
||||
WeightToFee::weight_to_fee(&Weight::from_parts(90_000_000_000, 0));
|
||||
let buy_execution_fee = MultiAsset {
|
||||
id: Concrete(MultiLocation::parent()),
|
||||
fun: Fungible(buy_execution_fee_amount.into()),
|
||||
fun: Fungible(buy_execution_fee_amount),
|
||||
};
|
||||
|
||||
let teleported_foreign_asset_amount = 10000000000000;
|
||||
@@ -376,7 +376,7 @@ pub fn teleports_for_foreign_assets_works<
|
||||
.with_session_keys(collator_session_keys.session_keys())
|
||||
.with_balances(vec![
|
||||
(
|
||||
foreign_creator_as_account_id.clone(),
|
||||
foreign_creator_as_account_id,
|
||||
existential_deposit + (buy_execution_fee_amount * 2).into(),
|
||||
),
|
||||
(target_account.clone(), existential_deposit),
|
||||
@@ -441,7 +441,7 @@ pub fn teleports_for_foreign_assets_works<
|
||||
BuyExecution {
|
||||
fees: MultiAsset {
|
||||
id: Concrete(MultiLocation::parent()),
|
||||
fun: Fungible(buy_execution_fee_amount.into()),
|
||||
fun: Fungible(buy_execution_fee_amount),
|
||||
},
|
||||
weight_limit: Limited(Weight::from_parts(403531000, 65536)),
|
||||
},
|
||||
@@ -536,7 +536,7 @@ pub fn teleports_for_foreign_assets_works<
|
||||
RuntimeHelper::<Runtime>::origin_of(target_account.clone()),
|
||||
dest,
|
||||
dest_beneficiary,
|
||||
(foreign_asset_id_multilocation, asset_to_teleport_away.clone().into()),
|
||||
(foreign_asset_id_multilocation, asset_to_teleport_away),
|
||||
Some((runtime_para_id, foreign_para_id)),
|
||||
));
|
||||
|
||||
@@ -788,7 +788,7 @@ pub fn asset_transactor_transfer_with_pallet_assets_instance_works<
|
||||
.execute_with(|| {
|
||||
// create some asset class
|
||||
let asset_minimum_asset_balance = 3333333_u128;
|
||||
let asset_id_as_multilocation = AssetIdConverter::reverse_ref(&asset_id).unwrap();
|
||||
let asset_id_as_multilocation = AssetIdConverter::reverse_ref(asset_id).unwrap();
|
||||
assert_ok!(<pallet_assets::Pallet<Runtime, AssetsPalletInstance>>::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
asset_id.into(),
|
||||
@@ -869,7 +869,7 @@ pub fn asset_transactor_transfer_with_pallet_assets_instance_works<
|
||||
id: charlie_account.clone().into()
|
||||
}),
|
||||
},
|
||||
(asset_id_as_multilocation, 1 * asset_minimum_asset_balance),
|
||||
(asset_id_as_multilocation, asset_minimum_asset_balance),
|
||||
),
|
||||
XcmError::FailedToTransactAsset(Into::<&str>::into(
|
||||
sp_runtime::TokenError::CannotCreate
|
||||
@@ -890,7 +890,7 @@ pub fn asset_transactor_transfer_with_pallet_assets_instance_works<
|
||||
parents: 0,
|
||||
interior: X1(AccountId32 { network: None, id: bob_account.clone().into() }),
|
||||
},
|
||||
(asset_id_as_multilocation, 1 * asset_minimum_asset_balance),
|
||||
(asset_id_as_multilocation, asset_minimum_asset_balance),
|
||||
),
|
||||
Ok(_)
|
||||
));
|
||||
@@ -908,7 +908,7 @@ pub fn asset_transactor_transfer_with_pallet_assets_instance_works<
|
||||
asset_id.into(),
|
||||
&bob_account
|
||||
),
|
||||
(1 * asset_minimum_asset_balance).into()
|
||||
asset_minimum_asset_balance.into()
|
||||
);
|
||||
assert_eq!(
|
||||
<pallet_assets::Pallet<Runtime, AssetsPalletInstance>>::balance(
|
||||
@@ -1130,7 +1130,7 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_parachain_assets_wor
|
||||
// lets simulate this was triggered by relay chain from local consensus sibling parachain
|
||||
let xcm = Xcm(vec![
|
||||
WithdrawAsset(buy_execution_fee.clone().into()),
|
||||
BuyExecution { fees: buy_execution_fee.clone().into(), weight_limit: Unlimited },
|
||||
BuyExecution { fees: buy_execution_fee.clone(), weight_limit: Unlimited },
|
||||
Transact {
|
||||
origin_kind: OriginKind::Xcm,
|
||||
require_weight_at_most: Weight::from_parts(40_000_000_000, 8000),
|
||||
@@ -1247,7 +1247,7 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_parachain_assets_wor
|
||||
});
|
||||
let xcm = Xcm(vec![
|
||||
WithdrawAsset(buy_execution_fee.clone().into()),
|
||||
BuyExecution { fees: buy_execution_fee.clone().into(), weight_limit: Unlimited },
|
||||
BuyExecution { fees: buy_execution_fee.clone(), weight_limit: Unlimited },
|
||||
Transact {
|
||||
origin_kind: OriginKind::Xcm,
|
||||
require_weight_at_most: Weight::from_parts(20_000_000_000, 8000),
|
||||
|
||||
@@ -199,7 +199,7 @@ impl pallet_balances::Config for Runtime {
|
||||
|
||||
parameter_types! {
|
||||
/// Relay Chain `TransactionByteFee` / 10
|
||||
pub const TransactionByteFee: Balance = 1 * MILLICENTS;
|
||||
pub const TransactionByteFee: Balance = MILLICENTS;
|
||||
}
|
||||
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
@@ -1038,7 +1038,7 @@ impl_runtime_apis! {
|
||||
list_benchmarks!(list, extra);
|
||||
|
||||
let storage_info = AllPalletsWithSystem::storage_info();
|
||||
return (list, storage_info)
|
||||
(list, storage_info)
|
||||
}
|
||||
|
||||
fn dispatch_benchmark(
|
||||
@@ -1073,7 +1073,6 @@ impl_runtime_apis! {
|
||||
id: Concrete(GeneralIndex(i as u128).into()),
|
||||
fun: Fungible(fungibles_amount * i as u128),
|
||||
}
|
||||
.into()
|
||||
})
|
||||
.chain(core::iter::once(MultiAsset { id: Concrete(Here.into()), fun: Fungible(u128::MAX) }))
|
||||
.chain((0..holding_non_fungibles).map(|i| MultiAsset {
|
||||
@@ -1093,7 +1092,7 @@ impl_runtime_apis! {
|
||||
parameter_types! {
|
||||
pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some((
|
||||
WestendLocation::get(),
|
||||
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(WestendLocation::get()) },
|
||||
MultiAsset { fun: Fungible(UNITS), id: Concrete(WestendLocation::get()) },
|
||||
));
|
||||
pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None;
|
||||
|
||||
@@ -1108,7 +1107,7 @@ impl_runtime_apis! {
|
||||
fn get_multi_asset() -> MultiAsset {
|
||||
MultiAsset {
|
||||
id: Concrete(WestendLocation::get()),
|
||||
fun: Fungible(1 * UNITS),
|
||||
fun: Fungible(UNITS),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,8 +33,7 @@ const MAX_ASSETS: u64 = 100;
|
||||
impl WeighMultiAssets for MultiAssetFilter {
|
||||
fn weigh_multi_assets(&self, weight: Weight) -> Weight {
|
||||
match self {
|
||||
Self::Definite(assets) =>
|
||||
weight.saturating_mul(assets.inner().into_iter().count() as u64),
|
||||
Self::Definite(assets) => weight.saturating_mul(assets.inner().iter().count() as u64),
|
||||
Self::Wild(asset) => match asset {
|
||||
All => weight.saturating_mul(MAX_ASSETS),
|
||||
AllOf { fun, .. } => match fun {
|
||||
@@ -53,7 +52,7 @@ impl WeighMultiAssets for MultiAssetFilter {
|
||||
|
||||
impl WeighMultiAssets for MultiAssets {
|
||||
fn weigh_multi_assets(&self, weight: Weight) -> Weight {
|
||||
weight.saturating_mul(self.inner().into_iter().count() as u64)
|
||||
weight.saturating_mul(self.inner().iter().count() as u64)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +64,7 @@ impl<Call> XcmWeightInfo<Call> for WestmintXcmWeight<Call> {
|
||||
// Currently there is no trusted reserve
|
||||
fn reserve_asset_deposited(_assets: &MultiAssets) -> Weight {
|
||||
// TODO: hardcoded - fix https://github.com/paritytech/cumulus/issues/1974
|
||||
Weight::from_parts(1_000_000_000 as u64, 0)
|
||||
Weight::from_parts(1_000_000_000_u64, 0)
|
||||
}
|
||||
fn receive_teleported_asset(assets: &MultiAssets) -> Weight {
|
||||
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::receive_teleported_asset())
|
||||
@@ -123,7 +122,7 @@ impl<Call> XcmWeightInfo<Call> for WestmintXcmWeight<Call> {
|
||||
|
||||
fn deposit_asset(assets: &MultiAssetFilter, _dest: &MultiLocation) -> Weight {
|
||||
// Hardcoded till the XCM pallet is fixed
|
||||
let hardcoded_weight = Weight::from_parts(1_000_000_000 as u64, 0);
|
||||
let hardcoded_weight = Weight::from_parts(1_000_000_000_u64, 0);
|
||||
let weight = assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::deposit_asset());
|
||||
hardcoded_weight.min(weight)
|
||||
}
|
||||
|
||||
@@ -191,155 +191,149 @@ impl Contains<RuntimeCall> for SafeCallFilter {
|
||||
}
|
||||
}
|
||||
|
||||
match call {
|
||||
matches!(
|
||||
call,
|
||||
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) |
|
||||
RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) |
|
||||
RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { .. } |
|
||||
pallet_collator_selection::Call::set_candidacy_bond { .. } |
|
||||
pallet_collator_selection::Call::register_as_candidate { .. } |
|
||||
pallet_collator_selection::Call::leave_intent { .. },
|
||||
) |
|
||||
RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::DmpQueue(..) |
|
||||
RuntimeCall::Utility(
|
||||
pallet_utility::Call::as_derivative { .. } |
|
||||
pallet_utility::Call::batch { .. } |
|
||||
pallet_utility::Call::batch_all { .. },
|
||||
) |
|
||||
RuntimeCall::Assets(
|
||||
RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) | RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { .. } |
|
||||
pallet_collator_selection::Call::set_candidacy_bond { .. } |
|
||||
pallet_collator_selection::Call::register_as_candidate { .. } |
|
||||
pallet_collator_selection::Call::leave_intent { .. },
|
||||
) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::DmpQueue(..) |
|
||||
RuntimeCall::Utility(
|
||||
pallet_utility::Call::as_derivative { .. } |
|
||||
pallet_utility::Call::batch { .. } |
|
||||
pallet_utility::Call::batch_all { .. },
|
||||
) | RuntimeCall::Assets(
|
||||
pallet_assets::Call::create { .. } |
|
||||
pallet_assets::Call::force_create { .. } |
|
||||
pallet_assets::Call::start_destroy { .. } |
|
||||
pallet_assets::Call::destroy_accounts { .. } |
|
||||
pallet_assets::Call::destroy_approvals { .. } |
|
||||
pallet_assets::Call::finish_destroy { .. } |
|
||||
pallet_assets::Call::mint { .. } |
|
||||
pallet_assets::Call::burn { .. } |
|
||||
pallet_assets::Call::transfer { .. } |
|
||||
pallet_assets::Call::transfer_keep_alive { .. } |
|
||||
pallet_assets::Call::force_transfer { .. } |
|
||||
pallet_assets::Call::freeze { .. } |
|
||||
pallet_assets::Call::thaw { .. } |
|
||||
pallet_assets::Call::freeze_asset { .. } |
|
||||
pallet_assets::Call::thaw_asset { .. } |
|
||||
pallet_assets::Call::transfer_ownership { .. } |
|
||||
pallet_assets::Call::set_team { .. } |
|
||||
pallet_assets::Call::clear_metadata { .. } |
|
||||
pallet_assets::Call::force_clear_metadata { .. } |
|
||||
pallet_assets::Call::force_asset_status { .. } |
|
||||
pallet_assets::Call::approve_transfer { .. } |
|
||||
pallet_assets::Call::cancel_approval { .. } |
|
||||
pallet_assets::Call::force_cancel_approval { .. } |
|
||||
pallet_assets::Call::transfer_approved { .. } |
|
||||
pallet_assets::Call::touch { .. } |
|
||||
pallet_assets::Call::refund { .. },
|
||||
) |
|
||||
RuntimeCall::ForeignAssets(
|
||||
pallet_assets::Call::force_create { .. } |
|
||||
pallet_assets::Call::start_destroy { .. } |
|
||||
pallet_assets::Call::destroy_accounts { .. } |
|
||||
pallet_assets::Call::destroy_approvals { .. } |
|
||||
pallet_assets::Call::finish_destroy { .. } |
|
||||
pallet_assets::Call::mint { .. } |
|
||||
pallet_assets::Call::burn { .. } |
|
||||
pallet_assets::Call::transfer { .. } |
|
||||
pallet_assets::Call::transfer_keep_alive { .. } |
|
||||
pallet_assets::Call::force_transfer { .. } |
|
||||
pallet_assets::Call::freeze { .. } |
|
||||
pallet_assets::Call::thaw { .. } |
|
||||
pallet_assets::Call::freeze_asset { .. } |
|
||||
pallet_assets::Call::thaw_asset { .. } |
|
||||
pallet_assets::Call::transfer_ownership { .. } |
|
||||
pallet_assets::Call::set_team { .. } |
|
||||
pallet_assets::Call::clear_metadata { .. } |
|
||||
pallet_assets::Call::force_clear_metadata { .. } |
|
||||
pallet_assets::Call::force_asset_status { .. } |
|
||||
pallet_assets::Call::approve_transfer { .. } |
|
||||
pallet_assets::Call::cancel_approval { .. } |
|
||||
pallet_assets::Call::force_cancel_approval { .. } |
|
||||
pallet_assets::Call::transfer_approved { .. } |
|
||||
pallet_assets::Call::touch { .. } |
|
||||
pallet_assets::Call::refund { .. },
|
||||
) | RuntimeCall::ForeignAssets(
|
||||
pallet_assets::Call::create { .. } |
|
||||
pallet_assets::Call::force_create { .. } |
|
||||
pallet_assets::Call::start_destroy { .. } |
|
||||
pallet_assets::Call::destroy_accounts { .. } |
|
||||
pallet_assets::Call::destroy_approvals { .. } |
|
||||
pallet_assets::Call::finish_destroy { .. } |
|
||||
pallet_assets::Call::mint { .. } |
|
||||
pallet_assets::Call::burn { .. } |
|
||||
pallet_assets::Call::transfer { .. } |
|
||||
pallet_assets::Call::transfer_keep_alive { .. } |
|
||||
pallet_assets::Call::force_transfer { .. } |
|
||||
pallet_assets::Call::freeze { .. } |
|
||||
pallet_assets::Call::thaw { .. } |
|
||||
pallet_assets::Call::freeze_asset { .. } |
|
||||
pallet_assets::Call::thaw_asset { .. } |
|
||||
pallet_assets::Call::transfer_ownership { .. } |
|
||||
pallet_assets::Call::set_team { .. } |
|
||||
pallet_assets::Call::set_metadata { .. } |
|
||||
pallet_assets::Call::clear_metadata { .. } |
|
||||
pallet_assets::Call::force_clear_metadata { .. } |
|
||||
pallet_assets::Call::force_asset_status { .. } |
|
||||
pallet_assets::Call::approve_transfer { .. } |
|
||||
pallet_assets::Call::cancel_approval { .. } |
|
||||
pallet_assets::Call::force_cancel_approval { .. } |
|
||||
pallet_assets::Call::transfer_approved { .. } |
|
||||
pallet_assets::Call::touch { .. } |
|
||||
pallet_assets::Call::refund { .. },
|
||||
) |
|
||||
RuntimeCall::Nfts(
|
||||
pallet_assets::Call::force_create { .. } |
|
||||
pallet_assets::Call::start_destroy { .. } |
|
||||
pallet_assets::Call::destroy_accounts { .. } |
|
||||
pallet_assets::Call::destroy_approvals { .. } |
|
||||
pallet_assets::Call::finish_destroy { .. } |
|
||||
pallet_assets::Call::mint { .. } |
|
||||
pallet_assets::Call::burn { .. } |
|
||||
pallet_assets::Call::transfer { .. } |
|
||||
pallet_assets::Call::transfer_keep_alive { .. } |
|
||||
pallet_assets::Call::force_transfer { .. } |
|
||||
pallet_assets::Call::freeze { .. } |
|
||||
pallet_assets::Call::thaw { .. } |
|
||||
pallet_assets::Call::freeze_asset { .. } |
|
||||
pallet_assets::Call::thaw_asset { .. } |
|
||||
pallet_assets::Call::transfer_ownership { .. } |
|
||||
pallet_assets::Call::set_team { .. } |
|
||||
pallet_assets::Call::set_metadata { .. } |
|
||||
pallet_assets::Call::clear_metadata { .. } |
|
||||
pallet_assets::Call::force_clear_metadata { .. } |
|
||||
pallet_assets::Call::force_asset_status { .. } |
|
||||
pallet_assets::Call::approve_transfer { .. } |
|
||||
pallet_assets::Call::cancel_approval { .. } |
|
||||
pallet_assets::Call::force_cancel_approval { .. } |
|
||||
pallet_assets::Call::transfer_approved { .. } |
|
||||
pallet_assets::Call::touch { .. } |
|
||||
pallet_assets::Call::refund { .. },
|
||||
) | RuntimeCall::Nfts(
|
||||
pallet_nfts::Call::create { .. } |
|
||||
pallet_nfts::Call::force_create { .. } |
|
||||
pallet_nfts::Call::destroy { .. } |
|
||||
pallet_nfts::Call::mint { .. } |
|
||||
pallet_nfts::Call::force_mint { .. } |
|
||||
pallet_nfts::Call::burn { .. } |
|
||||
pallet_nfts::Call::transfer { .. } |
|
||||
pallet_nfts::Call::lock_item_transfer { .. } |
|
||||
pallet_nfts::Call::unlock_item_transfer { .. } |
|
||||
pallet_nfts::Call::lock_collection { .. } |
|
||||
pallet_nfts::Call::transfer_ownership { .. } |
|
||||
pallet_nfts::Call::set_team { .. } |
|
||||
pallet_nfts::Call::force_collection_owner { .. } |
|
||||
pallet_nfts::Call::force_collection_config { .. } |
|
||||
pallet_nfts::Call::approve_transfer { .. } |
|
||||
pallet_nfts::Call::cancel_approval { .. } |
|
||||
pallet_nfts::Call::clear_all_transfer_approvals { .. } |
|
||||
pallet_nfts::Call::lock_item_properties { .. } |
|
||||
pallet_nfts::Call::set_attribute { .. } |
|
||||
pallet_nfts::Call::force_set_attribute { .. } |
|
||||
pallet_nfts::Call::clear_attribute { .. } |
|
||||
pallet_nfts::Call::approve_item_attributes { .. } |
|
||||
pallet_nfts::Call::cancel_item_attributes_approval { .. } |
|
||||
pallet_nfts::Call::set_metadata { .. } |
|
||||
pallet_nfts::Call::clear_metadata { .. } |
|
||||
pallet_nfts::Call::set_collection_metadata { .. } |
|
||||
pallet_nfts::Call::clear_collection_metadata { .. } |
|
||||
pallet_nfts::Call::set_accept_ownership { .. } |
|
||||
pallet_nfts::Call::set_collection_max_supply { .. } |
|
||||
pallet_nfts::Call::update_mint_settings { .. } |
|
||||
pallet_nfts::Call::set_price { .. } |
|
||||
pallet_nfts::Call::buy_item { .. } |
|
||||
pallet_nfts::Call::pay_tips { .. } |
|
||||
pallet_nfts::Call::create_swap { .. } |
|
||||
pallet_nfts::Call::cancel_swap { .. } |
|
||||
pallet_nfts::Call::claim_swap { .. },
|
||||
) |
|
||||
RuntimeCall::Uniques(
|
||||
pallet_nfts::Call::force_create { .. } |
|
||||
pallet_nfts::Call::destroy { .. } |
|
||||
pallet_nfts::Call::mint { .. } |
|
||||
pallet_nfts::Call::force_mint { .. } |
|
||||
pallet_nfts::Call::burn { .. } |
|
||||
pallet_nfts::Call::transfer { .. } |
|
||||
pallet_nfts::Call::lock_item_transfer { .. } |
|
||||
pallet_nfts::Call::unlock_item_transfer { .. } |
|
||||
pallet_nfts::Call::lock_collection { .. } |
|
||||
pallet_nfts::Call::transfer_ownership { .. } |
|
||||
pallet_nfts::Call::set_team { .. } |
|
||||
pallet_nfts::Call::force_collection_owner { .. } |
|
||||
pallet_nfts::Call::force_collection_config { .. } |
|
||||
pallet_nfts::Call::approve_transfer { .. } |
|
||||
pallet_nfts::Call::cancel_approval { .. } |
|
||||
pallet_nfts::Call::clear_all_transfer_approvals { .. } |
|
||||
pallet_nfts::Call::lock_item_properties { .. } |
|
||||
pallet_nfts::Call::set_attribute { .. } |
|
||||
pallet_nfts::Call::force_set_attribute { .. } |
|
||||
pallet_nfts::Call::clear_attribute { .. } |
|
||||
pallet_nfts::Call::approve_item_attributes { .. } |
|
||||
pallet_nfts::Call::cancel_item_attributes_approval { .. } |
|
||||
pallet_nfts::Call::set_metadata { .. } |
|
||||
pallet_nfts::Call::clear_metadata { .. } |
|
||||
pallet_nfts::Call::set_collection_metadata { .. } |
|
||||
pallet_nfts::Call::clear_collection_metadata { .. } |
|
||||
pallet_nfts::Call::set_accept_ownership { .. } |
|
||||
pallet_nfts::Call::set_collection_max_supply { .. } |
|
||||
pallet_nfts::Call::update_mint_settings { .. } |
|
||||
pallet_nfts::Call::set_price { .. } |
|
||||
pallet_nfts::Call::buy_item { .. } |
|
||||
pallet_nfts::Call::pay_tips { .. } |
|
||||
pallet_nfts::Call::create_swap { .. } |
|
||||
pallet_nfts::Call::cancel_swap { .. } |
|
||||
pallet_nfts::Call::claim_swap { .. },
|
||||
) | RuntimeCall::Uniques(
|
||||
pallet_uniques::Call::create { .. } |
|
||||
pallet_uniques::Call::force_create { .. } |
|
||||
pallet_uniques::Call::destroy { .. } |
|
||||
pallet_uniques::Call::mint { .. } |
|
||||
pallet_uniques::Call::burn { .. } |
|
||||
pallet_uniques::Call::transfer { .. } |
|
||||
pallet_uniques::Call::freeze { .. } |
|
||||
pallet_uniques::Call::thaw { .. } |
|
||||
pallet_uniques::Call::freeze_collection { .. } |
|
||||
pallet_uniques::Call::thaw_collection { .. } |
|
||||
pallet_uniques::Call::transfer_ownership { .. } |
|
||||
pallet_uniques::Call::set_team { .. } |
|
||||
pallet_uniques::Call::approve_transfer { .. } |
|
||||
pallet_uniques::Call::cancel_approval { .. } |
|
||||
pallet_uniques::Call::force_item_status { .. } |
|
||||
pallet_uniques::Call::set_attribute { .. } |
|
||||
pallet_uniques::Call::clear_attribute { .. } |
|
||||
pallet_uniques::Call::set_metadata { .. } |
|
||||
pallet_uniques::Call::clear_metadata { .. } |
|
||||
pallet_uniques::Call::set_collection_metadata { .. } |
|
||||
pallet_uniques::Call::clear_collection_metadata { .. } |
|
||||
pallet_uniques::Call::set_accept_ownership { .. } |
|
||||
pallet_uniques::Call::set_collection_max_supply { .. } |
|
||||
pallet_uniques::Call::set_price { .. } |
|
||||
pallet_uniques::Call::buy_item { .. },
|
||||
) => true,
|
||||
_ => false,
|
||||
}
|
||||
pallet_uniques::Call::force_create { .. } |
|
||||
pallet_uniques::Call::destroy { .. } |
|
||||
pallet_uniques::Call::mint { .. } |
|
||||
pallet_uniques::Call::burn { .. } |
|
||||
pallet_uniques::Call::transfer { .. } |
|
||||
pallet_uniques::Call::freeze { .. } |
|
||||
pallet_uniques::Call::thaw { .. } |
|
||||
pallet_uniques::Call::freeze_collection { .. } |
|
||||
pallet_uniques::Call::thaw_collection { .. } |
|
||||
pallet_uniques::Call::transfer_ownership { .. } |
|
||||
pallet_uniques::Call::set_team { .. } |
|
||||
pallet_uniques::Call::approve_transfer { .. } |
|
||||
pallet_uniques::Call::cancel_approval { .. } |
|
||||
pallet_uniques::Call::force_item_status { .. } |
|
||||
pallet_uniques::Call::set_attribute { .. } |
|
||||
pallet_uniques::Call::clear_attribute { .. } |
|
||||
pallet_uniques::Call::set_metadata { .. } |
|
||||
pallet_uniques::Call::clear_metadata { .. } |
|
||||
pallet_uniques::Call::set_collection_metadata { .. } |
|
||||
pallet_uniques::Call::clear_collection_metadata { .. } |
|
||||
pallet_uniques::Call::set_accept_ownership { .. } |
|
||||
pallet_uniques::Call::set_collection_max_supply { .. } |
|
||||
pallet_uniques::Call::set_price { .. } |
|
||||
pallet_uniques::Call::buy_item { .. },
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,19 +84,16 @@ fn test_asset_xcm_trader() {
|
||||
// Lets pay with: asset_amount_needed + asset_amount_extra
|
||||
let asset_amount_extra = 100_u128;
|
||||
let asset: MultiAsset =
|
||||
(asset_multilocation.clone(), asset_amount_needed + asset_amount_extra).into();
|
||||
(asset_multilocation, asset_amount_needed + asset_amount_extra).into();
|
||||
|
||||
let mut trader = <XcmConfig as xcm_executor::Config>::Trader::new();
|
||||
|
||||
// Lets buy_weight and make sure buy_weight does not return an error
|
||||
match trader.buy_weight(bought, asset.into()) {
|
||||
Ok(unused_assets) => {
|
||||
// Check whether a correct amount of unused assets is returned
|
||||
assert_ok!(unused_assets
|
||||
.ensure_contains(&(asset_multilocation, asset_amount_extra).into()));
|
||||
},
|
||||
Err(e) => assert!(false, "Expected Ok(_). Got {:#?}", e),
|
||||
}
|
||||
let unused_assets = trader.buy_weight(bought, asset.into()).expect("Expected Ok");
|
||||
// Check whether a correct amount of unused assets is returned
|
||||
assert_ok!(
|
||||
unused_assets.ensure_contains(&(asset_multilocation, asset_amount_extra).into())
|
||||
);
|
||||
|
||||
// Drop trader
|
||||
drop(trader);
|
||||
@@ -156,7 +153,7 @@ fn test_asset_xcm_trader_with_refund() {
|
||||
// lets calculate amount needed
|
||||
let amount_bought = WeightToFee::weight_to_fee(&bought);
|
||||
|
||||
let asset: MultiAsset = (asset_multilocation.clone(), amount_bought).into();
|
||||
let asset: MultiAsset = (asset_multilocation, amount_bought).into();
|
||||
|
||||
// Make sure buy_weight does not return an error
|
||||
assert_ok!(trader.buy_weight(bought, asset.clone().into()));
|
||||
@@ -230,7 +227,7 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() {
|
||||
"we are testing what happens when the amount does not exceed ED"
|
||||
);
|
||||
|
||||
let asset: MultiAsset = (asset_multilocation.clone(), amount_bought).into();
|
||||
let asset: MultiAsset = (asset_multilocation, amount_bought).into();
|
||||
|
||||
// Buy weight should return an error
|
||||
assert_noop!(trader.buy_weight(bought, asset.into()), XcmError::TooExpensive);
|
||||
@@ -282,11 +279,11 @@ fn test_that_buying_ed_refund_does_not_refund() {
|
||||
|
||||
// We know we will have to buy at least ED, so lets make sure first it will
|
||||
// fail with a payment of less than ED
|
||||
let asset: MultiAsset = (asset_multilocation.clone(), amount_bought).into();
|
||||
let asset: MultiAsset = (asset_multilocation, amount_bought).into();
|
||||
assert_noop!(trader.buy_weight(bought, asset.into()), XcmError::TooExpensive);
|
||||
|
||||
// Now lets buy ED at least
|
||||
let asset: MultiAsset = (asset_multilocation.clone(), ExistentialDeposit::get()).into();
|
||||
let asset: MultiAsset = (asset_multilocation, ExistentialDeposit::get()).into();
|
||||
|
||||
// Buy weight should work
|
||||
assert_ok!(trader.buy_weight(bought, asset.into()));
|
||||
@@ -421,7 +418,7 @@ fn test_assets_balances_api_works() {
|
||||
let foreign_asset_minimum_asset_balance = 3333333_u128;
|
||||
assert_ok!(ForeignAssets::force_create(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
foreign_asset_id_multilocation.clone().into(),
|
||||
foreign_asset_id_multilocation,
|
||||
AccountId::from(SOME_ASSET_ADMIN).into(),
|
||||
false,
|
||||
foreign_asset_minimum_asset_balance
|
||||
@@ -430,7 +427,7 @@ fn test_assets_balances_api_works() {
|
||||
// We first mint enough asset for the account to exist for assets
|
||||
assert_ok!(ForeignAssets::mint(
|
||||
RuntimeHelper::<Runtime>::origin_of(AccountId::from(SOME_ASSET_ADMIN)),
|
||||
foreign_asset_id_multilocation.clone().into(),
|
||||
foreign_asset_id_multilocation,
|
||||
AccountId::from(ALICE).into(),
|
||||
6 * foreign_asset_minimum_asset_balance
|
||||
));
|
||||
|
||||
@@ -254,7 +254,7 @@ impl pallet_balances::Config for Runtime {
|
||||
|
||||
parameter_types! {
|
||||
/// Relay Chain `TransactionByteFee` / 10
|
||||
pub const TransactionByteFee: Balance = 1 * MILLICENTS;
|
||||
pub const TransactionByteFee: Balance = MILLICENTS;
|
||||
}
|
||||
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
@@ -615,7 +615,7 @@ impl_runtime_apis! {
|
||||
list_benchmarks!(list, extra);
|
||||
|
||||
let storage_info = AllPalletsWithSystem::storage_info();
|
||||
return (list, storage_info)
|
||||
(list, storage_info)
|
||||
}
|
||||
|
||||
fn dispatch_benchmark(
|
||||
@@ -653,7 +653,7 @@ impl_runtime_apis! {
|
||||
parameter_types! {
|
||||
pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some((
|
||||
KsmRelayLocation::get(),
|
||||
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(KsmRelayLocation::get()) },
|
||||
MultiAsset { fun: Fungible(UNITS), id: Concrete(KsmRelayLocation::get()) },
|
||||
));
|
||||
pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None;
|
||||
}
|
||||
@@ -667,7 +667,7 @@ impl_runtime_apis! {
|
||||
fn get_multi_asset() -> MultiAsset {
|
||||
MultiAsset {
|
||||
id: Concrete(KsmRelayLocation::get()),
|
||||
fun: Fungible(1 * UNITS),
|
||||
fun: Fungible(UNITS),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,8 +33,7 @@ const MAX_ASSETS: u64 = 100;
|
||||
impl WeighMultiAssets for MultiAssetFilter {
|
||||
fn weigh_multi_assets(&self, weight: Weight) -> Weight {
|
||||
match self {
|
||||
Self::Definite(assets) =>
|
||||
weight.saturating_mul(assets.inner().into_iter().count() as u64),
|
||||
Self::Definite(assets) => weight.saturating_mul(assets.inner().iter().count() as u64),
|
||||
Self::Wild(asset) => match asset {
|
||||
All => weight.saturating_mul(MAX_ASSETS),
|
||||
AllOf { fun, .. } => match fun {
|
||||
@@ -53,7 +52,7 @@ impl WeighMultiAssets for MultiAssetFilter {
|
||||
|
||||
impl WeighMultiAssets for MultiAssets {
|
||||
fn weigh_multi_assets(&self, weight: Weight) -> Weight {
|
||||
weight.saturating_mul(self.inner().into_iter().count() as u64)
|
||||
weight.saturating_mul(self.inner().iter().count() as u64)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +64,7 @@ impl<Call> XcmWeightInfo<Call> for BridgeHubKusamaXcmWeight<Call> {
|
||||
// Currently there is no trusted reserve
|
||||
fn reserve_asset_deposited(_assets: &MultiAssets) -> Weight {
|
||||
// TODO: hardcoded - fix https://github.com/paritytech/cumulus/issues/1974
|
||||
Weight::from_parts(1_000_000_000 as u64, 0)
|
||||
Weight::from_parts(1_000_000_000_u64, 0)
|
||||
}
|
||||
fn receive_teleported_asset(assets: &MultiAssets) -> Weight {
|
||||
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::receive_teleported_asset())
|
||||
@@ -123,7 +122,7 @@ impl<Call> XcmWeightInfo<Call> for BridgeHubKusamaXcmWeight<Call> {
|
||||
|
||||
fn deposit_asset(assets: &MultiAssetFilter, _dest: &MultiLocation) -> Weight {
|
||||
// Hardcoded till the XCM pallet is fixed
|
||||
let hardcoded_weight = Weight::from_parts(1_000_000_000 as u64, 0);
|
||||
let hardcoded_weight = Weight::from_parts(1_000_000_000_u64, 0);
|
||||
let weight = assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::deposit_asset());
|
||||
hardcoded_weight.min(weight)
|
||||
}
|
||||
|
||||
@@ -129,29 +129,27 @@ impl Contains<RuntimeCall> for SafeCallFilter {
|
||||
}
|
||||
}
|
||||
|
||||
match call {
|
||||
matches!(
|
||||
call,
|
||||
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) |
|
||||
RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) |
|
||||
RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { .. } |
|
||||
pallet_collator_selection::Call::set_candidacy_bond { .. } |
|
||||
pallet_collator_selection::Call::register_as_candidate { .. } |
|
||||
pallet_collator_selection::Call::leave_intent { .. },
|
||||
) |
|
||||
RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::DmpQueue(..) |
|
||||
RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. }) => true,
|
||||
_ => false,
|
||||
}
|
||||
RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) | RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { .. } |
|
||||
pallet_collator_selection::Call::set_candidacy_bond { .. } |
|
||||
pallet_collator_selection::Call::register_as_candidate { .. } |
|
||||
pallet_collator_selection::Call::leave_intent { .. },
|
||||
) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::DmpQueue(..) |
|
||||
RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. })
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ impl pallet_balances::Config for Runtime {
|
||||
|
||||
parameter_types! {
|
||||
/// Relay Chain `TransactionByteFee` / 10
|
||||
pub const TransactionByteFee: Balance = 1 * MILLICENTS;
|
||||
pub const TransactionByteFee: Balance = MILLICENTS;
|
||||
}
|
||||
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
@@ -615,7 +615,7 @@ impl_runtime_apis! {
|
||||
list_benchmarks!(list, extra);
|
||||
|
||||
let storage_info = AllPalletsWithSystem::storage_info();
|
||||
return (list, storage_info)
|
||||
(list, storage_info)
|
||||
}
|
||||
|
||||
fn dispatch_benchmark(
|
||||
@@ -653,7 +653,7 @@ impl_runtime_apis! {
|
||||
parameter_types! {
|
||||
pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some((
|
||||
DotRelayLocation::get(),
|
||||
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(DotRelayLocation::get()) },
|
||||
MultiAsset { fun: Fungible(UNITS), id: Concrete(DotRelayLocation::get()) },
|
||||
));
|
||||
pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None;
|
||||
}
|
||||
@@ -667,7 +667,7 @@ impl_runtime_apis! {
|
||||
fn get_multi_asset() -> MultiAsset {
|
||||
MultiAsset {
|
||||
id: Concrete(DotRelayLocation::get()),
|
||||
fun: Fungible(1 * UNITS),
|
||||
fun: Fungible(UNITS),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,8 +33,7 @@ const MAX_ASSETS: u64 = 100;
|
||||
impl WeighMultiAssets for MultiAssetFilter {
|
||||
fn weigh_multi_assets(&self, weight: Weight) -> Weight {
|
||||
match self {
|
||||
Self::Definite(assets) =>
|
||||
weight.saturating_mul(assets.inner().into_iter().count() as u64),
|
||||
Self::Definite(assets) => weight.saturating_mul(assets.inner().iter().count() as u64),
|
||||
Self::Wild(asset) => match asset {
|
||||
All => weight.saturating_mul(MAX_ASSETS),
|
||||
AllOf { fun, .. } => match fun {
|
||||
@@ -53,7 +52,7 @@ impl WeighMultiAssets for MultiAssetFilter {
|
||||
|
||||
impl WeighMultiAssets for MultiAssets {
|
||||
fn weigh_multi_assets(&self, weight: Weight) -> Weight {
|
||||
weight.saturating_mul(self.inner().into_iter().count() as u64)
|
||||
weight.saturating_mul(self.inner().iter().count() as u64)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +64,7 @@ impl<Call> XcmWeightInfo<Call> for BridgeHubPolkadotXcmWeight<Call> {
|
||||
// Currently there is no trusted reserve
|
||||
fn reserve_asset_deposited(_assets: &MultiAssets) -> Weight {
|
||||
// TODO: hardcoded - fix https://github.com/paritytech/cumulus/issues/1974
|
||||
Weight::from_parts(1_000_000_000 as u64, 0)
|
||||
Weight::from_parts(1_000_000_000_u64, 0)
|
||||
}
|
||||
fn receive_teleported_asset(assets: &MultiAssets) -> Weight {
|
||||
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::receive_teleported_asset())
|
||||
@@ -123,7 +122,7 @@ impl<Call> XcmWeightInfo<Call> for BridgeHubPolkadotXcmWeight<Call> {
|
||||
|
||||
fn deposit_asset(assets: &MultiAssetFilter, _dest: &MultiLocation) -> Weight {
|
||||
// Hardcoded till the XCM pallet is fixed
|
||||
let hardcoded_weight = Weight::from_parts(1_000_000_000 as u64, 0);
|
||||
let hardcoded_weight = Weight::from_parts(1_000_000_000_u64, 0);
|
||||
let weight = assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::deposit_asset());
|
||||
hardcoded_weight.min(weight)
|
||||
}
|
||||
@@ -150,7 +149,7 @@ impl<Call> XcmWeightInfo<Call> for BridgeHubPolkadotXcmWeight<Call> {
|
||||
_xcm: &Xcm<()>,
|
||||
) -> Weight {
|
||||
// Hardcoded till the XCM pallet is fixed
|
||||
let hardcoded_weight = Weight::from_parts(200_000_000 as u64, 0);
|
||||
let hardcoded_weight = Weight::from_parts(200_000_000_u64, 0);
|
||||
let weight = assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::initiate_teleport());
|
||||
hardcoded_weight.min(weight)
|
||||
}
|
||||
|
||||
@@ -132,29 +132,27 @@ impl Contains<RuntimeCall> for SafeCallFilter {
|
||||
}
|
||||
}
|
||||
|
||||
match call {
|
||||
matches!(
|
||||
call,
|
||||
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) |
|
||||
RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) |
|
||||
RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { .. } |
|
||||
pallet_collator_selection::Call::set_candidacy_bond { .. } |
|
||||
pallet_collator_selection::Call::register_as_candidate { .. } |
|
||||
pallet_collator_selection::Call::leave_intent { .. },
|
||||
) |
|
||||
RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::DmpQueue(..) |
|
||||
RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. }) => true,
|
||||
_ => false,
|
||||
}
|
||||
RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) | RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { .. } |
|
||||
pallet_collator_selection::Call::set_candidacy_bond { .. } |
|
||||
pallet_collator_selection::Call::register_as_candidate { .. } |
|
||||
pallet_collator_selection::Call::leave_intent { .. },
|
||||
) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::DmpQueue(..) |
|
||||
RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. })
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ impl pallet_balances::Config for Runtime {
|
||||
|
||||
parameter_types! {
|
||||
/// Relay Chain `TransactionByteFee` / 10
|
||||
pub const TransactionByteFee: Balance = 1 * MILLICENTS;
|
||||
pub const TransactionByteFee: Balance = MILLICENTS;
|
||||
}
|
||||
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
@@ -888,7 +888,7 @@ impl_runtime_apis! {
|
||||
list_benchmarks!(list, extra);
|
||||
|
||||
let storage_info = AllPalletsWithSystem::storage_info();
|
||||
return (list, storage_info)
|
||||
(list, storage_info)
|
||||
}
|
||||
|
||||
fn dispatch_benchmark(
|
||||
@@ -926,7 +926,7 @@ impl_runtime_apis! {
|
||||
parameter_types! {
|
||||
pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some((
|
||||
RelayLocation::get(),
|
||||
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(RelayLocation::get()) },
|
||||
MultiAsset { fun: Fungible(UNITS), id: Concrete(RelayLocation::get()) },
|
||||
));
|
||||
pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None;
|
||||
}
|
||||
@@ -940,7 +940,7 @@ impl_runtime_apis! {
|
||||
fn get_multi_asset() -> MultiAsset {
|
||||
MultiAsset {
|
||||
id: Concrete(RelayLocation::get()),
|
||||
fun: Fungible(1 * UNITS),
|
||||
fun: Fungible(UNITS),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,8 +34,7 @@ const MAX_ASSETS: u64 = 100;
|
||||
impl WeighMultiAssets for MultiAssetFilter {
|
||||
fn weigh_multi_assets(&self, weight: Weight) -> Weight {
|
||||
match self {
|
||||
Self::Definite(assets) =>
|
||||
weight.saturating_mul(assets.inner().into_iter().count() as u64),
|
||||
Self::Definite(assets) => weight.saturating_mul(assets.inner().iter().count() as u64),
|
||||
Self::Wild(asset) => match asset {
|
||||
All => weight.saturating_mul(MAX_ASSETS),
|
||||
AllOf { fun, .. } => match fun {
|
||||
@@ -54,7 +53,7 @@ impl WeighMultiAssets for MultiAssetFilter {
|
||||
|
||||
impl WeighMultiAssets for MultiAssets {
|
||||
fn weigh_multi_assets(&self, weight: Weight) -> Weight {
|
||||
weight.saturating_mul(self.inner().into_iter().count() as u64)
|
||||
weight.saturating_mul(self.inner().iter().count() as u64)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +65,7 @@ impl<Call> XcmWeightInfo<Call> for BridgeHubRococoXcmWeight<Call> {
|
||||
// Currently there is no trusted reserve
|
||||
fn reserve_asset_deposited(_assets: &MultiAssets) -> Weight {
|
||||
// TODO: hardcoded - fix https://github.com/paritytech/cumulus/issues/1974
|
||||
Weight::from_parts(1_000_000_000 as u64, 0)
|
||||
Weight::from_parts(1_000_000_000_u64, 0)
|
||||
}
|
||||
fn receive_teleported_asset(assets: &MultiAssets) -> Weight {
|
||||
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::receive_teleported_asset())
|
||||
@@ -124,7 +123,7 @@ impl<Call> XcmWeightInfo<Call> for BridgeHubRococoXcmWeight<Call> {
|
||||
|
||||
fn deposit_asset(assets: &MultiAssetFilter, _dest: &MultiLocation) -> Weight {
|
||||
// Hardcoded till the XCM pallet is fixed
|
||||
let hardcoded_weight = Weight::from_parts(1_000_000_000 as u64, 0);
|
||||
let hardcoded_weight = Weight::from_parts(1_000_000_000_u64, 0);
|
||||
let weight = assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::deposit_asset());
|
||||
hardcoded_weight.min(weight)
|
||||
}
|
||||
|
||||
+3
-3
@@ -347,11 +347,11 @@ impl<T: frame_system::Config> WeightInfo<T> {
|
||||
// Storage: BridgeWococoMessages OutboundMessages (r:0 w:1)
|
||||
// Proof: BridgeWococoMessages OutboundMessages (max_values: None, max_size: Some(2621472), added: 2623947, mode: MaxEncodedLen)
|
||||
pub(crate) fn export_message(x: u32, ) -> Weight {
|
||||
Weight::from_parts(31_677_716 as u64, 0)
|
||||
Weight::from_parts(31_677_716_u64, 0)
|
||||
// Standard Error: 4_158
|
||||
.saturating_add(Weight::from_parts(123_901, 0).saturating_mul(x as u64))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as u64))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as u64))
|
||||
.saturating_add(T::DbWeight::get().reads(3_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(2_u64))
|
||||
}
|
||||
pub fn unpaid_execution() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
|
||||
@@ -152,41 +152,35 @@ impl Contains<RuntimeCall> for SafeCallFilter {
|
||||
}
|
||||
}
|
||||
|
||||
match call {
|
||||
matches!(
|
||||
call,
|
||||
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) |
|
||||
RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) |
|
||||
RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { .. } |
|
||||
pallet_collator_selection::Call::set_candidacy_bond { .. } |
|
||||
pallet_collator_selection::Call::register_as_candidate { .. } |
|
||||
pallet_collator_selection::Call::leave_intent { .. },
|
||||
) |
|
||||
RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::DmpQueue(..) |
|
||||
RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. }) |
|
||||
RuntimeCall::BridgeRococoGrandpa(pallet_bridge_grandpa::Call::<
|
||||
Runtime,
|
||||
BridgeGrandpaRococoInstance,
|
||||
>::initialize {
|
||||
..
|
||||
}) |
|
||||
RuntimeCall::BridgeWococoGrandpa(pallet_bridge_grandpa::Call::<
|
||||
Runtime,
|
||||
BridgeGrandpaWococoInstance,
|
||||
>::initialize {
|
||||
..
|
||||
}) => true,
|
||||
_ => false,
|
||||
}
|
||||
RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) | RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { .. } |
|
||||
pallet_collator_selection::Call::set_candidacy_bond { .. } |
|
||||
pallet_collator_selection::Call::register_as_candidate { .. } |
|
||||
pallet_collator_selection::Call::leave_intent { .. },
|
||||
) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::DmpQueue(..) |
|
||||
RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. }) |
|
||||
RuntimeCall::BridgeRococoGrandpa(pallet_bridge_grandpa::Call::<
|
||||
Runtime,
|
||||
BridgeGrandpaRococoInstance,
|
||||
>::initialize { .. }) |
|
||||
RuntimeCall::BridgeWococoGrandpa(pallet_bridge_grandpa::Call::<
|
||||
Runtime,
|
||||
BridgeGrandpaWococoInstance,
|
||||
>::initialize { .. })
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ pub fn handle_export_message_from_system_parachain_to_outbound_queue_works<
|
||||
// check queue before
|
||||
assert_eq!(
|
||||
pallet_bridge_messages::OutboundLanes::<Runtime, MessagesPalletInstance>::try_get(
|
||||
&expected_lane_id
|
||||
expected_lane_id
|
||||
),
|
||||
Err(())
|
||||
);
|
||||
@@ -190,7 +190,7 @@ pub fn handle_export_message_from_system_parachain_to_outbound_queue_works<
|
||||
// check queue after
|
||||
assert_eq!(
|
||||
pallet_bridge_messages::OutboundLanes::<Runtime, MessagesPalletInstance>::try_get(
|
||||
&expected_lane_id
|
||||
expected_lane_id
|
||||
),
|
||||
Ok(OutboundLaneData {
|
||||
oldest_unpruned_nonce: 1,
|
||||
@@ -243,8 +243,8 @@ macro_rules! include_handle_export_message_from_system_parachain_to_outbound_que
|
||||
/// Test-case makes sure that Runtime can route XCM messages received in inbound queue,
|
||||
/// We just test here `MessageDispatch` configuration.
|
||||
/// We expect that runtime can route messages:
|
||||
/// 1. to Parent (relay chain)
|
||||
/// 2. to Sibling parachain
|
||||
/// 1. to Parent (relay chain)
|
||||
/// 2. to Sibling parachain
|
||||
pub fn message_dispatch_routing_works<
|
||||
Runtime,
|
||||
XcmConfig,
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ pub(crate) mod import_kusama_fellowship {
|
||||
#[cfg(feature = "try-runtime")]
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
const TARGET: &'static str = "runtime::migration::import_fellowship";
|
||||
const TARGET: &str = "runtime::migration::import_fellowship";
|
||||
|
||||
parameter_types! {
|
||||
// The Fellowship addresses from Kusama state.
|
||||
@@ -250,7 +250,7 @@ pub mod tests {
|
||||
assert!(IdToIndex::<Runtime, Fellowship>::get(0, &who).is_some());
|
||||
assert!(IdToIndex::<Runtime, Fellowship>::get(rank + 1, &who).is_none());
|
||||
let index = IdToIndex::<Runtime, Fellowship>::get(rank, &who).unwrap();
|
||||
assert_eq!(IndexToId::<Runtime, Fellowship>::get(rank, &index).unwrap(), who);
|
||||
assert_eq!(IndexToId::<Runtime, Fellowship>::get(rank, index).unwrap(), who);
|
||||
assert_eq!(
|
||||
Members::<Runtime, Fellowship>::get(&who).unwrap(),
|
||||
MemberRecord::new(rank)
|
||||
|
||||
+15
-15
@@ -54,7 +54,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
|
||||
prepare_period: 30 * MINUTES,
|
||||
decision_period: 7 * DAYS,
|
||||
confirm_period: 30 * MINUTES,
|
||||
min_enactment_period: 1 * MINUTES,
|
||||
min_enactment_period: MINUTES,
|
||||
min_approval: pallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(50),
|
||||
@@ -76,7 +76,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
|
||||
prepare_period: 30 * MINUTES,
|
||||
decision_period: 7 * DAYS,
|
||||
confirm_period: 30 * MINUTES,
|
||||
min_enactment_period: 1 * MINUTES,
|
||||
min_enactment_period: MINUTES,
|
||||
min_approval: pallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(50),
|
||||
@@ -98,7 +98,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
|
||||
prepare_period: 30 * MINUTES,
|
||||
decision_period: 7 * DAYS,
|
||||
confirm_period: 30 * MINUTES,
|
||||
min_enactment_period: 1 * MINUTES,
|
||||
min_enactment_period: MINUTES,
|
||||
min_approval: pallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(50),
|
||||
@@ -120,7 +120,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
|
||||
prepare_period: 30 * MINUTES,
|
||||
decision_period: 7 * DAYS,
|
||||
confirm_period: 30 * MINUTES,
|
||||
min_enactment_period: 1 * MINUTES,
|
||||
min_enactment_period: MINUTES,
|
||||
min_approval: pallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(50),
|
||||
@@ -142,7 +142,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
|
||||
prepare_period: 30 * MINUTES,
|
||||
decision_period: 7 * DAYS,
|
||||
confirm_period: 30 * MINUTES,
|
||||
min_enactment_period: 1 * MINUTES,
|
||||
min_enactment_period: MINUTES,
|
||||
min_approval: pallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(50),
|
||||
@@ -160,11 +160,11 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
|
||||
pallet_referenda::TrackInfo {
|
||||
name: "experts",
|
||||
max_deciding: 10,
|
||||
decision_deposit: 1 * DOLLARS,
|
||||
decision_deposit: DOLLARS,
|
||||
prepare_period: 30 * MINUTES,
|
||||
decision_period: 7 * DAYS,
|
||||
confirm_period: 30 * MINUTES,
|
||||
min_enactment_period: 1 * MINUTES,
|
||||
min_enactment_period: MINUTES,
|
||||
min_approval: pallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(50),
|
||||
@@ -182,11 +182,11 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
|
||||
pallet_referenda::TrackInfo {
|
||||
name: "senior experts",
|
||||
max_deciding: 10,
|
||||
decision_deposit: 1 * DOLLARS,
|
||||
decision_deposit: DOLLARS,
|
||||
prepare_period: 30 * MINUTES,
|
||||
decision_period: 7 * DAYS,
|
||||
confirm_period: 30 * MINUTES,
|
||||
min_enactment_period: 1 * MINUTES,
|
||||
min_enactment_period: MINUTES,
|
||||
min_approval: pallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(50),
|
||||
@@ -204,11 +204,11 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
|
||||
pallet_referenda::TrackInfo {
|
||||
name: "masters",
|
||||
max_deciding: 10,
|
||||
decision_deposit: 1 * DOLLARS,
|
||||
decision_deposit: DOLLARS,
|
||||
prepare_period: 30 * MINUTES,
|
||||
decision_period: 7 * DAYS,
|
||||
confirm_period: 30 * MINUTES,
|
||||
min_enactment_period: 1 * MINUTES,
|
||||
min_enactment_period: MINUTES,
|
||||
min_approval: pallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(50),
|
||||
@@ -226,11 +226,11 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
|
||||
pallet_referenda::TrackInfo {
|
||||
name: "senior masters",
|
||||
max_deciding: 10,
|
||||
decision_deposit: 1 * DOLLARS,
|
||||
decision_deposit: DOLLARS,
|
||||
prepare_period: 30 * MINUTES,
|
||||
decision_period: 7 * DAYS,
|
||||
confirm_period: 30 * MINUTES,
|
||||
min_enactment_period: 1 * MINUTES,
|
||||
min_enactment_period: MINUTES,
|
||||
min_approval: pallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(50),
|
||||
@@ -248,11 +248,11 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
|
||||
pallet_referenda::TrackInfo {
|
||||
name: "grand masters",
|
||||
max_deciding: 10,
|
||||
decision_deposit: 1 * DOLLARS,
|
||||
decision_deposit: DOLLARS,
|
||||
prepare_period: 30 * MINUTES,
|
||||
decision_period: 7 * DAYS,
|
||||
confirm_period: 30 * MINUTES,
|
||||
min_enactment_period: 1 * MINUTES,
|
||||
min_enactment_period: MINUTES,
|
||||
min_approval: pallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(50),
|
||||
|
||||
@@ -59,7 +59,7 @@ where
|
||||
let pallet_acc: AccountIdOf<T> = PalletAccount::get();
|
||||
let treasury_acc: AccountIdOf<T> = TreasuryAccount::get();
|
||||
|
||||
<pallet_balances::Pallet<T>>::resolve_creating(&pallet_acc.clone(), amount);
|
||||
<pallet_balances::Pallet<T>>::resolve_creating(&pallet_acc, amount);
|
||||
|
||||
let result = <pallet_xcm::Pallet<T>>::teleport_assets(
|
||||
<<T as frame_system::Config>::RuntimeOrigin>::signed(pallet_acc.into()),
|
||||
@@ -73,10 +73,9 @@ where
|
||||
0,
|
||||
);
|
||||
|
||||
match result {
|
||||
Err(err) => log::warn!("Failed to teleport slashed assets: {:?}", err),
|
||||
_ => (),
|
||||
};
|
||||
if let Err(err) = result {
|
||||
log::warn!("Failed to teleport slashed assets: {:?}", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ impl pallet_balances::Config for Runtime {
|
||||
|
||||
parameter_types! {
|
||||
/// Relay Chain `TransactionByteFee` / 10
|
||||
pub const TransactionByteFee: Balance = 1 * MILLICENTS;
|
||||
pub const TransactionByteFee: Balance = MILLICENTS;
|
||||
}
|
||||
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
@@ -843,7 +843,7 @@ impl_runtime_apis! {
|
||||
list_benchmarks!(list, extra);
|
||||
|
||||
let storage_info = AllPalletsWithSystem::storage_info();
|
||||
return (list, storage_info)
|
||||
(list, storage_info)
|
||||
}
|
||||
|
||||
fn dispatch_benchmark(
|
||||
@@ -899,7 +899,7 @@ impl cumulus_pallet_parachain_system::CheckInherents<Block> for CheckInherents {
|
||||
.create_inherent_data()
|
||||
.expect("Could not create the timestamp inherent data");
|
||||
|
||||
inherent_data.check_extrinsics(&block)
|
||||
inherent_data.check_extrinsics(block)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -137,58 +137,54 @@ impl Contains<RuntimeCall> for SafeCallFilter {
|
||||
}
|
||||
}
|
||||
|
||||
match call {
|
||||
matches!(
|
||||
call,
|
||||
RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) |
|
||||
RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { .. } |
|
||||
pallet_collator_selection::Call::set_candidacy_bond { .. } |
|
||||
pallet_collator_selection::Call::register_as_candidate { .. } |
|
||||
pallet_collator_selection::Call::leave_intent { .. },
|
||||
) |
|
||||
RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::DmpQueue(..) |
|
||||
RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. }) |
|
||||
RuntimeCall::Alliance(
|
||||
// `init_members` accepts unbounded vecs as arguments,
|
||||
// but the call can be initiated only by root origin.
|
||||
pallet_alliance::Call::init_members { .. } |
|
||||
pallet_alliance::Call::vote { .. } |
|
||||
pallet_alliance::Call::disband { .. } |
|
||||
pallet_alliance::Call::set_rule { .. } |
|
||||
pallet_alliance::Call::announce { .. } |
|
||||
pallet_alliance::Call::remove_announcement { .. } |
|
||||
pallet_alliance::Call::join_alliance { .. } |
|
||||
pallet_alliance::Call::nominate_ally { .. } |
|
||||
pallet_alliance::Call::elevate_ally { .. } |
|
||||
pallet_alliance::Call::give_retirement_notice { .. } |
|
||||
pallet_alliance::Call::retire { .. } |
|
||||
pallet_alliance::Call::kick_member { .. } |
|
||||
pallet_alliance::Call::close { .. } |
|
||||
pallet_alliance::Call::abdicate_fellow_status { .. },
|
||||
) |
|
||||
RuntimeCall::AllianceMotion(
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) | RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { .. } |
|
||||
pallet_collator_selection::Call::set_candidacy_bond { .. } |
|
||||
pallet_collator_selection::Call::register_as_candidate { .. } |
|
||||
pallet_collator_selection::Call::leave_intent { .. },
|
||||
) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::DmpQueue(..) |
|
||||
RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. }) |
|
||||
RuntimeCall::Alliance(
|
||||
// `init_members` accepts unbounded vecs as arguments,
|
||||
// but the call can be initiated only by root origin.
|
||||
pallet_alliance::Call::init_members { .. } |
|
||||
pallet_alliance::Call::vote { .. } |
|
||||
pallet_alliance::Call::disband { .. } |
|
||||
pallet_alliance::Call::set_rule { .. } |
|
||||
pallet_alliance::Call::announce { .. } |
|
||||
pallet_alliance::Call::remove_announcement { .. } |
|
||||
pallet_alliance::Call::join_alliance { .. } |
|
||||
pallet_alliance::Call::nominate_ally { .. } |
|
||||
pallet_alliance::Call::elevate_ally { .. } |
|
||||
pallet_alliance::Call::give_retirement_notice { .. } |
|
||||
pallet_alliance::Call::retire { .. } |
|
||||
pallet_alliance::Call::kick_member { .. } |
|
||||
pallet_alliance::Call::close { .. } |
|
||||
pallet_alliance::Call::abdicate_fellow_status { .. },
|
||||
) | RuntimeCall::AllianceMotion(
|
||||
pallet_collective::Call::vote { .. } |
|
||||
pallet_collective::Call::disapprove_proposal { .. } |
|
||||
pallet_collective::Call::close { .. },
|
||||
) |
|
||||
RuntimeCall::FellowshipCollective(
|
||||
pallet_collective::Call::disapprove_proposal { .. } |
|
||||
pallet_collective::Call::close { .. },
|
||||
) | RuntimeCall::FellowshipCollective(
|
||||
pallet_ranked_collective::Call::add_member { .. } |
|
||||
pallet_ranked_collective::Call::promote_member { .. } |
|
||||
pallet_ranked_collective::Call::demote_member { .. } |
|
||||
pallet_ranked_collective::Call::remove_member { .. },
|
||||
) => true,
|
||||
_ => false,
|
||||
}
|
||||
pallet_ranked_collective::Call::promote_member { .. } |
|
||||
pallet_ranked_collective::Call::demote_member { .. } |
|
||||
pallet_ranked_collective::Call::remove_member { .. },
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -639,7 +639,7 @@ impl_runtime_apis! {
|
||||
list_benchmarks!(list, extra);
|
||||
|
||||
let storage_info = AllPalletsWithSystem::storage_info();
|
||||
return (list, storage_info)
|
||||
(list, storage_info)
|
||||
}
|
||||
|
||||
fn dispatch_benchmark(
|
||||
|
||||
@@ -222,7 +222,7 @@ impl sp_runtime::traits::SignedExtension for DisallowSigned {
|
||||
info: &DispatchInfoOf<Self::Call>,
|
||||
len: usize,
|
||||
) -> Result<Self::Pre, TransactionValidityError> {
|
||||
Ok(self.validate(who, call, info, len).map(|_| ())?)
|
||||
self.validate(who, call, info, len).map(|_| ())
|
||||
}
|
||||
fn validate(
|
||||
&self,
|
||||
|
||||
@@ -783,7 +783,7 @@ impl_runtime_apis! {
|
||||
list_benchmarks!(list, extra);
|
||||
|
||||
let storage_info = AllPalletsWithSystem::storage_info();
|
||||
return (list, storage_info)
|
||||
(list, storage_info)
|
||||
}
|
||||
|
||||
fn dispatch_benchmark(
|
||||
|
||||
@@ -225,12 +225,12 @@ pub trait Reserve {
|
||||
// Takes the chain part of a MultiAsset
|
||||
impl Reserve for MultiAsset {
|
||||
fn reserve(&self) -> Option<MultiLocation> {
|
||||
if let AssetId::Concrete(location) = self.id.clone() {
|
||||
if let AssetId::Concrete(location) = self.id {
|
||||
let first_interior = location.first_interior();
|
||||
let parents = location.parent_count();
|
||||
match (parents, first_interior.clone()) {
|
||||
(0, Some(Parachain(id))) => Some(MultiLocation::new(0, X1(Parachain(id.clone())))),
|
||||
(1, Some(Parachain(id))) => Some(MultiLocation::new(1, X1(Parachain(id.clone())))),
|
||||
match (parents, first_interior) {
|
||||
(0, Some(Parachain(id))) => Some(MultiLocation::new(0, X1(Parachain(*id)))),
|
||||
(1, Some(Parachain(id))) => Some(MultiLocation::new(1, X1(Parachain(*id)))),
|
||||
(1, _) => Some(MultiLocation::parent()),
|
||||
_ => None,
|
||||
}
|
||||
|
||||
@@ -219,10 +219,10 @@ impl pallet_timestamp::Config for Runtime {
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const ExistentialDeposit: u128 = 1 * MILLIROC;
|
||||
pub const TransferFee: u128 = 1 * MILLIROC;
|
||||
pub const CreationFee: u128 = 1 * MILLIROC;
|
||||
pub const TransactionByteFee: u128 = 1 * MICROROC;
|
||||
pub const ExistentialDeposit: u128 = MILLIROC;
|
||||
pub const TransferFee: u128 = MILLIROC;
|
||||
pub const CreationFee: u128 = MILLIROC;
|
||||
pub const TransactionByteFee: u128 = MICROROC;
|
||||
}
|
||||
|
||||
impl pallet_balances::Config for Runtime {
|
||||
@@ -505,11 +505,11 @@ impl cumulus_ping::Config for Runtime {
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const AssetDeposit: Balance = 1 * ROC;
|
||||
pub const AssetAccountDeposit: Balance = 1 * ROC;
|
||||
pub const AssetDeposit: Balance = ROC;
|
||||
pub const AssetAccountDeposit: Balance = ROC;
|
||||
pub const ApprovalDeposit: Balance = 100 * MILLIROC;
|
||||
pub const AssetsStringLimit: u32 = 50;
|
||||
pub const MetadataDepositBase: Balance = 1 * ROC;
|
||||
pub const MetadataDepositBase: Balance = ROC;
|
||||
pub const MetadataDepositPerByte: Balance = 10 * MILLIROC;
|
||||
pub const UnitBody: BodyId = BodyId::Unit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user