mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 11:41:02 +00:00
Runtime: Success value and reachable location for Polkadot Collectives benchmarks (#2784)
* Runtime: Success value and reachable location for Polkadot Collectives benchmarks * separate promote origin for benches * pay with ensure
This commit is contained in:
@@ -42,6 +42,9 @@ use sp_runtime::traits::{AccountIdConversion, ConstU16, ConvertToValue, Replace,
|
||||
use xcm::latest::BodyId;
|
||||
use xcm_builder::{AliasesIntoAccountId32, LocatableAssetId, PayOverXcm};
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
use crate::impls::benchmarks::{OpenHrmpChannel, PayWithEnsure};
|
||||
|
||||
/// The Fellowship members' ranks.
|
||||
pub mod ranks {
|
||||
use pallet_ranked_collective::Rank;
|
||||
@@ -105,13 +108,21 @@ pub type FellowshipCollectiveInstance = pallet_ranked_collective::Instance1;
|
||||
impl pallet_ranked_collective::Config<FellowshipCollectiveInstance> for Runtime {
|
||||
type WeightInfo = weights::pallet_ranked_collective::WeightInfo<Runtime>;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
|
||||
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||
// Promotions and the induction of new members are serviced by `FellowshipCore` pallet instance.
|
||||
type PromoteOrigin = EnsureRootWithSuccess<Self::AccountId, ConstU16<{ ranks::DAN_9 }>>;
|
||||
type PromoteOrigin = frame_system::EnsureNever<pallet_ranked_collective::Rank>;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
// The maximum value of `u16` set as a success value for the root to ensure the benchmarks will pass.
|
||||
type PromoteOrigin = EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>;
|
||||
|
||||
// Demotion is by any of:
|
||||
// - Root can demote arbitrarily.
|
||||
// - the FellowshipAdmin origin (i.e. token holder referendum);
|
||||
//
|
||||
// The maximum value of `u16` set as a success value for the root to ensure the benchmarks will pass.
|
||||
type DemoteOrigin = EitherOf<
|
||||
EnsureRootWithSuccess<Self::AccountId, ConstU16<{ ranks::DAN_9 }>>,
|
||||
EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>,
|
||||
MapSuccess<
|
||||
EnsureXcm<IsVoiceOfBody<GovernanceLocation, FellowshipAdminBodyId>>,
|
||||
Replace<ConstU16<{ ranks::DAN_9 }>>,
|
||||
@@ -211,7 +222,11 @@ pub type FellowshipSalaryPaymaster = PayOverXcm<
|
||||
impl pallet_salary::Config<FellowshipSalaryInstance> for Runtime {
|
||||
type WeightInfo = weights::pallet_salary::WeightInfo<Runtime>;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
|
||||
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||
type Paymaster = FellowshipSalaryPaymaster;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type Paymaster = PayWithEnsure<FellowshipSalaryPaymaster, OpenHrmpChannel<ConstU32<1000>>>;
|
||||
type Members = pallet_ranked_collective::Pallet<Runtime, FellowshipCollectiveInstance>;
|
||||
|
||||
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||
|
||||
Reference in New Issue
Block a user