Replace T::AccountId with <T::Lookup as StaticLookup>::Source (#11670)

* initial

* update

* update

* update

* cargo fmt

* update

* update benchmarks

* AccountIdLookupOf<T>

* cargo fmt

* fix conflits

* cargo fmt

* update

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Doordashcon
2022-08-18 10:30:46 +01:00
committed by GitHub
parent 511e5c9651
commit d46f6f0d34
50 changed files with 465 additions and 309 deletions
@@ -29,8 +29,6 @@ use crate::Pallet as Elections;
const BALANCE_FACTOR: u32 = 250;
type Lookup<T> = <<T as frame_system::Config>::Lookup as StaticLookup>::Source;
/// grab new account with infinite balance.
fn endowed_account<T: Config>(name: &'static str, index: u32) -> T::AccountId {
let account: T::AccountId = account(name, index, 0);
@@ -46,7 +44,7 @@ fn endowed_account<T: Config>(name: &'static str, index: u32) -> T::AccountId {
}
/// Account to lookup type of system trait.
fn as_lookup<T: Config>(account: T::AccountId) -> Lookup<T> {
fn as_lookup<T: Config>(account: T::AccountId) -> AccountIdLookupOf<T> {
T::Lookup::unlookup(account)
}
@@ -176,6 +176,8 @@ pub struct SeatHolder<AccountId, Balance> {
pub use pallet::*;
type AccountIdLookupOf<T> = <<T as frame_system::Config>::Lookup as StaticLookup>::Source;
#[frame_support::pallet]
pub mod pallet {
use super::*;
@@ -508,7 +510,7 @@ pub mod pallet {
})]
pub fn remove_member(
origin: OriginFor<T>,
who: <T::Lookup as StaticLookup>::Source,
who: AccountIdLookupOf<T>,
slash_bond: bool,
rerun_election: bool,
) -> DispatchResultWithPostInfo {