mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-01 03:21:02 +00:00
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:
@@ -210,6 +210,8 @@ pub enum UnscrupulousItem<AccountId, Url> {
|
||||
type UnscrupulousItemOf<T, I> =
|
||||
UnscrupulousItem<<T as frame_system::Config>::AccountId, UrlOf<T, I>>;
|
||||
|
||||
type AccountIdLookupOf<T> = <<T as frame_system::Config>::Lookup as StaticLookup>::Source;
|
||||
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
@@ -744,10 +746,7 @@ pub mod pallet {
|
||||
/// A founder or fellow can nominate someone to join the alliance as an Ally.
|
||||
/// There is no deposit required to the nominator or nominee.
|
||||
#[pallet::weight(T::WeightInfo::nominate_ally())]
|
||||
pub fn nominate_ally(
|
||||
origin: OriginFor<T>,
|
||||
who: <T::Lookup as StaticLookup>::Source,
|
||||
) -> DispatchResult {
|
||||
pub fn nominate_ally(origin: OriginFor<T>, who: AccountIdLookupOf<T>) -> DispatchResult {
|
||||
let nominator = ensure_signed(origin)?;
|
||||
ensure!(Self::has_voting_rights(&nominator), Error::<T, I>::NoVotingRights);
|
||||
let who = T::Lookup::lookup(who)?;
|
||||
@@ -771,10 +770,7 @@ pub mod pallet {
|
||||
|
||||
/// Elevate an ally to fellow.
|
||||
#[pallet::weight(T::WeightInfo::elevate_ally())]
|
||||
pub fn elevate_ally(
|
||||
origin: OriginFor<T>,
|
||||
ally: <T::Lookup as StaticLookup>::Source,
|
||||
) -> DispatchResult {
|
||||
pub fn elevate_ally(origin: OriginFor<T>, ally: AccountIdLookupOf<T>) -> DispatchResult {
|
||||
T::MembershipManager::ensure_origin(origin)?;
|
||||
let ally = T::Lookup::lookup(ally)?;
|
||||
ensure!(Self::is_ally(&ally), Error::<T, I>::NotAlly);
|
||||
@@ -807,10 +803,7 @@ pub mod pallet {
|
||||
|
||||
/// Kick a member from the alliance and slash its deposit.
|
||||
#[pallet::weight(T::WeightInfo::kick_member())]
|
||||
pub fn kick_member(
|
||||
origin: OriginFor<T>,
|
||||
who: <T::Lookup as StaticLookup>::Source,
|
||||
) -> DispatchResult {
|
||||
pub fn kick_member(origin: OriginFor<T>, who: AccountIdLookupOf<T>) -> DispatchResult {
|
||||
T::MembershipManager::ensure_origin(origin)?;
|
||||
let member = T::Lookup::lookup(who)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user