Skip to content

Upgrade polkadot-v0.9.38 #886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix runtime-benchmarks
  • Loading branch information
tgmichel committed Feb 27, 2023
commit dd6cb579dade4a115daa02106a92178d69542f6f
9 changes: 8 additions & 1 deletion asset-registry/src/mock/para.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl EnsureOriginWithArg<RuntimeOrigin, Option<u32>> for AssetAuthority {
}

#[cfg(feature = "runtime-benchmarks")]
fn successful_origin(_asset_id: &Option<u32>) -> RuntimeOrigin {
fn try_successful_origin(_asset_id: &Option<u32>) -> Result<RuntimeOrigin, ()> {
unimplemented!()
}
}
Expand Down Expand Up @@ -289,6 +289,11 @@ parameter_types! {
pub const MaxAssetsForTransfer: usize = 3;
}

#[cfg(feature = "runtime-benchmarks")]
parameter_types! {
pub ReachableDest: Option<MultiLocation> = Some(Parent.into());
}

impl pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
Expand All @@ -310,6 +315,8 @@ impl pallet_xcm::Config for Runtime {
type SovereignAccountOf = ();
type MaxLockers = ConstU32<8>;
type WeightInfo = pallet_xcm::TestWeightInfo;
#[cfg(feature = "runtime-benchmarks")]
type ReachableDest = ReachableDest;
}

pub struct AccountIdToMultiLocation;
Expand Down
7 changes: 7 additions & 0 deletions asset-registry/src/mock/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ parameter_types! {
pub SelfLocation: MultiLocation = MultiLocation::here();
}

#[cfg(feature = "runtime-benchmarks")]
parameter_types! {
pub ReachableDest: Option<MultiLocation> = Some(MultiLocation::here());
}

impl pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
Expand All @@ -149,6 +154,8 @@ impl pallet_xcm::Config for Runtime {
type SovereignAccountOf = ();
type MaxLockers = ConstU32<8>;
type WeightInfo = pallet_xcm::TestWeightInfo;
#[cfg(feature = "runtime-benchmarks")]
type ReachableDest = ReachableDest;
}

impl ump::Config for Runtime {
Expand Down
2 changes: 1 addition & 1 deletion authority/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl<
}

#[cfg(feature = "runtime-benchmarks")]
fn successful_origin() -> O {
fn try_successful_origin() -> Result<O, ()> {
unimplemented!()
}
}
Expand Down
4 changes: 2 additions & 2 deletions vesting/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ impl EnsureOrigin<RuntimeOrigin> for EnsureAliceOrBob {
}

#[cfg(feature = "runtime-benchmarks")]
fn successful_origin() -> RuntimeOrigin {
fn try_successful_origin() -> Result<RuntimeOrigin, ()> {
let zero_account_id = AccountId::decode(&mut sp_runtime::traits::TrailingZeroInput::zeroes())
.expect("infinite length input; no invalid inputs for type; qed");
RuntimeOrigin::from(RawOrigin::Signed(zero_account_id))
Ok(RuntimeOrigin::from(RawOrigin::Signed(zero_account_id)))
}
}

Expand Down
7 changes: 7 additions & 0 deletions xtokens/src/mock/para.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ impl cumulus_pallet_xcm::Config for Runtime {

pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>;

#[cfg(feature = "runtime-benchmarks")]
parameter_types! {
pub ReachableDest: Option<MultiLocation> = Some(Parent.into());
}

impl pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
Expand All @@ -223,6 +228,8 @@ impl pallet_xcm::Config for Runtime {
type SovereignAccountOf = ();
type MaxLockers = ConstU32<8>;
type WeightInfo = pallet_xcm::TestWeightInfo;
#[cfg(feature = "runtime-benchmarks")]
type ReachableDest = ReachableDest;
}

pub struct AccountIdToMultiLocation;
Expand Down
7 changes: 7 additions & 0 deletions xtokens/src/mock/para_relative_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ impl cumulus_pallet_xcm::Config for Runtime {

pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>;

#[cfg(feature = "runtime-benchmarks")]
parameter_types! {
pub ReachableDest: Option<MultiLocation> = Some(Parent.into());
}

impl pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
Expand All @@ -226,6 +231,8 @@ impl pallet_xcm::Config for Runtime {
type SovereignAccountOf = ();
type MaxLockers = ConstU32<8>;
type WeightInfo = pallet_xcm::TestWeightInfo;
#[cfg(feature = "runtime-benchmarks")]
type ReachableDest = ReachableDest;
}

pub struct AccountIdToMultiLocation;
Expand Down
7 changes: 7 additions & 0 deletions xtokens/src/mock/para_teleport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ impl cumulus_pallet_xcm::Config for Runtime {

pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>;

#[cfg(feature = "runtime-benchmarks")]
parameter_types! {
pub ReachableDest: Option<MultiLocation> = Some(Parent.into());
}

impl pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
Expand All @@ -224,6 +229,8 @@ impl pallet_xcm::Config for Runtime {
type SovereignAccountOf = ();
type MaxLockers = ConstU32<8>;
type WeightInfo = pallet_xcm::TestWeightInfo;
#[cfg(feature = "runtime-benchmarks")]
type ReachableDest = ReachableDest;
}

pub struct AccountIdToMultiLocation;
Expand Down
7 changes: 7 additions & 0 deletions xtokens/src/mock/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ impl Config for XcmConfig {

pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, KusamaNetwork>;

#[cfg(feature = "runtime-benchmarks")]
parameter_types! {
pub ReachableDest: Option<MultiLocation> = Some(Parent.into());
}

impl pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
Expand All @@ -155,6 +160,8 @@ impl pallet_xcm::Config for Runtime {
type SovereignAccountOf = ();
type MaxLockers = ConstU32<8>;
type WeightInfo = pallet_xcm::TestWeightInfo;
#[cfg(feature = "runtime-benchmarks")]
type ReachableDest = ReachableDest;
}

impl ump::Config for Runtime {
Expand Down