mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 03:31:05 +00:00
Companion for paritytech/polkadot#7098 (#2469)
* Companion for paritytech/polkadot#7098 * Fixes * Add missing benchmarked function * Fix typo * update lockfile for {"polkadot", "substrate"} --------- Co-authored-by: parity-processbot <>
This commit is contained in:
Generated
+257
-257
File diff suppressed because it is too large
Load Diff
@@ -5,20 +5,20 @@ use super::{
|
|||||||
use core::{marker::PhantomData, ops::ControlFlow};
|
use core::{marker::PhantomData, ops::ControlFlow};
|
||||||
use frame_support::{
|
use frame_support::{
|
||||||
log, match_types, parameter_types,
|
log, match_types, parameter_types,
|
||||||
traits::{ConstU32, Everything, Nothing},
|
traits::{ConstU32, Everything, Nothing, ProcessMessageError},
|
||||||
weights::Weight,
|
weights::Weight,
|
||||||
};
|
};
|
||||||
use frame_system::EnsureRoot;
|
use frame_system::EnsureRoot;
|
||||||
use pallet_xcm::XcmPassthrough;
|
use pallet_xcm::XcmPassthrough;
|
||||||
use polkadot_parachain::primitives::Sibling;
|
use polkadot_parachain::primitives::Sibling;
|
||||||
use polkadot_runtime_common::impls::ToAuthor;
|
use polkadot_runtime_common::impls::ToAuthor;
|
||||||
use xcm::{latest::prelude::*, CreateMatcher, MatchXcm};
|
use xcm::latest::prelude::*;
|
||||||
use xcm_builder::{
|
use xcm_builder::{
|
||||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom,
|
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom,
|
||||||
CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds, IsConcrete, NativeAsset, ParentIsPreset,
|
CreateMatcher, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds, IsConcrete, MatchXcm,
|
||||||
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
NativeAsset, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
|
||||||
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
|
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
|
||||||
UsingComponents, WithComputedOrigin,
|
SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WithComputedOrigin,
|
||||||
};
|
};
|
||||||
use xcm_executor::{traits::ShouldExecute, XcmExecutor};
|
use xcm_executor::{traits::ShouldExecute, XcmExecutor};
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ where
|
|||||||
message: &mut [Instruction<RuntimeCall>],
|
message: &mut [Instruction<RuntimeCall>],
|
||||||
max_weight: Weight,
|
max_weight: Weight,
|
||||||
weight_credit: &mut Weight,
|
weight_credit: &mut Weight,
|
||||||
) -> Result<(), ()> {
|
) -> Result<(), ProcessMessageError> {
|
||||||
Deny::should_execute(origin, message, max_weight, weight_credit)?;
|
Deny::should_execute(origin, message, max_weight, weight_credit)?;
|
||||||
Allow::should_execute(origin, message, max_weight, weight_credit)
|
Allow::should_execute(origin, message, max_weight, weight_credit)
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
|
|||||||
message: &mut [Instruction<RuntimeCall>],
|
message: &mut [Instruction<RuntimeCall>],
|
||||||
_max_weight: Weight,
|
_max_weight: Weight,
|
||||||
_weight_credit: &mut Weight,
|
_weight_credit: &mut Weight,
|
||||||
) -> Result<(), ()> {
|
) -> Result<(), ProcessMessageError> {
|
||||||
message.matcher().match_next_inst_while(
|
message.matcher().match_next_inst_while(
|
||||||
|_| true,
|
|_| true,
|
||||||
|inst| match inst {
|
|inst| match inst {
|
||||||
@@ -136,7 +136,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
|
|||||||
TransferReserveAsset {
|
TransferReserveAsset {
|
||||||
dest: MultiLocation { parents: 1, interior: Here }, ..
|
dest: MultiLocation { parents: 1, interior: Here }, ..
|
||||||
} => {
|
} => {
|
||||||
Err(()) // Deny
|
Err(ProcessMessageError::Unsupported) // Deny
|
||||||
},
|
},
|
||||||
// An unexpected reserve transfer has arrived from the Relay Chain. Generally,
|
// An unexpected reserve transfer has arrived from the Relay Chain. Generally,
|
||||||
// `IsReserve` should not allow this, but we just log it here.
|
// `IsReserve` should not allow this, but we just log it here.
|
||||||
|
|||||||
@@ -2,11 +2,14 @@ use crate::impls::AccountIdOf;
|
|||||||
use core::{marker::PhantomData, ops::ControlFlow};
|
use core::{marker::PhantomData, ops::ControlFlow};
|
||||||
use frame_support::{
|
use frame_support::{
|
||||||
log,
|
log,
|
||||||
traits::{fungibles::Inspect, tokens::ConversionToAssetBalance, ContainsPair},
|
traits::{
|
||||||
|
fungibles::Inspect, tokens::ConversionToAssetBalance, ContainsPair, ProcessMessageError,
|
||||||
|
},
|
||||||
weights::Weight,
|
weights::Weight,
|
||||||
};
|
};
|
||||||
use sp_runtime::traits::Get;
|
use sp_runtime::traits::Get;
|
||||||
use xcm::{latest::prelude::*, CreateMatcher, MatchXcm};
|
use xcm::latest::prelude::*;
|
||||||
|
use xcm_builder::{CreateMatcher, MatchXcm};
|
||||||
use xcm_executor::traits::ShouldExecute;
|
use xcm_executor::traits::ShouldExecute;
|
||||||
|
|
||||||
//TODO: move DenyThenTry to polkadot's xcm module.
|
//TODO: move DenyThenTry to polkadot's xcm module.
|
||||||
@@ -27,7 +30,7 @@ where
|
|||||||
message: &mut [Instruction<RuntimeCall>],
|
message: &mut [Instruction<RuntimeCall>],
|
||||||
max_weight: Weight,
|
max_weight: Weight,
|
||||||
weight_credit: &mut Weight,
|
weight_credit: &mut Weight,
|
||||||
) -> Result<(), ()> {
|
) -> Result<(), ProcessMessageError> {
|
||||||
Deny::should_execute(origin, message, max_weight, weight_credit)?;
|
Deny::should_execute(origin, message, max_weight, weight_credit)?;
|
||||||
Allow::should_execute(origin, message, max_weight, weight_credit)
|
Allow::should_execute(origin, message, max_weight, weight_credit)
|
||||||
}
|
}
|
||||||
@@ -41,7 +44,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
|
|||||||
message: &mut [Instruction<RuntimeCall>],
|
message: &mut [Instruction<RuntimeCall>],
|
||||||
_max_weight: Weight,
|
_max_weight: Weight,
|
||||||
_weight_credit: &mut Weight,
|
_weight_credit: &mut Weight,
|
||||||
) -> Result<(), ()> {
|
) -> Result<(), ProcessMessageError> {
|
||||||
message.matcher().match_next_inst_while(
|
message.matcher().match_next_inst_while(
|
||||||
|_| true,
|
|_| true,
|
||||||
|inst| match inst {
|
|inst| match inst {
|
||||||
@@ -55,7 +58,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
|
|||||||
TransferReserveAsset {
|
TransferReserveAsset {
|
||||||
dest: MultiLocation { parents: 1, interior: Here }, ..
|
dest: MultiLocation { parents: 1, interior: Here }, ..
|
||||||
} => {
|
} => {
|
||||||
Err(()) // Deny
|
Err(ProcessMessageError::Unsupported) // Deny
|
||||||
},
|
},
|
||||||
|
|
||||||
// An unexpected reserve transfer has arrived from the Relay Chain. Generally,
|
// An unexpected reserve transfer has arrived from the Relay Chain. Generally,
|
||||||
|
|||||||
@@ -171,6 +171,15 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
|||||||
.saturating_add(T::DbWeight::get().reads(6))
|
.saturating_add(T::DbWeight::get().reads(6))
|
||||||
.saturating_add(T::DbWeight::get().writes(4))
|
.saturating_add(T::DbWeight::get().writes(4))
|
||||||
}
|
}
|
||||||
|
fn force_suspension() -> Weight {
|
||||||
|
// Proof Size summary in bytes:
|
||||||
|
// Measured: `0`
|
||||||
|
// Estimated: `0`
|
||||||
|
// Minimum execution time: 3_092_000 picoseconds.
|
||||||
|
Weight::from_parts(3_217_000, 0)
|
||||||
|
.saturating_add(Weight::from_parts(0, 0))
|
||||||
|
.saturating_add(T::DbWeight::get().writes(1))
|
||||||
|
}
|
||||||
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
|
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
|
||||||
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
|
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
|
||||||
fn migrate_supported_version() -> Weight {
|
fn migrate_supported_version() -> Weight {
|
||||||
|
|||||||
@@ -171,6 +171,15 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
|||||||
.saturating_add(T::DbWeight::get().reads(6))
|
.saturating_add(T::DbWeight::get().reads(6))
|
||||||
.saturating_add(T::DbWeight::get().writes(4))
|
.saturating_add(T::DbWeight::get().writes(4))
|
||||||
}
|
}
|
||||||
|
fn force_suspension() -> Weight {
|
||||||
|
// Proof Size summary in bytes:
|
||||||
|
// Measured: `0`
|
||||||
|
// Estimated: `0`
|
||||||
|
// Minimum execution time: 3_451_000 picoseconds.
|
||||||
|
Weight::from_parts(3_580_000, 0)
|
||||||
|
.saturating_add(Weight::from_parts(0, 0))
|
||||||
|
.saturating_add(T::DbWeight::get().writes(1))
|
||||||
|
}
|
||||||
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
|
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
|
||||||
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
|
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
|
||||||
fn migrate_supported_version() -> Weight {
|
fn migrate_supported_version() -> Weight {
|
||||||
|
|||||||
@@ -169,6 +169,15 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
|||||||
.saturating_add(T::DbWeight::get().reads(6))
|
.saturating_add(T::DbWeight::get().reads(6))
|
||||||
.saturating_add(T::DbWeight::get().writes(4))
|
.saturating_add(T::DbWeight::get().writes(4))
|
||||||
}
|
}
|
||||||
|
fn force_suspension() -> Weight {
|
||||||
|
// Proof Size summary in bytes:
|
||||||
|
// Measured: `0`
|
||||||
|
// Estimated: `0`
|
||||||
|
// Minimum execution time: 3_144_000 picoseconds.
|
||||||
|
Weight::from_parts(3_225_000, 0)
|
||||||
|
.saturating_add(Weight::from_parts(0, 0))
|
||||||
|
.saturating_add(T::DbWeight::get().writes(1))
|
||||||
|
}
|
||||||
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
|
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
|
||||||
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
|
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
|
||||||
fn migrate_supported_version() -> Weight {
|
fn migrate_supported_version() -> Weight {
|
||||||
|
|||||||
@@ -170,6 +170,15 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
|||||||
.saturating_add(T::DbWeight::get().reads(6))
|
.saturating_add(T::DbWeight::get().reads(6))
|
||||||
.saturating_add(T::DbWeight::get().writes(4))
|
.saturating_add(T::DbWeight::get().writes(4))
|
||||||
}
|
}
|
||||||
|
fn force_suspension() -> Weight {
|
||||||
|
// Proof Size summary in bytes:
|
||||||
|
// Measured: `0`
|
||||||
|
// Estimated: `0`
|
||||||
|
// Minimum execution time: 3_073_000 picoseconds.
|
||||||
|
Weight::from_parts(3_178_000, 0)
|
||||||
|
.saturating_add(Weight::from_parts(0, 0))
|
||||||
|
.saturating_add(T::DbWeight::get().writes(1))
|
||||||
|
}
|
||||||
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
|
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
|
||||||
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
|
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
|
||||||
fn migrate_supported_version() -> Weight {
|
fn migrate_supported_version() -> Weight {
|
||||||
|
|||||||
@@ -170,6 +170,15 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
|||||||
.saturating_add(T::DbWeight::get().reads(6))
|
.saturating_add(T::DbWeight::get().reads(6))
|
||||||
.saturating_add(T::DbWeight::get().writes(4))
|
.saturating_add(T::DbWeight::get().writes(4))
|
||||||
}
|
}
|
||||||
|
fn force_suspension() -> Weight {
|
||||||
|
// Proof Size summary in bytes:
|
||||||
|
// Measured: `0`
|
||||||
|
// Estimated: `0`
|
||||||
|
// Minimum execution time: 2_994_000 picoseconds.
|
||||||
|
Weight::from_parts(3_160_000, 0)
|
||||||
|
.saturating_add(Weight::from_parts(0, 0))
|
||||||
|
.saturating_add(T::DbWeight::get().writes(1))
|
||||||
|
}
|
||||||
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
|
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
|
||||||
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
|
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
|
||||||
fn migrate_supported_version() -> Weight {
|
fn migrate_supported_version() -> Weight {
|
||||||
|
|||||||
@@ -170,6 +170,15 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
|||||||
.saturating_add(T::DbWeight::get().reads(6))
|
.saturating_add(T::DbWeight::get().reads(6))
|
||||||
.saturating_add(T::DbWeight::get().writes(4))
|
.saturating_add(T::DbWeight::get().writes(4))
|
||||||
}
|
}
|
||||||
|
fn force_suspension() -> Weight {
|
||||||
|
// Proof Size summary in bytes:
|
||||||
|
// Measured: `0`
|
||||||
|
// Estimated: `0`
|
||||||
|
// Minimum execution time: 3_218_000 picoseconds.
|
||||||
|
Weight::from_parts(3_311_000, 0)
|
||||||
|
.saturating_add(Weight::from_parts(0, 0))
|
||||||
|
.saturating_add(T::DbWeight::get().writes(1))
|
||||||
|
}
|
||||||
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
|
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
|
||||||
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
|
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
|
||||||
fn migrate_supported_version() -> Weight {
|
fn migrate_supported_version() -> Weight {
|
||||||
|
|||||||
@@ -170,6 +170,15 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
|
|||||||
.saturating_add(T::DbWeight::get().reads(6))
|
.saturating_add(T::DbWeight::get().reads(6))
|
||||||
.saturating_add(T::DbWeight::get().writes(4))
|
.saturating_add(T::DbWeight::get().writes(4))
|
||||||
}
|
}
|
||||||
|
fn force_suspension() -> Weight {
|
||||||
|
// Proof Size summary in bytes:
|
||||||
|
// Measured: `0`
|
||||||
|
// Estimated: `0`
|
||||||
|
// Minimum execution time: 2_994_000 picoseconds.
|
||||||
|
Weight::from_parts(3_125_000, 0)
|
||||||
|
.saturating_add(Weight::from_parts(0, 0))
|
||||||
|
.saturating_add(T::DbWeight::get().writes(1))
|
||||||
|
}
|
||||||
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
|
/// Storage: PolkadotXcm SupportedVersion (r:4 w:2)
|
||||||
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
|
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
|
||||||
fn migrate_supported_version() -> Weight {
|
fn migrate_supported_version() -> Weight {
|
||||||
|
|||||||
Reference in New Issue
Block a user