mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 18:11:03 +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:
@@ -42,7 +42,7 @@ fn add_locks<T: Config>(who: &T::AccountId, n: u8) {
|
||||
}
|
||||
|
||||
fn add_vesting_schedules<T: Config>(
|
||||
target: <T::Lookup as StaticLookup>::Source,
|
||||
target: AccountIdLookupOf<T>,
|
||||
n: u32,
|
||||
) -> Result<BalanceOf<T>, &'static str> {
|
||||
let min_transfer = T::MinVestedTransfer::get();
|
||||
@@ -52,7 +52,7 @@ fn add_vesting_schedules<T: Config>(
|
||||
let starting_block = 1u32;
|
||||
|
||||
let source: T::AccountId = account("source", 0, SEED);
|
||||
let source_lookup: <T::Lookup as StaticLookup>::Source = T::Lookup::unlookup(source.clone());
|
||||
let source_lookup = T::Lookup::unlookup(source.clone());
|
||||
T::Currency::make_free_balance_be(&source, BalanceOf::<T>::max_value());
|
||||
|
||||
System::<T>::set_block_number(T::BlockNumber::zero());
|
||||
@@ -81,7 +81,7 @@ benchmarks! {
|
||||
let s in 1 .. T::MAX_VESTING_SCHEDULES;
|
||||
|
||||
let caller: T::AccountId = whitelisted_caller();
|
||||
let caller_lookup: <T::Lookup as StaticLookup>::Source = T::Lookup::unlookup(caller.clone());
|
||||
let caller_lookup = T::Lookup::unlookup(caller.clone());
|
||||
T::Currency::make_free_balance_be(&caller, T::Currency::minimum_balance());
|
||||
|
||||
add_locks::<T>(&caller, l as u8);
|
||||
@@ -109,7 +109,7 @@ benchmarks! {
|
||||
let s in 1 .. T::MAX_VESTING_SCHEDULES;
|
||||
|
||||
let caller: T::AccountId = whitelisted_caller();
|
||||
let caller_lookup: <T::Lookup as StaticLookup>::Source = T::Lookup::unlookup(caller.clone());
|
||||
let caller_lookup = T::Lookup::unlookup(caller.clone());
|
||||
T::Currency::make_free_balance_be(&caller, T::Currency::minimum_balance());
|
||||
|
||||
add_locks::<T>(&caller, l as u8);
|
||||
@@ -137,7 +137,7 @@ benchmarks! {
|
||||
let s in 1 .. T::MAX_VESTING_SCHEDULES;
|
||||
|
||||
let other: T::AccountId = account("other", 0, SEED);
|
||||
let other_lookup: <T::Lookup as StaticLookup>::Source = T::Lookup::unlookup(other.clone());
|
||||
let other_lookup = T::Lookup::unlookup(other.clone());
|
||||
|
||||
add_locks::<T>(&other, l as u8);
|
||||
let expected_balance = add_vesting_schedules::<T>(other_lookup.clone(), s)?;
|
||||
@@ -166,7 +166,7 @@ benchmarks! {
|
||||
let s in 1 .. T::MAX_VESTING_SCHEDULES;
|
||||
|
||||
let other: T::AccountId = account("other", 0, SEED);
|
||||
let other_lookup: <T::Lookup as StaticLookup>::Source = T::Lookup::unlookup(other.clone());
|
||||
let other_lookup = T::Lookup::unlookup(other.clone());
|
||||
|
||||
add_locks::<T>(&other, l as u8);
|
||||
add_vesting_schedules::<T>(other_lookup.clone(), s)?;
|
||||
@@ -198,7 +198,7 @@ benchmarks! {
|
||||
T::Currency::make_free_balance_be(&caller, BalanceOf::<T>::max_value());
|
||||
|
||||
let target: T::AccountId = account("target", 0, SEED);
|
||||
let target_lookup: <T::Lookup as StaticLookup>::Source = T::Lookup::unlookup(target.clone());
|
||||
let target_lookup = T::Lookup::unlookup(target.clone());
|
||||
// Give target existing locks
|
||||
add_locks::<T>(&target, l as u8);
|
||||
// Add one vesting schedules.
|
||||
@@ -232,11 +232,11 @@ benchmarks! {
|
||||
let s in 0 .. T::MAX_VESTING_SCHEDULES - 1;
|
||||
|
||||
let source: T::AccountId = account("source", 0, SEED);
|
||||
let source_lookup: <T::Lookup as StaticLookup>::Source = T::Lookup::unlookup(source.clone());
|
||||
let source_lookup = T::Lookup::unlookup(source.clone());
|
||||
T::Currency::make_free_balance_be(&source, BalanceOf::<T>::max_value());
|
||||
|
||||
let target: T::AccountId = account("target", 0, SEED);
|
||||
let target_lookup: <T::Lookup as StaticLookup>::Source = T::Lookup::unlookup(target.clone());
|
||||
let target_lookup = T::Lookup::unlookup(target.clone());
|
||||
// Give target existing locks
|
||||
add_locks::<T>(&target, l as u8);
|
||||
// Add one less than max vesting schedules
|
||||
@@ -270,7 +270,7 @@ benchmarks! {
|
||||
let s in 2 .. T::MAX_VESTING_SCHEDULES;
|
||||
|
||||
let caller: T::AccountId = account("caller", 0, SEED);
|
||||
let caller_lookup: <T::Lookup as StaticLookup>::Source = T::Lookup::unlookup(caller.clone());
|
||||
let caller_lookup = T::Lookup::unlookup(caller.clone());
|
||||
// Give target existing locks.
|
||||
add_locks::<T>(&caller, l as u8);
|
||||
// Add max vesting schedules.
|
||||
@@ -320,7 +320,7 @@ benchmarks! {
|
||||
let test_dest: T::AccountId = account("test_dest", 0, SEED);
|
||||
|
||||
let caller: T::AccountId = account("caller", 0, SEED);
|
||||
let caller_lookup: <T::Lookup as StaticLookup>::Source = T::Lookup::unlookup(caller.clone());
|
||||
let caller_lookup = T::Lookup::unlookup(caller.clone());
|
||||
// Give target other locks.
|
||||
add_locks::<T>(&caller, l as u8);
|
||||
// Add max vesting schedules.
|
||||
|
||||
Reference in New Issue
Block a user