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:
DoordashconandOliver Tale-Yazdi authored and GitHub committed 2022-08-18 09:30:46 +00:00
1 parent 511e5c9651
commit d46f6f0d34
50 files changed
+465 -309

No files matched your search

+3 -2
View File
@@ -93,6 +93,7 @@ pub type PositiveImbalanceOf<T, I = ()> = <<T as Config<I>>::Currency as Currenc
pub type NegativeImbalanceOf<T, I = ()> = <<T as Config<I>>::Currency as Currency<
<T as frame_system::Config>::AccountId,
>>::NegativeImbalance;
type AccountIdLookupOf<T> = <<T as frame_system::Config>::Lookup as StaticLookup>::Source;
/// A trait to allow the Treasury Pallet to spend it's funds for other purposes.
/// There is an expectation that the implementer of this trait will correctly manage
@@ -338,7 +339,7 @@ pub mod pallet {
pub fn propose_spend(
origin: OriginFor<T>,
#[pallet::compact] value: BalanceOf<T, I>,
beneficiary: <T::Lookup as StaticLookup>::Source,
beneficiary: AccountIdLookupOf<T>,
) -> DispatchResult {
let proposer = ensure_signed(origin)?;
let beneficiary = T::Lookup::lookup(beneficiary)?;
@@ -419,7 +420,7 @@ pub mod pallet {
pub fn spend(
origin: OriginFor<T>,
#[pallet::compact] amount: BalanceOf<T, I>,
beneficiary: <T::Lookup as StaticLookup>::Source,
beneficiary: AccountIdLookupOf<T>,
) -> DispatchResult {
let max_amount = T::SpendOrigin::ensure_origin(origin)?;
let beneficiary = T::Lookup::lookup(beneficiary)?;