mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-16 17:51:10 +00:00
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:
@@ -173,5 +173,20 @@ benchmarks_instance_pallet! {
|
||||
assert_eq!(Voting::<T, I>::iter().count(), 0);
|
||||
}
|
||||
|
||||
exchange_member {
|
||||
let who = make_member::<T, I>(1);
|
||||
let who_lookup = T::Lookup::unlookup(who.clone());
|
||||
let new_who = account::<T::AccountId>("new-member", 0, SEED);
|
||||
let new_who_lookup = T::Lookup::unlookup(new_who.clone());
|
||||
let origin =
|
||||
T::ExchangeOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
|
||||
let call = Call::<T, I>::exchange_member { who: who_lookup, new_who:new_who_lookup};
|
||||
}: { call.dispatch_bypass_filter(origin)? }
|
||||
verify {
|
||||
assert_eq!(Members::<T, I>::get(&new_who).unwrap().rank, 1);
|
||||
assert_eq!(Members::<T, I>::get(&who), None);
|
||||
assert_last_event::<T, I>(Event::MemberExchanged { who, new_who }.into());
|
||||
}
|
||||
|
||||
impl_benchmark_test_suite!(RankedCollective, crate::tests::new_test_ext(), crate::tests::Test);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user