exchange member with a new account and same rank in the ranked collec… (#2587)

closes https://github.com/polkadot-fellows/help-center/issues/1

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
dharjeezy
2024-01-30 20:12:51 +01:00
committed by GitHub
parent e5bb11b008
commit 5eb4773d13
12 changed files with 243 additions and 55 deletions
@@ -34,6 +34,7 @@ mod tracks;
use super::*;
use crate::xcm_config::{FellowshipAdminBodyId, LocationToAccountId, WndAssetHub};
use frame_support::traits::{EitherOf, MapSuccess, TryMapSuccess};
use frame_system::EnsureRootWithSuccess;
pub use origins::pallet_origins as pallet_ambassador_origins;
use origins::pallet_origins::{
EnsureAmbassadorsVoice, EnsureAmbassadorsVoiceFrom, EnsureHeadAmbassadorsVoice, Origin,
@@ -99,11 +100,17 @@ pub type PromoteOrigin = EitherOf<
>,
>;
/// Exchange is by any of:
/// - Root can exchange arbitrarily.
/// - the Fellows origin
pub type ExchangeOrigin = EitherOf<EnsureRootWithSuccess<AccountId, ConstU16<65535>>, Fellows>;
impl pallet_ranked_collective::Config<AmbassadorCollectiveInstance> for Runtime {
type WeightInfo = weights::pallet_ranked_collective_ambassador_collective::WeightInfo<Runtime>;
type RuntimeEvent = RuntimeEvent;
type PromoteOrigin = PromoteOrigin;
type DemoteOrigin = DemoteOrigin;
type ExchangeOrigin = ExchangeOrigin;
type Polls = AmbassadorReferenda;
type MinRankOfClass = sp_runtime::traits::Identity;
type VoteWeight = pallet_ranked_collective::Linear;
@@ -136,6 +136,11 @@ impl pallet_ranked_collective::Config<FellowshipCollectiveInstance> for Runtime
Replace<ConstU16<{ ranks::DAN_9 }>>,
>,
>;
// Exchange is by any of:
// - Root can exchange arbitrarily.
// - the Fellows origin
type ExchangeOrigin =
EitherOf<EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>, Fellows>;
type Polls = FellowshipReferenda;
type MinRankOfClass = tracks::MinRankOfClass;
type VoteWeight = pallet_ranked_collective::Geometric;
@@ -174,4 +174,7 @@ impl<T: frame_system::Config> pallet_ranked_collective::WeightInfo for WeightInf
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into())))
.saturating_add(Weight::from_parts(0, 2550).saturating_mul(n.into()))
}
fn exchange_member() -> Weight {
todo!()
}
}
@@ -173,4 +173,7 @@ impl<T: frame_system::Config> pallet_ranked_collective::WeightInfo for WeightInf
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into())))
.saturating_add(Weight::from_parts(0, 2550).saturating_mul(n.into()))
}
fn exchange_member() -> Weight {
todo!()
}
}