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
+4 -2
View File
@@ -104,6 +104,8 @@ mod tests;
pub use pallet::*;
type AccountIdLookupOf<T> = <<T as frame_system::Config>::Lookup as StaticLookup>::Source;
#[frame_support::pallet]
pub mod pallet {
use super::{DispatchResult, *};
@@ -192,7 +194,7 @@ pub mod pallet {
#[pallet::weight(0)]
pub fn set_key(
origin: OriginFor<T>,
new: <T::Lookup as StaticLookup>::Source,
new: AccountIdLookupOf<T>,
) -> DispatchResultWithPostInfo {
// This is a public call, so we ensure that the origin is some signed account.
let sender = ensure_signed(origin)?;
@@ -228,7 +230,7 @@ pub mod pallet {
})]
pub fn sudo_as(
origin: OriginFor<T>,
who: <T::Lookup as StaticLookup>::Source,
who: AccountIdLookupOf<T>,
call: Box<<T as Config>::Call>,
) -> DispatchResultWithPostInfo {
// This is a public call, so we ensure that the origin is some signed account.