difftreelog
minor: add bechmarks for RFT collection & token properties
in: master
3 files changed
pallets/refungible/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/>.1617use super::*;18use crate::{Pallet, Config, RefungibleHandle};1920use sp_std::prelude::*;21use pallet_common::benchmarking::{create_collection_raw, create_data};22use frame_benchmarking::{benchmarks, account};23use up_data_structs::{CollectionMode, MAX_ITEMS_PER_BATCH, CUSTOM_DATA_LIMIT, budget::Unlimited};24use pallet_common::bench_init;25use core::convert::TryInto;26use core::iter::IntoIterator;2728const SEED: u32 = 1;2930fn create_max_item_data<CrossAccountId: Ord>(31 users: impl IntoIterator<Item = (CrossAccountId, u128)>,32) -> CreateRefungibleExData<CrossAccountId> {33 let const_data = create_data::<CUSTOM_DATA_LIMIT>();34 CreateRefungibleExData {35 const_data,36 users: users37 .into_iter()38 .collect::<BTreeMap<_, _>>()39 .try_into()40 .unwrap(),41 properties: Default::default(),42 }43}44fn create_max_item<T: Config>(45 collection: &RefungibleHandle<T>,46 sender: &T::CrossAccountId,47 users: impl IntoIterator<Item = (T::CrossAccountId, u128)>,48) -> Result<TokenId, DispatchError> {49 let data: CreateRefungibleExData<T::CrossAccountId> = create_max_item_data(users);50 <Pallet<T>>::create_item(&collection, sender, data, &Unlimited)?;51 Ok(TokenId(<TokensMinted<T>>::get(&collection.id)))52}5354fn create_collection<T: Config>(55 owner: T::CrossAccountId,56) -> Result<RefungibleHandle<T>, DispatchError> {57 create_collection_raw(58 owner,59 CollectionMode::NFT,60 <Pallet<T>>::init_collection,61 RefungibleHandle::cast,62 )63}64benchmarks! {65 create_item {66 bench_init!{67 owner: sub; collection: collection(owner);68 sender: cross_from_sub(owner); to: cross_sub;69 };70 }: {create_max_item(&collection, &sender, [(to.clone(), 200)])?}7172 create_multiple_items {73 let b in 0..MAX_ITEMS_PER_BATCH;74 bench_init!{75 owner: sub; collection: collection(owner);76 sender: cross_from_sub(owner); to: cross_sub;77 };78 let data = (0..b).map(|_| create_max_item_data([(to.clone(), 200)])).collect();79 }: {<Pallet<T>>::create_multiple_items(&collection, &sender, data, &Unlimited)?}8081 create_multiple_items_ex_multiple_items {82 let b in 0..MAX_ITEMS_PER_BATCH;83 bench_init!{84 owner: sub; collection: collection(owner);85 sender: cross_from_sub(owner);86 };87 let data = (0..b).map(|t| {88 bench_init!(to: cross_sub(t););89 create_max_item_data([(to, 200)])90 }).collect();91 }: {<Pallet<T>>::create_multiple_items(&collection, &sender, data, &Unlimited)?}9293 create_multiple_items_ex_multiple_owners {94 let b in 0..MAX_ITEMS_PER_BATCH;95 bench_init!{96 owner: sub; collection: collection(owner);97 sender: cross_from_sub(owner);98 };99 let data = vec![create_max_item_data((0..b).map(|u| {100 bench_init!(to: cross_sub(u););101 (to, 200)102 }))].try_into().unwrap();103 }: {<Pallet<T>>::create_multiple_items(&collection, &sender, data, &Unlimited)?}104105 // Other user left, token data is kept106 burn_item_partial {107 bench_init!{108 owner: sub; collection: collection(owner);109 sender: cross_from_sub(owner); burner: cross_sub; another_owner: cross_sub;110 };111 let item = create_max_item(&collection, &sender, [(burner.clone(), 200), (another_owner, 200)])?;112 }: {<Pallet<T>>::burn(&collection, &burner, item, 200)?}113 // No users remaining, token is destroyed114 burn_item_fully {115 bench_init!{116 owner: sub; collection: collection(owner);117 sender: cross_from_sub(owner); burner: cross_sub; another_owner: cross_sub;118 };119 let item = create_max_item(&collection, &sender, [(burner.clone(), 200)])?;120 }: {<Pallet<T>>::burn(&collection, &burner, item, 200)?}121122 transfer_normal {123 bench_init!{124 owner: sub; collection: collection(owner);125 sender: cross_from_sub(owner); receiver: cross_sub;126 };127 let item = create_max_item(&collection, &sender, [(sender.clone(), 200), (receiver.clone(), 200)])?;128 }: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, 100, &Unlimited)?}129 // Target account is created130 transfer_creating {131 bench_init!{132 owner: sub; collection: collection(owner);133 sender: cross_from_sub(owner); receiver: cross_sub;134 };135 let item = create_max_item(&collection, &sender, [(sender.clone(), 200)])?;136 }: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, 100, &Unlimited)?}137 // Source account is destroyed138 transfer_removing {139 bench_init!{140 owner: sub; collection: collection(owner);141 sender: cross_from_sub(owner); receiver: cross_sub;142 };143 let item = create_max_item(&collection, &sender, [(sender.clone(), 200), (receiver.clone(), 200)])?;144 }: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, 200, &Unlimited)?}145 // Source account destroyed, target created146 transfer_creating_removing {147 bench_init!{148 owner: sub; collection: collection(owner);149 sender: cross_from_sub(owner); receiver: cross_sub;150 };151 let item = create_max_item(&collection, &sender, [(sender.clone(), 200)])?;152 }: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, 200, &Unlimited)?}153154 approve {155 bench_init!{156 owner: sub; collection: collection(owner);157 owner: cross_from_sub; sender: cross_sub; spender: cross_sub;158 };159 let item = create_max_item(&collection, &owner, [(sender.clone(), 200)])?;160 }: {<Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 100)?}161162 transfer_from_normal {163 bench_init!{164 owner: sub; collection: collection(owner);165 owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;166 };167 let item = create_max_item(&collection, &owner, [(sender.clone(), 200), (receiver.clone(), 200)])?;168 <Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 100)?;169 }: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, 100, &Unlimited)?}170 // Target account is created171 transfer_from_creating {172 bench_init!{173 owner: sub; collection: collection(owner);174 owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;175 };176 let item = create_max_item(&collection, &owner, [(sender.clone(), 200)])?;177 <Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 100)?;178 }: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, 100, &Unlimited)?}179 // Source account is destroyed180 transfer_from_removing {181 bench_init!{182 owner: sub; collection: collection(owner);183 owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;184 };185 let item = create_max_item(&collection, &owner, [(sender.clone(), 200), (receiver.clone(), 200)])?;186 <Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 200)?;187 }: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, 200, &Unlimited)?}188 // Source account destroyed, target created189 transfer_from_creating_removing {190 bench_init!{191 owner: sub; collection: collection(owner);192 owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;193 };194 let item = create_max_item(&collection, &owner, [(sender.clone(), 200)])?;195 <Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 200)?;196 }: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, 200, &Unlimited)?}197198 // Both source account and token is destroyed199 burn_from {200 bench_init!{201 owner: sub; collection: collection(owner);202 owner: cross_from_sub; sender: cross_sub; burner: cross_sub;203 };204 let item = create_max_item(&collection, &owner, [(sender.clone(), 200)])?;205 <Pallet<T>>::set_allowance(&collection, &sender, &burner, item, 200)?;206 }: {<Pallet<T>>::burn_from(&collection, &burner, &sender, item, 200, &Unlimited)?}207208 repartition_item {209 bench_init!{210 owner: sub; collection: collection(owner);211 sender: cross_from_sub(owner); owner: cross_sub;212 };213 let item = create_max_item(&collection, &sender, [(owner.clone(), 100)])?;214 }: {<Pallet<T>>::repartition(&collection, &owner, item, 200)?}215}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/>.1617use super::*;18use crate::{Pallet, Config, RefungibleHandle};1920use sp_std::prelude::*;21use pallet_common::benchmarking::{create_collection_raw, property_key, property_value, create_data};22use frame_benchmarking::{benchmarks, account};23use up_data_structs::{CollectionMode, MAX_ITEMS_PER_BATCH, MAX_PROPERTIES_PER_ITEM, CUSTOM_DATA_LIMIT, budget::Unlimited};24use pallet_common::bench_init;25use core::convert::TryInto;26use core::iter::IntoIterator;2728const SEED: u32 = 1;2930fn create_max_item_data<CrossAccountId: Ord>(31 users: impl IntoIterator<Item = (CrossAccountId, u128)>,32) -> CreateRefungibleExData<CrossAccountId> {33 let const_data = create_data::<CUSTOM_DATA_LIMIT>();34 CreateRefungibleExData {35 const_data,36 users: users37 .into_iter()38 .collect::<BTreeMap<_, _>>()39 .try_into()40 .unwrap(),41 properties: Default::default(),42 }43}44fn create_max_item<T: Config>(45 collection: &RefungibleHandle<T>,46 sender: &T::CrossAccountId,47 users: impl IntoIterator<Item = (T::CrossAccountId, u128)>,48) -> Result<TokenId, DispatchError> {49 let data: CreateRefungibleExData<T::CrossAccountId> = create_max_item_data(users);50 <Pallet<T>>::create_item(&collection, sender, data, &Unlimited)?;51 Ok(TokenId(<TokensMinted<T>>::get(&collection.id)))52}5354fn create_collection<T: Config>(55 owner: T::CrossAccountId,56) -> Result<RefungibleHandle<T>, DispatchError> {57 create_collection_raw(58 owner,59 CollectionMode::NFT,60 <Pallet<T>>::init_collection,61 RefungibleHandle::cast,62 )63}64benchmarks! {65 create_item {66 bench_init!{67 owner: sub; collection: collection(owner);68 sender: cross_from_sub(owner); to: cross_sub;69 };70 }: {create_max_item(&collection, &sender, [(to.clone(), 200)])?}7172 create_multiple_items {73 let b in 0..MAX_ITEMS_PER_BATCH;74 bench_init!{75 owner: sub; collection: collection(owner);76 sender: cross_from_sub(owner); to: cross_sub;77 };78 let data = (0..b).map(|_| create_max_item_data([(to.clone(), 200)])).collect();79 }: {<Pallet<T>>::create_multiple_items(&collection, &sender, data, &Unlimited)?}8081 create_multiple_items_ex_multiple_items {82 let b in 0..MAX_ITEMS_PER_BATCH;83 bench_init!{84 owner: sub; collection: collection(owner);85 sender: cross_from_sub(owner);86 };87 let data = (0..b).map(|t| {88 bench_init!(to: cross_sub(t););89 create_max_item_data([(to, 200)])90 }).collect();91 }: {<Pallet<T>>::create_multiple_items(&collection, &sender, data, &Unlimited)?}9293 create_multiple_items_ex_multiple_owners {94 let b in 0..MAX_ITEMS_PER_BATCH;95 bench_init!{96 owner: sub; collection: collection(owner);97 sender: cross_from_sub(owner);98 };99 let data = vec![create_max_item_data((0..b).map(|u| {100 bench_init!(to: cross_sub(u););101 (to, 200)102 }))].try_into().unwrap();103 }: {<Pallet<T>>::create_multiple_items(&collection, &sender, data, &Unlimited)?}104105 // Other user left, token data is kept106 burn_item_partial {107 bench_init!{108 owner: sub; collection: collection(owner);109 sender: cross_from_sub(owner); burner: cross_sub; another_owner: cross_sub;110 };111 let item = create_max_item(&collection, &sender, [(burner.clone(), 200), (another_owner, 200)])?;112 }: {<Pallet<T>>::burn(&collection, &burner, item, 200)?}113 // No users remaining, token is destroyed114 burn_item_fully {115 bench_init!{116 owner: sub; collection: collection(owner);117 sender: cross_from_sub(owner); burner: cross_sub; another_owner: cross_sub;118 };119 let item = create_max_item(&collection, &sender, [(burner.clone(), 200)])?;120 }: {<Pallet<T>>::burn(&collection, &burner, item, 200)?}121122 transfer_normal {123 bench_init!{124 owner: sub; collection: collection(owner);125 sender: cross_from_sub(owner); receiver: cross_sub;126 };127 let item = create_max_item(&collection, &sender, [(sender.clone(), 200), (receiver.clone(), 200)])?;128 }: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, 100, &Unlimited)?}129 // Target account is created130 transfer_creating {131 bench_init!{132 owner: sub; collection: collection(owner);133 sender: cross_from_sub(owner); receiver: cross_sub;134 };135 let item = create_max_item(&collection, &sender, [(sender.clone(), 200)])?;136 }: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, 100, &Unlimited)?}137 // Source account is destroyed138 transfer_removing {139 bench_init!{140 owner: sub; collection: collection(owner);141 sender: cross_from_sub(owner); receiver: cross_sub;142 };143 let item = create_max_item(&collection, &sender, [(sender.clone(), 200), (receiver.clone(), 200)])?;144 }: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, 200, &Unlimited)?}145 // Source account destroyed, target created146 transfer_creating_removing {147 bench_init!{148 owner: sub; collection: collection(owner);149 sender: cross_from_sub(owner); receiver: cross_sub;150 };151 let item = create_max_item(&collection, &sender, [(sender.clone(), 200)])?;152 }: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, 200, &Unlimited)?}153154 approve {155 bench_init!{156 owner: sub; collection: collection(owner);157 owner: cross_from_sub; sender: cross_sub; spender: cross_sub;158 };159 let item = create_max_item(&collection, &owner, [(sender.clone(), 200)])?;160 }: {<Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 100)?}161162 transfer_from_normal {163 bench_init!{164 owner: sub; collection: collection(owner);165 owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;166 };167 let item = create_max_item(&collection, &owner, [(sender.clone(), 200), (receiver.clone(), 200)])?;168 <Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 100)?;169 }: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, 100, &Unlimited)?}170 // Target account is created171 transfer_from_creating {172 bench_init!{173 owner: sub; collection: collection(owner);174 owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;175 };176 let item = create_max_item(&collection, &owner, [(sender.clone(), 200)])?;177 <Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 100)?;178 }: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, 100, &Unlimited)?}179 // Source account is destroyed180 transfer_from_removing {181 bench_init!{182 owner: sub; collection: collection(owner);183 owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;184 };185 let item = create_max_item(&collection, &owner, [(sender.clone(), 200), (receiver.clone(), 200)])?;186 <Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 200)?;187 }: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, 200, &Unlimited)?}188 // Source account destroyed, target created189 transfer_from_creating_removing {190 bench_init!{191 owner: sub; collection: collection(owner);192 owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;193 };194 let item = create_max_item(&collection, &owner, [(sender.clone(), 200)])?;195 <Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 200)?;196 }: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, 200, &Unlimited)?}197198 // Both source account and token is destroyed199 burn_from {200 bench_init!{201 owner: sub; collection: collection(owner);202 owner: cross_from_sub; sender: cross_sub; burner: cross_sub;203 };204 let item = create_max_item(&collection, &owner, [(sender.clone(), 200)])?;205 <Pallet<T>>::set_allowance(&collection, &sender, &burner, item, 200)?;206 }: {<Pallet<T>>::burn_from(&collection, &burner, &sender, item, 200, &Unlimited)?}207208 set_token_property_permissions {209 let b in 0..MAX_PROPERTIES_PER_ITEM;210 bench_init!{211 owner: sub; collection: collection(owner);212 owner: cross_from_sub;213 };214 let perms = (0..b).map(|k| PropertyKeyPermission {215 key: property_key(k as usize),216 permission: PropertyPermission {217 mutable: false,218 collection_admin: false,219 token_owner: false,220 },221 }).collect::<Vec<_>>();222 }: {<Pallet<T>>::set_token_property_permissions(&collection, &owner, perms)?}223224 set_token_properties {225 let b in 0..MAX_PROPERTIES_PER_ITEM;226 bench_init!{227 owner: sub; collection: collection(owner);228 owner: cross_from_sub;229 };230 let perms = (0..b).map(|k| PropertyKeyPermission {231 key: property_key(k as usize),232 permission: PropertyPermission {233 mutable: false,234 collection_admin: true,235 token_owner: true,236 },237 }).collect::<Vec<_>>();238 <Pallet<T>>::set_token_property_permissions(&collection, &owner, perms)?;239 let props = (0..b).map(|k| Property {240 key: property_key(k as usize),241 value: property_value(),242 }).collect::<Vec<_>>();243 let item = create_max_item(&collection, &owner, [(owner.clone(), 200)])?;244 }: {<Pallet<T>>::set_token_properties(&collection, &owner, item, props.into_iter(), false, &Unlimited)?}245246 delete_token_properties {247 let b in 0..MAX_PROPERTIES_PER_ITEM;248 bench_init!{249 owner: sub; collection: collection(owner);250 owner: cross_from_sub;251 };252 let perms = (0..b).map(|k| PropertyKeyPermission {253 key: property_key(k as usize),254 permission: PropertyPermission {255 mutable: true,256 collection_admin: true,257 token_owner: true,258 },259 }).collect::<Vec<_>>();260 <Pallet<T>>::set_token_property_permissions(&collection, &owner, perms)?;261 let props = (0..b).map(|k| Property {262 key: property_key(k as usize),263 value: property_value(),264 }).collect::<Vec<_>>();265 let item = create_max_item(&collection, &owner, [(owner.clone(), 200)])?;266 <Pallet<T>>::set_token_properties(&collection, &owner, item, props.into_iter(), false, &Unlimited)?;267 let to_delete = (0..b).map(|k| property_key(k as usize)).collect::<Vec<_>>();268 }: {<Pallet<T>>::delete_token_properties(&collection, &owner, item, to_delete.into_iter(), &Unlimited)?}269270 repartition_item {271 bench_init!{272 owner: sub; collection: collection(owner);273 sender: cross_from_sub(owner); owner: cross_sub;274 };275 let item = create_max_item(&collection, &sender, [(owner.clone(), 100)])?;276 }: {<Pallet<T>>::repartition(&collection, &owner, item, 200)?}277}pallets/refungible/src/common.rsdiffbeforeafterboth--- a/pallets/refungible/src/common.rs
+++ b/pallets/refungible/src/common.rs
@@ -22,7 +22,7 @@
CollectionId, TokenId, CreateItemExData, CreateRefungibleExData, budget::Budget, Property,
PropertyKey, PropertyValue, PropertyKeyPermission, CreateItemData,
};
-use pallet_common::{CommonCollectionOperations, CommonWeightInfo, RefungibleExtensions, with_weight};
+use pallet_common::{CommonCollectionOperations, CommonWeightInfo, RefungibleExtensions, with_weight, weights::WeightInfo as _};
use pallet_structure::Error as StructureError;
use sp_runtime::{DispatchError};
use sp_std::{vec::Vec, vec};
@@ -67,29 +67,24 @@
max_weight_of!(burn_item_partial(), burn_item_fully())
}
- fn set_collection_properties(_amount: u32) -> Weight {
- // Error
- 0
+ fn set_collection_properties(amount: u32) -> Weight {
+ <pallet_common::SelfWeightOf<T>>::set_collection_properties(amount)
}
- fn delete_collection_properties(_amount: u32) -> Weight {
- // Error
- 0
+ fn delete_collection_properties(amount: u32) -> Weight {
+ <pallet_common::SelfWeightOf<T>>::delete_collection_properties(amount)
}
- fn set_token_properties(_amount: u32) -> Weight {
- // Error
- 0
+ fn set_token_properties(amount: u32) -> Weight {
+ <SelfWeightOf<T>>::set_token_properties(amount)
}
- fn delete_token_properties(_amount: u32) -> Weight {
- // Error
- 0
+ fn delete_token_properties(amount: u32) -> Weight {
+ <SelfWeightOf<T>>::delete_token_properties(amount)
}
- fn set_token_property_permissions(_amount: u32) -> Weight {
- // Error
- 0
+ fn set_token_property_permissions(amount: u32) -> Weight {
+ <SelfWeightOf<T>>::set_token_property_permissions(amount)
}
fn transfer() -> Weight {
pallets/refungible/src/weights.rsdiffbeforeafterboth--- a/pallets/refungible/src/weights.rs
+++ b/pallets/refungible/src/weights.rs
@@ -3,7 +3,7 @@
//! Autogenerated weights for pallet_refungible
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2022-06-27, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! DATE: 2022-07-20, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
// Executed Command:
@@ -49,6 +49,9 @@
fn transfer_from_removing() -> Weight;
fn transfer_from_creating_removing() -> Weight;
fn burn_from() -> Weight;
+ fn set_token_property_permissions(b: u32, ) -> Weight;
+ fn set_token_properties(b: u32, ) -> Weight;
+ fn delete_token_properties(b: u32, ) -> Weight;
fn repartition_item() -> Weight;
}
@@ -62,7 +65,7 @@
// Storage: Refungible TokenData (r:0 w:1)
// Storage: Refungible Owned (r:0 w:1)
fn create_item() -> Weight {
- (17_553_000 as Weight)
+ (21_310_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(6 as Weight))
}
@@ -73,9 +76,9 @@
// Storage: Refungible TokenData (r:0 w:4)
// Storage: Refungible Owned (r:0 w:4)
fn create_multiple_items(b: u32, ) -> Weight {
- (10_654_000 as Weight)
- // Standard Error: 1_000
- .saturating_add((5_114_000 as Weight).saturating_mul(b as Weight))
+ (9_552_000 as Weight)
+ // Standard Error: 2_000
+ .saturating_add((7_056_000 as Weight).saturating_mul(b as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
.saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(b as Weight)))
@@ -87,9 +90,9 @@
// Storage: Refungible TokenData (r:0 w:4)
// Storage: Refungible Owned (r:0 w:4)
fn create_multiple_items_ex_multiple_items(b: u32, ) -> Weight {
- (3_587_000 as Weight)
+ (4_857_000 as Weight)
// Standard Error: 2_000
- .saturating_add((7_931_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add((9_838_000 as Weight).saturating_mul(b as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
@@ -102,9 +105,9 @@
// Storage: Refungible Balance (r:0 w:4)
// Storage: Refungible Owned (r:0 w:4)
fn create_multiple_items_ex_multiple_owners(b: u32, ) -> Weight {
- (1_980_000 as Weight)
+ (11_335_000 as Weight)
// Standard Error: 2_000
- .saturating_add((6_305_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add((6_784_000 as Weight).saturating_mul(b as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
@@ -115,7 +118,7 @@
// Storage: Refungible AccountBalance (r:1 w:1)
// Storage: Refungible Owned (r:0 w:1)
fn burn_item_partial() -> Weight {
- (21_010_000 as Weight)
+ (21_239_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
@@ -125,14 +128,15 @@
// Storage: Refungible TokensBurnt (r:1 w:1)
// Storage: Refungible TokenData (r:0 w:1)
// Storage: Refungible Owned (r:0 w:1)
+ // Storage: Refungible TokenProperties (r:0 w:1)
fn burn_item_fully() -> Weight {
- (28_413_000 as Weight)
+ (29_426_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
- .saturating_add(T::DbWeight::get().writes(6 as Weight))
+ .saturating_add(T::DbWeight::get().writes(7 as Weight))
}
// Storage: Refungible Balance (r:2 w:2)
fn transfer_normal() -> Weight {
- (17_513_000 as Weight)
+ (17_743_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
@@ -140,7 +144,7 @@
// Storage: Refungible AccountBalance (r:1 w:1)
// Storage: Refungible Owned (r:0 w:1)
fn transfer_creating() -> Weight {
- (20_469_000 as Weight)
+ (20_699_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
@@ -148,7 +152,7 @@
// Storage: Refungible AccountBalance (r:1 w:1)
// Storage: Refungible Owned (r:0 w:1)
fn transfer_removing() -> Weight {
- (22_472_000 as Weight)
+ (22_833_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
@@ -156,21 +160,21 @@
// Storage: Refungible AccountBalance (r:2 w:2)
// Storage: Refungible Owned (r:0 w:2)
fn transfer_creating_removing() -> Weight {
- (24_866_000 as Weight)
+ (24_936_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(6 as Weight))
}
// Storage: Refungible Balance (r:1 w:0)
// Storage: Refungible Allowance (r:0 w:1)
fn approve() -> Weight {
- (13_475_000 as Weight)
+ (13_446_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Refungible Allowance (r:1 w:1)
// Storage: Refungible Balance (r:2 w:2)
fn transfer_from_normal() -> Weight {
- (24_707_000 as Weight)
+ (24_777_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
@@ -179,7 +183,7 @@
// Storage: Refungible AccountBalance (r:1 w:1)
// Storage: Refungible Owned (r:0 w:1)
fn transfer_from_creating() -> Weight {
- (27_812_000 as Weight)
+ (28_483_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
}
@@ -188,7 +192,7 @@
// Storage: Refungible AccountBalance (r:1 w:1)
// Storage: Refungible Owned (r:0 w:1)
fn transfer_from_removing() -> Weight {
- (29_966_000 as Weight)
+ (29_896_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
}
@@ -197,7 +201,7 @@
// Storage: Refungible AccountBalance (r:2 w:2)
// Storage: Refungible Owned (r:0 w:2)
fn transfer_from_creating_removing() -> Weight {
- (31_660_000 as Weight)
+ (32_070_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(7 as Weight))
}
@@ -208,15 +212,42 @@
// Storage: Refungible TokensBurnt (r:1 w:1)
// Storage: Refungible TokenData (r:0 w:1)
// Storage: Refungible Owned (r:0 w:1)
+ // Storage: Refungible TokenProperties (r:0 w:1)
fn burn_from() -> Weight {
- (36_248_000 as Weight)
+ (36_789_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
- .saturating_add(T::DbWeight::get().writes(7 as Weight))
+ .saturating_add(T::DbWeight::get().writes(8 as Weight))
+ }
+ // Storage: Common CollectionPropertyPermissions (r:1 w:1)
+ fn set_token_property_permissions(b: u32, ) -> Weight {
+ (0 as Weight)
+ // Standard Error: 62_000
+ .saturating_add((15_803_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(T::DbWeight::get().reads(1 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
+ // Storage: Refungible TokenProperties (r:1 w:1)
+ fn set_token_properties(b: u32, ) -> Weight {
+ (0 as Weight)
+ // Standard Error: 1_668_000
+ .saturating_add((302_308_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
+ }
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
+ // Storage: Refungible TokenProperties (r:1 w:1)
+ fn delete_token_properties(b: u32, ) -> Weight {
+ (0 as Weight)
+ // Standard Error: 1_619_000
+ .saturating_add((294_574_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Refungible TotalSupply (r:1 w:1)
// Storage: Refungible Balance (r:1 w:1)
fn repartition_item() -> Weight {
- (8_226_000 as Weight)
+ (8_325_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
@@ -231,7 +262,7 @@
// Storage: Refungible TokenData (r:0 w:1)
// Storage: Refungible Owned (r:0 w:1)
fn create_item() -> Weight {
- (17_553_000 as Weight)
+ (21_310_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(6 as Weight))
}
@@ -242,9 +273,9 @@
// Storage: Refungible TokenData (r:0 w:4)
// Storage: Refungible Owned (r:0 w:4)
fn create_multiple_items(b: u32, ) -> Weight {
- (10_654_000 as Weight)
- // Standard Error: 1_000
- .saturating_add((5_114_000 as Weight).saturating_mul(b as Weight))
+ (9_552_000 as Weight)
+ // Standard Error: 2_000
+ .saturating_add((7_056_000 as Weight).saturating_mul(b as Weight))
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
.saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(b as Weight)))
@@ -256,9 +287,9 @@
// Storage: Refungible TokenData (r:0 w:4)
// Storage: Refungible Owned (r:0 w:4)
fn create_multiple_items_ex_multiple_items(b: u32, ) -> Weight {
- (3_587_000 as Weight)
+ (4_857_000 as Weight)
// Standard Error: 2_000
- .saturating_add((7_931_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add((9_838_000 as Weight).saturating_mul(b as Weight))
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
@@ -271,9 +302,9 @@
// Storage: Refungible Balance (r:0 w:4)
// Storage: Refungible Owned (r:0 w:4)
fn create_multiple_items_ex_multiple_owners(b: u32, ) -> Weight {
- (1_980_000 as Weight)
+ (11_335_000 as Weight)
// Standard Error: 2_000
- .saturating_add((6_305_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add((6_784_000 as Weight).saturating_mul(b as Weight))
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
@@ -284,7 +315,7 @@
// Storage: Refungible AccountBalance (r:1 w:1)
// Storage: Refungible Owned (r:0 w:1)
fn burn_item_partial() -> Weight {
- (21_010_000 as Weight)
+ (21_239_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(4 as Weight))
}
@@ -294,14 +325,15 @@
// Storage: Refungible TokensBurnt (r:1 w:1)
// Storage: Refungible TokenData (r:0 w:1)
// Storage: Refungible Owned (r:0 w:1)
+ // Storage: Refungible TokenProperties (r:0 w:1)
fn burn_item_fully() -> Weight {
- (28_413_000 as Weight)
+ (29_426_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
- .saturating_add(RocksDbWeight::get().writes(6 as Weight))
+ .saturating_add(RocksDbWeight::get().writes(7 as Weight))
}
// Storage: Refungible Balance (r:2 w:2)
fn transfer_normal() -> Weight {
- (17_513_000 as Weight)
+ (17_743_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
@@ -309,7 +341,7 @@
// Storage: Refungible AccountBalance (r:1 w:1)
// Storage: Refungible Owned (r:0 w:1)
fn transfer_creating() -> Weight {
- (20_469_000 as Weight)
+ (20_699_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(4 as Weight))
}
@@ -317,7 +349,7 @@
// Storage: Refungible AccountBalance (r:1 w:1)
// Storage: Refungible Owned (r:0 w:1)
fn transfer_removing() -> Weight {
- (22_472_000 as Weight)
+ (22_833_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(4 as Weight))
}
@@ -325,21 +357,21 @@
// Storage: Refungible AccountBalance (r:2 w:2)
// Storage: Refungible Owned (r:0 w:2)
fn transfer_creating_removing() -> Weight {
- (24_866_000 as Weight)
+ (24_936_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(6 as Weight))
}
// Storage: Refungible Balance (r:1 w:0)
// Storage: Refungible Allowance (r:0 w:1)
fn approve() -> Weight {
- (13_475_000 as Weight)
+ (13_446_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Refungible Allowance (r:1 w:1)
// Storage: Refungible Balance (r:2 w:2)
fn transfer_from_normal() -> Weight {
- (24_707_000 as Weight)
+ (24_777_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
}
@@ -348,7 +380,7 @@
// Storage: Refungible AccountBalance (r:1 w:1)
// Storage: Refungible Owned (r:0 w:1)
fn transfer_from_creating() -> Weight {
- (27_812_000 as Weight)
+ (28_483_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(5 as Weight))
}
@@ -357,7 +389,7 @@
// Storage: Refungible AccountBalance (r:1 w:1)
// Storage: Refungible Owned (r:0 w:1)
fn transfer_from_removing() -> Weight {
- (29_966_000 as Weight)
+ (29_896_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(5 as Weight))
}
@@ -366,7 +398,7 @@
// Storage: Refungible AccountBalance (r:2 w:2)
// Storage: Refungible Owned (r:0 w:2)
fn transfer_from_creating_removing() -> Weight {
- (31_660_000 as Weight)
+ (32_070_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(5 as Weight))
.saturating_add(RocksDbWeight::get().writes(7 as Weight))
}
@@ -377,15 +409,42 @@
// Storage: Refungible TokensBurnt (r:1 w:1)
// Storage: Refungible TokenData (r:0 w:1)
// Storage: Refungible Owned (r:0 w:1)
+ // Storage: Refungible TokenProperties (r:0 w:1)
fn burn_from() -> Weight {
- (36_248_000 as Weight)
+ (36_789_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(5 as Weight))
- .saturating_add(RocksDbWeight::get().writes(7 as Weight))
+ .saturating_add(RocksDbWeight::get().writes(8 as Weight))
+ }
+ // Storage: Common CollectionPropertyPermissions (r:1 w:1)
+ fn set_token_property_permissions(b: u32, ) -> Weight {
+ (0 as Weight)
+ // Standard Error: 62_000
+ .saturating_add((15_803_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(RocksDbWeight::get().reads(1 as Weight))
+ .saturating_add(RocksDbWeight::get().writes(1 as Weight))
+ }
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
+ // Storage: Refungible TokenProperties (r:1 w:1)
+ fn set_token_properties(b: u32, ) -> Weight {
+ (0 as Weight)
+ // Standard Error: 1_668_000
+ .saturating_add((302_308_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(RocksDbWeight::get().reads(2 as Weight))
+ .saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
+ // Storage: Common CollectionPropertyPermissions (r:1 w:0)
+ // Storage: Refungible TokenProperties (r:1 w:1)
+ fn delete_token_properties(b: u32, ) -> Weight {
+ (0 as Weight)
+ // Standard Error: 1_619_000
+ .saturating_add((294_574_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(RocksDbWeight::get().reads(2 as Weight))
+ .saturating_add(RocksDbWeight::get().writes(1 as Weight))
+ }
// Storage: Refungible TotalSupply (r:1 w:1)
// Storage: Refungible Balance (r:1 w:1)
fn repartition_item() -> Weight {
- (8_226_000 as Weight)
+ (8_325_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}