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
+5 -6
View File
@@ -37,7 +37,7 @@ use crate::Pallet as Uniques;
const SEED: u32 = 0;
fn create_collection<T: Config<I>, I: 'static>(
) -> (T::CollectionId, T::AccountId, <T::Lookup as StaticLookup>::Source) {
) -> (T::CollectionId, T::AccountId, AccountIdLookupOf<T>) {
let caller: T::AccountId = whitelisted_caller();
let caller_lookup = T::Lookup::unlookup(caller.clone());
let collection = T::Helper::collection(0);
@@ -49,8 +49,7 @@ fn create_collection<T: Config<I>, I: 'static>(
(collection, caller, caller_lookup)
}
fn add_collection_metadata<T: Config<I>, I: 'static>(
) -> (T::AccountId, <T::Lookup as StaticLookup>::Source) {
fn add_collection_metadata<T: Config<I>, I: 'static>() -> (T::AccountId, AccountIdLookupOf<T>) {
let caller = Collection::<T, I>::get(T::Helper::collection(0)).unwrap().owner;
if caller != whitelisted_caller() {
whitelist_account!(caller);
@@ -68,7 +67,7 @@ fn add_collection_metadata<T: Config<I>, I: 'static>(
fn mint_item<T: Config<I>, I: 'static>(
index: u16,
) -> (T::ItemId, T::AccountId, <T::Lookup as StaticLookup>::Source) {
) -> (T::ItemId, T::AccountId, AccountIdLookupOf<T>) {
let caller = Collection::<T, I>::get(T::Helper::collection(0)).unwrap().admin;
if caller != whitelisted_caller() {
whitelist_account!(caller);
@@ -87,7 +86,7 @@ fn mint_item<T: Config<I>, I: 'static>(
fn add_item_metadata<T: Config<I>, I: 'static>(
item: T::ItemId,
) -> (T::AccountId, <T::Lookup as StaticLookup>::Source) {
) -> (T::AccountId, AccountIdLookupOf<T>) {
let caller = Collection::<T, I>::get(T::Helper::collection(0)).unwrap().owner;
if caller != whitelisted_caller() {
whitelist_account!(caller);
@@ -106,7 +105,7 @@ fn add_item_metadata<T: Config<I>, I: 'static>(
fn add_item_attribute<T: Config<I>, I: 'static>(
item: T::ItemId,
) -> (BoundedVec<u8, T::KeyLimit>, T::AccountId, <T::Lookup as StaticLookup>::Source) {
) -> (BoundedVec<u8, T::KeyLimit>, T::AccountId, AccountIdLookupOf<T>) {
let caller = Collection::<T, I>::get(T::Helper::collection(0)).unwrap().owner;
if caller != whitelisted_caller() {
whitelist_account!(caller);