difftreelog
feat switch `inflation` from `Currency` trait to `fungible::*` traits fix: benchmarks
in: master
5 files changed
pallets/app-promotion/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/app-promotion/src/benchmarking.rs
+++ b/pallets/app-promotion/src/benchmarking.rs
@@ -33,11 +33,11 @@
where
T: Config + pallet_unique::Config + pallet_evm_migration::Config,
T::BlockNumber: From<u32> + Into<u32>,
- <<T as Config>::Currency as Currency<T::AccountId>>::Balance: Sum + From<u128>,
+ BalanceOf<T>: Sum + From<u128>,
{
let pallet_admin = account::<T::AccountId>("admin", 0, SEED);
- <T as Config>::Currency::make_free_balance_be(
+ <T as Config>::Currency::set_balance(
&pallet_admin,
Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value(),
);
@@ -54,7 +54,7 @@
where_clause{
where T: Config + pallet_unique::Config + pallet_evm_migration::Config ,
T::BlockNumber: From<u32> + Into<u32>,
- <<T as Config>::Currency as Currency<T::AccountId>>::Balance: Sum + From<u128>
+ BalanceOf<T>: Sum + From<u128>
}
on_initialize {
@@ -63,7 +63,7 @@
(0..b).try_for_each(|index| {
let staker = account::<T::AccountId>("staker", index, SEED);
- <T as Config>::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ <T as Config>::Currency::set_balance(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
PromototionPallet::<T>::stake(RawOrigin::Signed(staker.clone()).into(), Into::<BalanceOf<T>>::into(100u128) * T::Nominal::get())?;
PromototionPallet::<T>::unstake_all(RawOrigin::Signed(staker.clone()).into())?;
Result::<(), sp_runtime::DispatchError>::Ok(())
@@ -73,7 +73,7 @@
set_admin_address {
let pallet_admin = account::<T::AccountId>("admin", 0, SEED);
- let _ = <T as Config>::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let _ = <T as Config>::Currency::set_balance(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
} : _(RawOrigin::Root, T::CrossAccountId::from_sub(pallet_admin))
payout_stakers{
@@ -82,12 +82,12 @@
let pallet_admin = account::<T::AccountId>("admin", 1, SEED);
let share = Perbill::from_rational(1u32, 20);
PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;
- <T as Config>::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
- <T as Config>::Currency::make_free_balance_be(&<T as pallet::Config>::TreasuryAccountId::get(), Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ <T as Config>::Currency::set_balance(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ <T as Config>::Currency::set_balance(&<T as pallet::Config>::TreasuryAccountId::get(), Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
let stakers: Vec<T::AccountId> = (0..b).map(|index| account("staker", index, SEED)).collect();
stakers.iter().for_each(|staker| {
- <T as Config>::Currency::make_free_balance_be(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ <T as Config>::Currency::set_balance(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
});
(1..11).try_for_each(|i| {
<frame_system::Pallet<T>>::set_block_number(i.into());
@@ -112,13 +112,13 @@
stake {
let caller = account::<T::AccountId>("caller", 0, SEED);
let share = Perbill::from_rational(1u32, 10);
- let _ = <T as Config>::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let _ = <T as Config>::Currency::set_balance(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
} : _(RawOrigin::Signed(caller.clone()), share * <T as Config>::Currency::total_balance(&caller))
unstake_all {
let caller = account::<T::AccountId>("caller", 0, SEED);
let share = Perbill::from_rational(1u32, 20);
- let _ = <T as Config>::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let _ = <T as Config>::Currency::set_balance(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
(1..11).map(|i| {
// used to change block number
<frame_system::Pallet<T>>::set_block_number(i.into());
@@ -133,7 +133,7 @@
unstake_partial {
let caller = account::<T::AccountId>("caller", 0, SEED);
let share = Perbill::from_rational(1u32, 20);
- let _ = <T as Config>::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let _ = <T as Config>::Currency::set_balance(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
(1..11).map(|i| {
// used to change block number
<frame_system::Pallet<T>>::set_block_number(i.into());
@@ -148,18 +148,18 @@
sponsor_collection {
let pallet_admin = account::<T::AccountId>("admin", 0, SEED);
PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;
- let _ = <T as Config>::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let _ = <T as Config>::Currency::set_balance(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
let caller: T::AccountId = account("caller", 0, SEED);
- let _ = <T as Config>::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let _ = <T as Config>::Currency::set_balance(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
let collection = create_nft_collection::<T>(caller.clone())?;
} : _(RawOrigin::Signed(pallet_admin.clone()), collection)
stop_sponsoring_collection {
let pallet_admin = account::<T::AccountId>("admin", 0, SEED);
PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;
- let _ = <T as Config>::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let _ = <T as Config>::Currency::set_balance(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
let caller: T::AccountId = account("caller", 0, SEED);
- let _ = <T as Config>::Currency::make_free_balance_be(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let _ = <T as Config>::Currency::set_balance(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
let collection = create_nft_collection::<T>(caller.clone())?;
PromototionPallet::<T>::sponsor_collection(RawOrigin::Signed(pallet_admin.clone()).into(), collection)?;
} : _(RawOrigin::Signed(pallet_admin.clone()), collection)
@@ -168,7 +168,7 @@
let pallet_admin = account::<T::AccountId>("admin", 0, SEED);
PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;
- let _ = <T as Config>::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let _ = <T as Config>::Currency::set_balance(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
let address = H160::from_low_u64_be(SEED as u64);
let data: Vec<u8> = (0..20 as u8).collect();
<EvmMigrationPallet<T>>::begin(RawOrigin::Root.into(), address)?;
@@ -179,7 +179,7 @@
let pallet_admin = account::<T::AccountId>("admin", 0, SEED);
PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;
- let _ = <T as Config>::Currency::make_free_balance_be(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
+ let _ = <T as Config>::Currency::set_balance(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
let address = H160::from_low_u64_be(SEED as u64);
let data: Vec<u8> = (0..20 as u8).collect();
<EvmMigrationPallet<T>>::begin(RawOrigin::Root.into(), address)?;
pallets/configuration/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/configuration/src/benchmarking.rs
+++ b/pallets/configuration/src/benchmarking.rs
@@ -68,7 +68,7 @@
}
set_collator_selection_license_bond {
- let bond_cost: Option<BalanceOf<T>> = Some(T::Balances::minimum_balance() * 10u32.into());
+ let bond_cost: Option<BalanceOf<T>> = Some(T::Currency::minimum_balance() * 10u32.into());
}: {
assert_ok!(
<Pallet<T>>::set_collator_selection_license_bond(RawOrigin::Root.into(), bond_cost.clone())
pallets/inflation/src/lib.rsdiffbeforeafterboth--- a/pallets/inflation/src/lib.rs
+++ b/pallets/inflation/src/lib.rs
@@ -39,18 +39,22 @@
use frame_support::{
dispatch::{DispatchResult},
- traits::{Currency, Get},
+ traits::{
+ fungible::{Balanced, Inspect, Mutate},
+ Get, Imbalance,
+ tokens::Precision,
+ },
};
pub use pallet::*;
use sp_runtime::{
Perbill,
- traits::{BlockNumberProvider},
+ traits::{BlockNumberProvider, Zero},
};
use sp_std::convert::TryInto;
type BalanceOf<T> =
- <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
+ <<T as Config>::Currency as Inspect<<T as frame_system::Config>::AccountId>>::Balance;
pub const YEAR: u32 = 5_259_600; // 6-second block
// pub const YEAR: u32 = 2_629_800; // 12-second block
@@ -66,7 +70,9 @@
#[pallet::config]
pub trait Config: frame_system::Config {
- type Currency: Currency<Self::AccountId>;
+ type Currency: Balanced<Self::AccountId>
+ + Inspect<Self::AccountId>
+ + Mutate<Self::AccountId>;
type TreasuryAccountId: Get<Self::AccountId>;
// The block number provider
@@ -133,11 +139,8 @@
add_weight(0, 4, Weight::from_parts(5_000_000, 0));
}
- T::Currency::deposit_into_existing(
- &T::TreasuryAccountId::get(),
- <BlockInflation<T>>::get(),
- )
- .ok();
+ T::Currency::mint_into(&T::TreasuryAccountId::get(), <BlockInflation<T>>::get())
+ .ok();
// Update inflation block
<NextInflationBlock<T>>::set(next_inflation + block_interval.into());
@@ -184,10 +187,12 @@
<NextInflationBlock<T>>::set(inflation_start_relay_block + block_interval.into());
// First time deposit - create Treasury account so that we can call deposit_into_existing everywhere else
- T::Currency::deposit_creating(
+ let imbalance = T::Currency::deposit(
&T::TreasuryAccountId::get(),
<BlockInflation<T>>::get(),
- );
+ Precision::Exact,
+ )?;
+ debug_assert!(imbalance.peek().is_zero());
}
Ok(())
pallets/structure/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/structure/src/benchmarking.rs
+++ b/pallets/structure/src/benchmarking.rs
@@ -17,7 +17,7 @@
use super::*;
use frame_benchmarking::{benchmarks, account};
-use frame_support::traits::{Currency, Get};
+use frame_support::traits::{fungible::Balanced, Get, tokens::Precision};
use up_data_structs::{
CreateCollectionData, CollectionMode, CreateItemData, CollectionFlags, CreateNftData,
budget::Unlimited,
@@ -32,7 +32,7 @@
let caller: T::AccountId = account("caller", 0, SEED);
let caller_cross = T::CrossAccountId::from_sub(caller.clone());
- <T as CommonConfig>::Currency::deposit_creating(&caller, T::CollectionCreationPrice::get());
+ let _ = <T as CommonConfig>::Currency::deposit(&caller, T::CollectionCreationPrice::get(), Precision::Exact).unwrap();
T::CollectionDispatch::create(
caller_cross.clone(),
caller_cross.clone(),
pallets/unique/src/benchmarking.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617#![cfg(feature = "runtime-benchmarks")]1819use super::*;20use crate::Pallet;21use frame_system::RawOrigin;22use frame_support::traits::{tokens::currency::Currency, Get};23use frame_benchmarking::{benchmarks, account};24use sp_runtime::DispatchError;25use pallet_common::{26 Config as CommonConfig,27 benchmarking::{create_data, create_u16_data},28};29use up_data_structs::{30 CollectionId, CollectionMode, MAX_COLLECTION_NAME_LENGTH, MAX_TOKEN_PREFIX_LENGTH,31 MAX_COLLECTION_DESCRIPTION_LENGTH, CollectionLimits,32};33use pallet_common::erc::CrossAccountId;3435const SEED: u32 = 1;3637fn create_collection_helper<T: Config>(38 owner: T::AccountId,39 mode: CollectionMode,40) -> Result<CollectionId, DispatchError> {41 <T as CommonConfig>::Currency::deposit_creating(&owner, T::CollectionCreationPrice::get());42 let col_name = create_u16_data::<{ MAX_COLLECTION_NAME_LENGTH }>();43 let col_desc = create_u16_data::<{ MAX_COLLECTION_DESCRIPTION_LENGTH }>();44 let token_prefix = create_data::<{ MAX_TOKEN_PREFIX_LENGTH }>();45 <Pallet<T>>::create_collection(46 RawOrigin::Signed(owner).into(),47 col_name,48 col_desc,49 token_prefix,50 mode,51 )?;52 Ok(<pallet_common::CreatedCollectionCount<T>>::get())53}54pub fn create_nft_collection<T: Config>(55 owner: T::AccountId,56) -> Result<CollectionId, DispatchError> {57 create_collection_helper::<T>(owner, CollectionMode::NFT)58}5960benchmarks! {61 create_collection {62 let col_name = create_u16_data::<{MAX_COLLECTION_NAME_LENGTH}>();63 let col_desc = create_u16_data::<{MAX_COLLECTION_DESCRIPTION_LENGTH}>();64 let token_prefix = create_data::<{MAX_TOKEN_PREFIX_LENGTH}>();65 let mode: CollectionMode = CollectionMode::NFT;66 let caller: T::AccountId = account("caller", 0, SEED);67 <T as CommonConfig>::Currency::deposit_creating(&caller, T::CollectionCreationPrice::get());68 }: _(RawOrigin::Signed(caller.clone()), col_name.clone(), col_desc.clone(), token_prefix.clone(), mode)69 verify {70 assert_eq!(<pallet_common::CollectionById<T>>::get(CollectionId(1)).unwrap().owner, caller);71 }7273 destroy_collection {74 let caller: T::AccountId = account("caller", 0, SEED);75 let collection = create_nft_collection::<T>(caller.clone())?;76 }: _(RawOrigin::Signed(caller.clone()), collection)7778 add_to_allow_list {79 let caller: T::AccountId = account("caller", 0, SEED);80 let allowlist_account: T::AccountId = account("admin", 0, SEED);81 let collection = create_nft_collection::<T>(caller.clone())?;82 }: _(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(allowlist_account))8384 remove_from_allow_list {85 let caller: T::AccountId = account("caller", 0, SEED);86 let allowlist_account: T::AccountId = account("admin", 0, SEED);87 let collection = create_nft_collection::<T>(caller.clone())?;88 <Pallet<T>>::add_to_allow_list(RawOrigin::Signed(caller.clone()).into(), collection, T::CrossAccountId::from_sub(allowlist_account.clone()))?;89 }: _(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(allowlist_account))9091 change_collection_owner {92 let caller: T::AccountId = account("caller", 0, SEED);93 let collection = create_nft_collection::<T>(caller.clone())?;94 let new_owner: T::AccountId = account("admin", 0, SEED);95 }: _(RawOrigin::Signed(caller.clone()), collection, new_owner)9697 add_collection_admin {98 let caller: T::AccountId = account("caller", 0, SEED);99 let collection = create_nft_collection::<T>(caller.clone())?;100 let new_admin: T::AccountId = account("admin", 0, SEED);101 }: _(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(new_admin))102103 remove_collection_admin {104 let caller: T::AccountId = account("caller", 0, SEED);105 let collection = create_nft_collection::<T>(caller.clone())?;106 let new_admin: T::AccountId = account("admin", 0, SEED);107 <Pallet<T>>::add_collection_admin(RawOrigin::Signed(caller.clone()).into(), collection, T::CrossAccountId::from_sub(new_admin.clone()))?;108 }: _(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(new_admin))109110 set_collection_sponsor {111 let caller: T::AccountId = account("caller", 0, SEED);112 let collection = create_nft_collection::<T>(caller.clone())?;113 }: _(RawOrigin::Signed(caller.clone()), collection, caller.clone())114115 confirm_sponsorship {116 let caller: T::AccountId = account("caller", 0, SEED);117 let collection = create_nft_collection::<T>(caller.clone())?;118 <Pallet<T>>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), collection, caller.clone())?;119 }: _(RawOrigin::Signed(caller.clone()), collection)120121 remove_collection_sponsor {122 let caller: T::AccountId = account("caller", 0, SEED);123 let collection = create_nft_collection::<T>(caller.clone())?;124 <Pallet<T>>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), collection, caller.clone())?;125 <Pallet<T>>::confirm_sponsorship(RawOrigin::Signed(caller.clone()).into(), collection)?;126 }: _(RawOrigin::Signed(caller.clone()), collection)127128 set_transfers_enabled_flag {129 let caller: T::AccountId = account("caller", 0, SEED);130 let collection = create_nft_collection::<T>(caller.clone())?;131 }: _(RawOrigin::Signed(caller.clone()), collection, false)132133134 set_collection_limits {135 let caller: T::AccountId = account("caller", 0, SEED);136 let collection = create_nft_collection::<T>(caller.clone())?;137138 let cl = CollectionLimits {139 account_token_ownership_limit: Some(0),140 sponsored_data_size: Some(0),141 token_limit: Some(1),142 sponsor_transfer_timeout: Some(0),143 sponsor_approve_timeout: None,144 owner_can_destroy: Some(true),145 owner_can_transfer: Some(true),146 sponsored_data_rate_limit: None,147 transfers_enabled: Some(true),148 };149 }: set_collection_limits(RawOrigin::Signed(caller.clone()), collection, cl)150151 force_repair_collection {152 let caller: T::AccountId = account("caller", 0, SEED);153 let collection = create_nft_collection::<T>(caller.clone())?;154 }: _(RawOrigin::Root, collection)155}1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617#![cfg(feature = "runtime-benchmarks")]1819use super::*;20use crate::Pallet;21use frame_system::RawOrigin;22use frame_support::traits::{fungible::Balanced, Get, tokens::Precision};23use frame_benchmarking::{benchmarks, account};24use sp_runtime::DispatchError;25use pallet_common::{26 Config as CommonConfig,27 benchmarking::{create_data, create_u16_data},28};29use up_data_structs::{30 CollectionId, CollectionMode, MAX_COLLECTION_NAME_LENGTH, MAX_TOKEN_PREFIX_LENGTH,31 MAX_COLLECTION_DESCRIPTION_LENGTH, CollectionLimits,32};33use pallet_common::erc::CrossAccountId;3435const SEED: u32 = 1;3637fn create_collection_helper<T: Config>(38 owner: T::AccountId,39 mode: CollectionMode,40) -> Result<CollectionId, DispatchError> {41 let _ = <T as CommonConfig>::Currency::deposit(42 &owner,43 T::CollectionCreationPrice::get(),44 Precision::Exact,45 )46 .unwrap();47 let col_name = create_u16_data::<{ MAX_COLLECTION_NAME_LENGTH }>();48 let col_desc = create_u16_data::<{ MAX_COLLECTION_DESCRIPTION_LENGTH }>();49 let token_prefix = create_data::<{ MAX_TOKEN_PREFIX_LENGTH }>();50 <Pallet<T>>::create_collection(51 RawOrigin::Signed(owner).into(),52 col_name,53 col_desc,54 token_prefix,55 mode,56 )?;57 Ok(<pallet_common::CreatedCollectionCount<T>>::get())58}59pub fn create_nft_collection<T: Config>(60 owner: T::AccountId,61) -> Result<CollectionId, DispatchError> {62 create_collection_helper::<T>(owner, CollectionMode::NFT)63}6465benchmarks! {66 create_collection {67 let col_name = create_u16_data::<{MAX_COLLECTION_NAME_LENGTH}>();68 let col_desc = create_u16_data::<{MAX_COLLECTION_DESCRIPTION_LENGTH}>();69 let token_prefix = create_data::<{MAX_TOKEN_PREFIX_LENGTH}>();70 let mode: CollectionMode = CollectionMode::NFT;71 let caller: T::AccountId = account("caller", 0, SEED);72 let _ = <T as CommonConfig>::Currency::deposit(&caller, T::CollectionCreationPrice::get(), Precision::Exact).unwrap();73 }: _(RawOrigin::Signed(caller.clone()), col_name.clone(), col_desc.clone(), token_prefix.clone(), mode)74 verify {75 assert_eq!(<pallet_common::CollectionById<T>>::get(CollectionId(1)).unwrap().owner, caller);76 }7778 destroy_collection {79 let caller: T::AccountId = account("caller", 0, SEED);80 let collection = create_nft_collection::<T>(caller.clone())?;81 }: _(RawOrigin::Signed(caller.clone()), collection)8283 add_to_allow_list {84 let caller: T::AccountId = account("caller", 0, SEED);85 let allowlist_account: T::AccountId = account("admin", 0, SEED);86 let collection = create_nft_collection::<T>(caller.clone())?;87 }: _(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(allowlist_account))8889 remove_from_allow_list {90 let caller: T::AccountId = account("caller", 0, SEED);91 let allowlist_account: T::AccountId = account("admin", 0, SEED);92 let collection = create_nft_collection::<T>(caller.clone())?;93 <Pallet<T>>::add_to_allow_list(RawOrigin::Signed(caller.clone()).into(), collection, T::CrossAccountId::from_sub(allowlist_account.clone()))?;94 }: _(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(allowlist_account))9596 change_collection_owner {97 let caller: T::AccountId = account("caller", 0, SEED);98 let collection = create_nft_collection::<T>(caller.clone())?;99 let new_owner: T::AccountId = account("admin", 0, SEED);100 }: _(RawOrigin::Signed(caller.clone()), collection, new_owner)101102 add_collection_admin {103 let caller: T::AccountId = account("caller", 0, SEED);104 let collection = create_nft_collection::<T>(caller.clone())?;105 let new_admin: T::AccountId = account("admin", 0, SEED);106 }: _(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(new_admin))107108 remove_collection_admin {109 let caller: T::AccountId = account("caller", 0, SEED);110 let collection = create_nft_collection::<T>(caller.clone())?;111 let new_admin: T::AccountId = account("admin", 0, SEED);112 <Pallet<T>>::add_collection_admin(RawOrigin::Signed(caller.clone()).into(), collection, T::CrossAccountId::from_sub(new_admin.clone()))?;113 }: _(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(new_admin))114115 set_collection_sponsor {116 let caller: T::AccountId = account("caller", 0, SEED);117 let collection = create_nft_collection::<T>(caller.clone())?;118 }: _(RawOrigin::Signed(caller.clone()), collection, caller.clone())119120 confirm_sponsorship {121 let caller: T::AccountId = account("caller", 0, SEED);122 let collection = create_nft_collection::<T>(caller.clone())?;123 <Pallet<T>>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), collection, caller.clone())?;124 }: _(RawOrigin::Signed(caller.clone()), collection)125126 remove_collection_sponsor {127 let caller: T::AccountId = account("caller", 0, SEED);128 let collection = create_nft_collection::<T>(caller.clone())?;129 <Pallet<T>>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), collection, caller.clone())?;130 <Pallet<T>>::confirm_sponsorship(RawOrigin::Signed(caller.clone()).into(), collection)?;131 }: _(RawOrigin::Signed(caller.clone()), collection)132133 set_transfers_enabled_flag {134 let caller: T::AccountId = account("caller", 0, SEED);135 let collection = create_nft_collection::<T>(caller.clone())?;136 }: _(RawOrigin::Signed(caller.clone()), collection, false)137138139 set_collection_limits {140 let caller: T::AccountId = account("caller", 0, SEED);141 let collection = create_nft_collection::<T>(caller.clone())?;142143 let cl = CollectionLimits {144 account_token_ownership_limit: Some(0),145 sponsored_data_size: Some(0),146 token_limit: Some(1),147 sponsor_transfer_timeout: Some(0),148 sponsor_approve_timeout: None,149 owner_can_destroy: Some(true),150 owner_can_transfer: Some(true),151 sponsored_data_rate_limit: None,152 transfers_enabled: Some(true),153 };154 }: set_collection_limits(RawOrigin::Signed(caller.clone()), collection, cl)155156 force_repair_collection {157 let caller: T::AccountId = account("caller", 0, SEED);158 let collection = create_nft_collection::<T>(caller.clone())?;159 }: _(RawOrigin::Root, collection)160}