git.delta.rocks / unique-network / refs/commits / 1d469f4695cf

difftreelog

feat(refungible) benchmarking

Yaroslav Bolyukin2021-10-22parent: #4e1bd65.patch.diff
in: master

5 files changed

modifiedpallets/refungible/Cargo.tomldiffbeforeafterboth
17sp-core = { default-features = false, version = '4.0.0-dev', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.10' }17sp-core = { default-features = false, version = '4.0.0-dev', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.10' }
18pallet-common = { default-features = false, path = '../common' }18pallet-common = { default-features = false, path = '../common' }
19nft-data-structs = { default-features = false, path = '../../primitives/nft' }19nft-data-structs = { default-features = false, path = '../../primitives/nft' }
20frame-benchmarking = { default-features = false, optional = true, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.10' }
2021
21[features]22[features]
22default = ["std"]23default = ["std"]
27 "sp-std/std",28 "sp-std/std",
28 "nft-data-structs/std",29 "nft-data-structs/std",
29 "pallet-common/std",30 "pallet-common/std",
31 'frame-benchmarking/std',
30]32]
31runtime-benchmarks = []33runtime-benchmarks = [
34 'frame-benchmarking',
35 'frame-support/runtime-benchmarks',
36 'frame-system/runtime-benchmarks',
37]
3238
modifiedpallets/refungible/src/benchmarking.rsdiffbeforeafterboth
1use super::*;
2use crate::{Pallet, Config, RefungibleHandle};
3
4use sp_std::prelude::*;
5use pallet_common::benchmarking::{create_collection_raw, create_data};
6use frame_benchmarking::{benchmarks, account};
7use nft_data_structs::{CollectionMode, MAX_ITEMS_PER_BATCH};
8use pallet_common::bench_init;
9use core::convert::TryInto;
10use core::iter::IntoIterator;
11
12const SEED: u32 = 1;
13
14fn create_max_item_data<T: Config>(
15 users: impl IntoIterator<Item = (T::CrossAccountId, u128)>,
16) -> CreateItemData<T> {
17 let const_data = create_data(CUSTOM_DATA_LIMIT as usize).try_into().unwrap();
18 let variable_data = create_data(CUSTOM_DATA_LIMIT as usize).try_into().unwrap();
19 CreateItemData {
20 const_data,
21 variable_data,
22 users: users.into_iter().collect(),
23 }
24}
25fn create_max_item<T: Config>(
26 collection: &RefungibleHandle<T>,
27 sender: &T::CrossAccountId,
28 users: impl IntoIterator<Item = (T::CrossAccountId, u128)>,
29) -> Result<TokenId, DispatchError> {
30 <Pallet<T>>::create_item(&collection, sender, create_max_item_data(users))?;
31 Ok(TokenId(<TokensMinted<T>>::get(&collection.id)))
32}
33
34fn create_collection<T: Config>(owner: T::AccountId) -> Result<RefungibleHandle<T>, DispatchError> {
35 create_collection_raw(
36 owner,
37 CollectionMode::NFT,
38 <Pallet<T>>::init_collection,
39 RefungibleHandle::cast,
40 )
41}
1#![cfg(feature = "runtime-benchmarking")]42benchmarks! {
43 create_item {
44 bench_init!{
45 owner: sub; collection: collection(owner);
46 sender: cross_from_sub(owner); to: cross_sub;
47 };
48 }: {create_max_item(&collection, &sender, [(to.clone(), 200)])?}
49
50 create_multiple_items {
51 let b in 0..MAX_ITEMS_PER_BATCH;
52 bench_init!{
53 owner: sub; collection: collection(owner);
54 sender: cross_from_sub(owner); to: cross_sub;
55 };
56 let data = (0..b).map(|_| create_max_item_data([(to.clone(), 200)])).collect();
57 }: {<Pallet<T>>::create_multiple_items(&collection, &sender, data)?}
58
59 // Other user left, token data is kept
60 burn_item_partial {
61 bench_init!{
62 owner: sub; collection: collection(owner);
63 sender: cross_from_sub(owner); burner: cross_sub; another_owner: cross_sub;
64 };
65 let item = create_max_item(&collection, &sender, [(burner.clone(), 200), (another_owner, 200)])?;
66 }: {<Pallet<T>>::burn(&collection, &burner, item, 200)?}
67 // No users remaining, token is destroyed
68 burn_item_fully {
69 bench_init!{
70 owner: sub; collection: collection(owner);
71 sender: cross_from_sub(owner); burner: cross_sub; another_owner: cross_sub;
72 };
73 let item = create_max_item(&collection, &sender, [(burner.clone(), 200)])?;
74 }: {<Pallet<T>>::burn(&collection, &burner, item, 200)?}
75
76 transfer_normal {
77 bench_init!{
78 owner: sub; collection: collection(owner);
79 sender: cross_from_sub(owner); receiver: cross_sub;
80 };
81 let item = create_max_item(&collection, &sender, [(sender.clone(), 200), (receiver.clone(), 200)])?;
82 }: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, 100)?}
83 // Target account is created
84 transfer_creating {
85 bench_init!{
86 owner: sub; collection: collection(owner);
87 sender: cross_from_sub(owner); receiver: cross_sub;
88 };
89 let item = create_max_item(&collection, &sender, [(sender.clone(), 200)])?;
90 }: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, 100)?}
91 // Source account is destroyed
92 transfer_removing {
93 bench_init!{
94 owner: sub; collection: collection(owner);
95 sender: cross_from_sub(owner); receiver: cross_sub;
96 };
97 let item = create_max_item(&collection, &sender, [(sender.clone(), 200), (receiver.clone(), 200)])?;
98 }: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, 200)?}
99 // Source account destroyed, target created
100 transfer_creating_removing {
101 bench_init!{
102 owner: sub; collection: collection(owner);
103 sender: cross_from_sub(owner); receiver: cross_sub;
104 };
105 let item = create_max_item(&collection, &sender, [(sender.clone(), 200)])?;
106 }: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, 200)?}
107
108 approve {
109 bench_init!{
110 owner: sub; collection: collection(owner);
111 owner: cross_from_sub; sender: cross_sub; spender: cross_sub;
112 };
113 let item = create_max_item(&collection, &owner, [(sender.clone(), 200)])?;
114 }: {<Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 100)?}
115
116 transfer_from_normal {
117 bench_init!{
118 owner: sub; collection: collection(owner);
119 owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;
120 };
121 let item = create_max_item(&collection, &owner, [(sender.clone(), 200), (receiver.clone(), 200)])?;
122 <Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 100)?;
123 }: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, 100)?}
124 // Target account is created
125 transfer_from_creating {
126 bench_init!{
127 owner: sub; collection: collection(owner);
128 owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;
129 };
130 let item = create_max_item(&collection, &owner, [(sender.clone(), 200)])?;
131 <Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 100)?;
132 }: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, 100)?}
133 // Source account is destroyed
134 transfer_from_removing {
135 bench_init!{
136 owner: sub; collection: collection(owner);
137 owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;
138 };
139 let item = create_max_item(&collection, &owner, [(sender.clone(), 200), (receiver.clone(), 200)])?;
140 <Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 200)?;
141 }: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, 200)?}
142 // Source account destroyed, target created
143 transfer_from_creating_removing {
144 bench_init!{
145 owner: sub; collection: collection(owner);
146 owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;
147 };
148 let item = create_max_item(&collection, &owner, [(sender.clone(), 200)])?;
149 <Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 200)?;
150 }: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, 200)?}
151
152 set_variable_metadata {
153 let b in 0..CUSTOM_DATA_LIMIT;
154 bench_init!{
155 owner: sub; collection: collection(owner);
156 sender: cross_from_sub(owner);
157 };
158 let item = create_max_item(&collection, &sender, [(sender.clone(), 200)])?;
159 let data = create_data(b as usize);
160 }: {<Pallet<T>>::set_variable_metadata(&collection, &sender, item, data)?}
161}
2162
modifiedpallets/refungible/src/common.rsdiffbeforeafterboth
14 RefungibleHandle, SelfWeightOf, TokenData, weights::WeightInfo, TokensMinted,14 RefungibleHandle, SelfWeightOf, TokenData, weights::WeightInfo, TokensMinted,
15};15};
16
17macro_rules! max_weight_of {
18 ($($method:ident ($($args:tt)*)),*) => {
19 0
20 $(
21 .max(<SelfWeightOf<T>>::$method($($args)*))
22 )*
23 };
24}
1625
17pub struct CommonWeights<T: Config>(PhantomData<T>);26pub struct CommonWeights<T: Config>(PhantomData<T>);
18impl<T: Config> CommonWeightInfo for CommonWeights<T> {27impl<T: Config> CommonWeightInfo for CommonWeights<T> {
25 }34 }
2635
27 fn burn_item() -> Weight {36 fn burn_item() -> Weight {
28 <SelfWeightOf<T>>::burn_item()37 max_weight_of!(burn_item_partial(), burn_item_fully())
29 }38 }
3039
31 fn transfer() -> Weight {40 fn transfer() -> Weight {
41 max_weight_of!(
42 transfer_normal(),
43 transfer_creating(),
44 transfer_removing(),
32 <SelfWeightOf<T>>::transfer()45 transfer_creating_removing()
46 )
33 }47 }
3448
35 fn approve() -> Weight {49 fn approve() -> Weight {
36 <SelfWeightOf<T>>::approve()50 <SelfWeightOf<T>>::approve()
37 }51 }
3852
39 fn transfer_from() -> Weight {53 fn transfer_from() -> Weight {
54 max_weight_of!(
55 transfer_from_normal(),
56 transfer_from_creating(),
57 transfer_from_removing(),
40 <SelfWeightOf<T>>::transfer_from()58 transfer_from_creating_removing()
59 )
41 }60 }
4261
43 fn set_variable_metadata(_bytes: u32) -> Weight {62 fn set_variable_metadata(bytes: u32) -> Weight {
44 <SelfWeightOf<T>>::set_variable_metadata()63 <SelfWeightOf<T>>::set_variable_metadata(bytes)
45 }64 }
46}65}
4766
72 ) -> DispatchResultWithPostInfo {91 ) -> DispatchResultWithPostInfo {
73 with_weight(92 with_weight(
74 <Pallet<T>>::create_item(self, &sender, map_create_data(data, &to)?),93 <Pallet<T>>::create_item(self, &sender, map_create_data(data, &to)?),
75 <SelfWeightOf<T>>::create_item(),94 <CommonWeights<T>>::create_item(),
76 )95 )
77 }96 }
7897
90 let amount = data.len();109 let amount = data.len();
91 with_weight(110 with_weight(
92 <Pallet<T>>::create_multiple_items(self, &sender, data),111 <Pallet<T>>::create_multiple_items(self, &sender, data),
93 <SelfWeightOf<T>>::create_multiple_items(amount as u32),112 <CommonWeights<T>>::create_multiple_items(amount as u32),
94 )113 )
95 }114 }
96115
102 ) -> DispatchResultWithPostInfo {121 ) -> DispatchResultWithPostInfo {
103 with_weight(122 with_weight(
104 <Pallet<T>>::burn(self, &sender, token, amount),123 <Pallet<T>>::burn(self, &sender, token, amount),
105 <SelfWeightOf<T>>::burn_item(),124 <CommonWeights<T>>::burn_item(),
106 )125 )
107 }126 }
108127
115 ) -> DispatchResultWithPostInfo {134 ) -> DispatchResultWithPostInfo {
116 with_weight(135 with_weight(
117 <Pallet<T>>::transfer(&self, &from, &to, token, amount),136 <Pallet<T>>::transfer(&self, &from, &to, token, amount),
118 <SelfWeightOf<T>>::transfer(),137 <CommonWeights<T>>::transfer(),
119 )138 )
120 }139 }
121140
128 ) -> DispatchResultWithPostInfo {147 ) -> DispatchResultWithPostInfo {
129 with_weight(148 with_weight(
130 <Pallet<T>>::set_allowance(&self, &sender, &spender, token, amount),149 <Pallet<T>>::set_allowance(&self, &sender, &spender, token, amount),
131 <SelfWeightOf<T>>::approve(),150 <CommonWeights<T>>::approve(),
132 )151 )
133 }152 }
134153
142 ) -> DispatchResultWithPostInfo {161 ) -> DispatchResultWithPostInfo {
143 with_weight(162 with_weight(
144 <Pallet<T>>::transfer_from(&self, &sender, &from, &to, token, amount),163 <Pallet<T>>::transfer_from(&self, &sender, &from, &to, token, amount),
145 <SelfWeightOf<T>>::approve(),164 <CommonWeights<T>>::approve(),
146 )165 )
147 }166 }
148167
152 token: TokenId,171 token: TokenId,
153 data: Vec<u8>,172 data: Vec<u8>,
154 ) -> DispatchResultWithPostInfo {173 ) -> DispatchResultWithPostInfo {
174 let len = data.len();
155 with_weight(175 with_weight(
156 <Pallet<T>>::set_variable_metadata(&self, &sender, token, data),176 <Pallet<T>>::set_variable_metadata(&self, &sender, token, data),
157 <SelfWeightOf<T>>::set_variable_metadata(),177 <CommonWeights<T>>::set_variable_metadata(len as u32),
158 )178 )
159 }179 }
160180
modifiedpallets/refungible/src/lib.rsdiffbeforeafterboth
14use codec::{Encode, Decode};14use codec::{Encode, Decode};
1515
16pub use pallet::*;16pub use pallet::*;
17#[cfg(feature = "runtime-benchmarks")]
17pub mod benchmarking;18pub mod benchmarking;
18pub mod common;19pub mod common;
19pub mod erc;20pub mod erc;
modifiedpallets/refungible/src/weights.rsdiffbeforeafterboth
1// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs
2
3//! Autogenerated weights for pallet_refungible
4//!
5//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
6//! DATE: 2021-10-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
7//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 128
8
9// Executed Command:
10// target/release/nft
11// benchmark
12// --pallet
13// pallet-refungible
14// --wasm-execution
15// compiled
16// --extrinsic
17// *
18// --template
19// .maintain/frame-weight-template.hbs
20// --steps=50
21// --repeat=20
22// --output=./pallets/refungible/src/weights.rs
23
24
1#![cfg_attr(rustfmt, rustfmt_skip)]25#![cfg_attr(rustfmt, rustfmt_skip)]
5use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};29use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
6use sp_std::marker::PhantomData;30use sp_std::marker::PhantomData;
731
32/// Weight functions needed for pallet_refungible.
8pub trait WeightInfo {33pub trait WeightInfo {
9 fn create_item() -> Weight;34 fn create_item() -> Weight;
10 fn create_multiple_items(b: u32) -> Weight;35 fn create_multiple_items(b: u32, ) -> Weight;
11 fn burn_item() -> Weight;36 fn burn_item_partial() -> Weight;
12 fn transfer() -> Weight;37 fn burn_item_fully() -> Weight;
38 fn transfer_normal() -> Weight;
39 fn transfer_creating() -> Weight;
40 fn transfer_removing() -> Weight;
41 fn transfer_creating_removing() -> Weight;
13 fn approve() -> Weight;42 fn approve() -> Weight;
14 fn transfer_from() -> Weight;43 fn transfer_from_normal() -> Weight;
44 fn transfer_from_creating() -> Weight;
45 fn transfer_from_removing() -> Weight;
46 fn transfer_from_creating_removing() -> Weight;
15 fn set_variable_metadata() -> Weight;47 fn set_variable_metadata(b: u32, ) -> Weight;
16}48}
1749
50/// Weights for pallet_refungible using the Substrate node and recommended hardware.
18pub struct SubstrateWeight<T>(PhantomData<T>);51pub struct SubstrateWeight<T>(PhantomData<T>);
19impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {52impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
53 // Storage: Refungible TokensMinted (r:1 w:1)
54 // Storage: Refungible AccountBalance (r:1 w:1)
55 // Storage: Refungible Balance (r:0 w:1)
56 // Storage: Refungible TotalSupply (r:0 w:1)
57 // Storage: Refungible TokenData (r:0 w:1)
58 // Storage: Refungible Owned (r:0 w:1)
20 fn create_item() -> Weight {0}59 fn create_item() -> Weight {
60 (18_681_000 as Weight)
61 .saturating_add(T::DbWeight::get().reads(2 as Weight))
62 .saturating_add(T::DbWeight::get().writes(6 as Weight))
63 }
64 // Storage: Refungible TokensMinted (r:1 w:1)
65 // Storage: Refungible AccountBalance (r:1 w:1)
66 // Storage: Refungible Balance (r:0 w:4)
67 // Storage: Refungible TotalSupply (r:0 w:4)
68 // Storage: Refungible TokenData (r:0 w:4)
69 // Storage: Refungible Owned (r:0 w:4)
21 fn create_multiple_items(_b: u32) -> Weight {0}70 fn create_multiple_items(b: u32, ) -> Weight {
71 (13_869_000 as Weight)
72 // Standard Error: 28_000
73 .saturating_add((5_611_000 as Weight).saturating_mul(b as Weight))
74 .saturating_add(T::DbWeight::get().reads(2 as Weight))
75 .saturating_add(T::DbWeight::get().writes(2 as Weight))
76 .saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(b as Weight)))
77 }
78 // Storage: Refungible TotalSupply (r:1 w:1)
79 // Storage: Refungible Balance (r:1 w:1)
80 // Storage: Refungible AccountBalance (r:1 w:1)
81 // Storage: Refungible Owned (r:0 w:1)
22 fn burn_item() -> Weight {0}82 fn burn_item_partial() -> Weight {
83 (21_591_000 as Weight)
84 .saturating_add(T::DbWeight::get().reads(3 as Weight))
85 .saturating_add(T::DbWeight::get().writes(4 as Weight))
86 }
87 // Storage: Refungible TotalSupply (r:1 w:1)
88 // Storage: Refungible Balance (r:1 w:1)
89 // Storage: Refungible AccountBalance (r:1 w:1)
90 // Storage: Refungible TokensBurnt (r:1 w:1)
91 // Storage: Refungible TokenData (r:0 w:1)
92 // Storage: Refungible Owned (r:0 w:1)
23 fn transfer() -> Weight {0}93 fn burn_item_fully() -> Weight {
94 (29_257_000 as Weight)
95 .saturating_add(T::DbWeight::get().reads(4 as Weight))
96 .saturating_add(T::DbWeight::get().writes(6 as Weight))
97 }
98 // Storage: Refungible Balance (r:2 w:2)
99 fn transfer_normal() -> Weight {
100 (17_733_000 as Weight)
101 .saturating_add(T::DbWeight::get().reads(2 as Weight))
102 .saturating_add(T::DbWeight::get().writes(2 as Weight))
103 }
104 // Storage: Refungible Balance (r:2 w:2)
105 // Storage: Refungible AccountBalance (r:1 w:1)
106 // Storage: Refungible Owned (r:0 w:1)
107 fn transfer_creating() -> Weight {
108 (20_943_000 as Weight)
109 .saturating_add(T::DbWeight::get().reads(3 as Weight))
110 .saturating_add(T::DbWeight::get().writes(4 as Weight))
111 }
112 // Storage: Refungible Balance (r:2 w:2)
113 // Storage: Refungible AccountBalance (r:1 w:1)
114 // Storage: Refungible Owned (r:0 w:1)
115 fn transfer_removing() -> Weight {
116 (22_406_000 as Weight)
117 .saturating_add(T::DbWeight::get().reads(3 as Weight))
118 .saturating_add(T::DbWeight::get().writes(4 as Weight))
119 }
120 // Storage: Refungible Balance (r:2 w:2)
121 // Storage: Refungible AccountBalance (r:2 w:2)
122 // Storage: Refungible Owned (r:0 w:2)
123 fn transfer_creating_removing() -> Weight {
124 (24_762_000 as Weight)
125 .saturating_add(T::DbWeight::get().reads(4 as Weight))
126 .saturating_add(T::DbWeight::get().writes(6 as Weight))
127 }
128 // Storage: Refungible Balance (r:1 w:0)
129 // Storage: Refungible Allowance (r:0 w:1)
24 fn approve() -> Weight {0}130 fn approve() -> Weight {
131 (14_109_000 as Weight)
132 .saturating_add(T::DbWeight::get().reads(1 as Weight))
133 .saturating_add(T::DbWeight::get().writes(1 as Weight))
134 }
135 // Storage: Refungible Allowance (r:1 w:1)
136 // Storage: Refungible Balance (r:2 w:2)
25 fn transfer_from() -> Weight {0}137 fn transfer_from_normal() -> Weight {
138 (25_348_000 as Weight)
139 .saturating_add(T::DbWeight::get().reads(3 as Weight))
140 .saturating_add(T::DbWeight::get().writes(3 as Weight))
141 }
142 // Storage: Refungible Allowance (r:1 w:1)
143 // Storage: Refungible Balance (r:2 w:2)
144 // Storage: Refungible AccountBalance (r:1 w:1)
145 // Storage: Refungible Owned (r:0 w:1)
146 fn transfer_from_creating() -> Weight {
147 (28_647_000 as Weight)
148 .saturating_add(T::DbWeight::get().reads(4 as Weight))
149 .saturating_add(T::DbWeight::get().writes(5 as Weight))
150 }
151 // Storage: Refungible Allowance (r:1 w:1)
152 // Storage: Refungible Balance (r:2 w:2)
153 // Storage: Refungible AccountBalance (r:1 w:1)
154 // Storage: Refungible Owned (r:0 w:1)
155 fn transfer_from_removing() -> Weight {
156 (30_472_000 as Weight)
157 .saturating_add(T::DbWeight::get().reads(4 as Weight))
158 .saturating_add(T::DbWeight::get().writes(5 as Weight))
159 }
160 // Storage: Refungible Allowance (r:1 w:1)
161 // Storage: Refungible Balance (r:2 w:2)
162 // Storage: Refungible AccountBalance (r:2 w:2)
163 // Storage: Refungible Owned (r:0 w:2)
164 fn transfer_from_creating_removing() -> Weight {
165 (32_362_000 as Weight)
166 .saturating_add(T::DbWeight::get().reads(5 as Weight))
167 .saturating_add(T::DbWeight::get().writes(7 as Weight))
168 }
169 // Storage: Refungible TokenData (r:1 w:1)
26 fn set_variable_metadata() -> Weight {0}170 fn set_variable_metadata(_b: u32, ) -> Weight {
171 (6_801_000 as Weight)
172 .saturating_add(T::DbWeight::get().reads(1 as Weight))
173 .saturating_add(T::DbWeight::get().writes(1 as Weight))
174 }
27}175}
28176
177// For backwards compatibility and tests
29impl WeightInfo for () {178impl WeightInfo for () {
179 // Storage: Refungible TokensMinted (r:1 w:1)
180 // Storage: Refungible AccountBalance (r:1 w:1)
181 // Storage: Refungible Balance (r:0 w:1)
182 // Storage: Refungible TotalSupply (r:0 w:1)
183 // Storage: Refungible TokenData (r:0 w:1)
184 // Storage: Refungible Owned (r:0 w:1)
30 fn create_item() -> Weight {0}185 fn create_item() -> Weight {
186 (18_681_000 as Weight)
187 .saturating_add(RocksDbWeight::get().reads(2 as Weight))
188 .saturating_add(RocksDbWeight::get().writes(6 as Weight))
189 }
190 // Storage: Refungible TokensMinted (r:1 w:1)
191 // Storage: Refungible AccountBalance (r:1 w:1)
192 // Storage: Refungible Balance (r:0 w:4)
193 // Storage: Refungible TotalSupply (r:0 w:4)
194 // Storage: Refungible TokenData (r:0 w:4)
195 // Storage: Refungible Owned (r:0 w:4)
31 fn create_multiple_items(_b: u32) -> Weight {0}196 fn create_multiple_items(b: u32, ) -> Weight {
197 (13_869_000 as Weight)
198 // Standard Error: 28_000
199 .saturating_add((5_611_000 as Weight).saturating_mul(b as Weight))
200 .saturating_add(RocksDbWeight::get().reads(2 as Weight))
201 .saturating_add(RocksDbWeight::get().writes(2 as Weight))
202 .saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(b as Weight)))
203 }
204 // Storage: Refungible TotalSupply (r:1 w:1)
205 // Storage: Refungible Balance (r:1 w:1)
206 // Storage: Refungible AccountBalance (r:1 w:1)
207 // Storage: Refungible Owned (r:0 w:1)
32 fn burn_item() -> Weight {0}208 fn burn_item_partial() -> Weight {
209 (21_591_000 as Weight)
210 .saturating_add(RocksDbWeight::get().reads(3 as Weight))
211 .saturating_add(RocksDbWeight::get().writes(4 as Weight))
212 }
213 // Storage: Refungible TotalSupply (r:1 w:1)
214 // Storage: Refungible Balance (r:1 w:1)
215 // Storage: Refungible AccountBalance (r:1 w:1)
216 // Storage: Refungible TokensBurnt (r:1 w:1)
217 // Storage: Refungible TokenData (r:0 w:1)
218 // Storage: Refungible Owned (r:0 w:1)
33 fn transfer() -> Weight {0}219 fn burn_item_fully() -> Weight {
220 (29_257_000 as Weight)
221 .saturating_add(RocksDbWeight::get().reads(4 as Weight))
222 .saturating_add(RocksDbWeight::get().writes(6 as Weight))
223 }
224 // Storage: Refungible Balance (r:2 w:2)
225 fn transfer_normal() -> Weight {
226 (17_733_000 as Weight)
227 .saturating_add(RocksDbWeight::get().reads(2 as Weight))
228 .saturating_add(RocksDbWeight::get().writes(2 as Weight))
229 }
230 // Storage: Refungible Balance (r:2 w:2)
231 // Storage: Refungible AccountBalance (r:1 w:1)
232 // Storage: Refungible Owned (r:0 w:1)
233 fn transfer_creating() -> Weight {
234 (20_943_000 as Weight)
235 .saturating_add(RocksDbWeight::get().reads(3 as Weight))
236 .saturating_add(RocksDbWeight::get().writes(4 as Weight))
237 }
238 // Storage: Refungible Balance (r:2 w:2)
239 // Storage: Refungible AccountBalance (r:1 w:1)
240 // Storage: Refungible Owned (r:0 w:1)
241 fn transfer_removing() -> Weight {
242 (22_406_000 as Weight)
243 .saturating_add(RocksDbWeight::get().reads(3 as Weight))
244 .saturating_add(RocksDbWeight::get().writes(4 as Weight))
245 }
246 // Storage: Refungible Balance (r:2 w:2)
247 // Storage: Refungible AccountBalance (r:2 w:2)
248 // Storage: Refungible Owned (r:0 w:2)
249 fn transfer_creating_removing() -> Weight {
250 (24_762_000 as Weight)
251 .saturating_add(RocksDbWeight::get().reads(4 as Weight))
252 .saturating_add(RocksDbWeight::get().writes(6 as Weight))
253 }
254 // Storage: Refungible Balance (r:1 w:0)
255 // Storage: Refungible Allowance (r:0 w:1)
34 fn approve() -> Weight {0}256 fn approve() -> Weight {
257 (14_109_000 as Weight)
258 .saturating_add(RocksDbWeight::get().reads(1 as Weight))
259 .saturating_add(RocksDbWeight::get().writes(1 as Weight))
260 }
261 // Storage: Refungible Allowance (r:1 w:1)
262 // Storage: Refungible Balance (r:2 w:2)
35 fn transfer_from() -> Weight {0}263 fn transfer_from_normal() -> Weight {
264 (25_348_000 as Weight)
265 .saturating_add(RocksDbWeight::get().reads(3 as Weight))
266 .saturating_add(RocksDbWeight::get().writes(3 as Weight))
267 }
268 // Storage: Refungible Allowance (r:1 w:1)
269 // Storage: Refungible Balance (r:2 w:2)
270 // Storage: Refungible AccountBalance (r:1 w:1)
271 // Storage: Refungible Owned (r:0 w:1)
272 fn transfer_from_creating() -> Weight {
273 (28_647_000 as Weight)
274 .saturating_add(RocksDbWeight::get().reads(4 as Weight))
275 .saturating_add(RocksDbWeight::get().writes(5 as Weight))
276 }
277 // Storage: Refungible Allowance (r:1 w:1)
278 // Storage: Refungible Balance (r:2 w:2)
279 // Storage: Refungible AccountBalance (r:1 w:1)
280 // Storage: Refungible Owned (r:0 w:1)
281 fn transfer_from_removing() -> Weight {
282 (30_472_000 as Weight)
283 .saturating_add(RocksDbWeight::get().reads(4 as Weight))
284 .saturating_add(RocksDbWeight::get().writes(5 as Weight))
285 }
286 // Storage: Refungible Allowance (r:1 w:1)
287 // Storage: Refungible Balance (r:2 w:2)
288 // Storage: Refungible AccountBalance (r:2 w:2)
289 // Storage: Refungible Owned (r:0 w:2)
290 fn transfer_from_creating_removing() -> Weight {
291 (32_362_000 as Weight)
292 .saturating_add(RocksDbWeight::get().reads(5 as Weight))
293 .saturating_add(RocksDbWeight::get().writes(7 as Weight))
294 }
295 // Storage: Refungible TokenData (r:1 w:1)
36 fn set_variable_metadata() -> Weight {0}296 fn set_variable_metadata(_b: u32, ) -> Weight {
297 (6_801_000 as Weight)
298 .saturating_add(RocksDbWeight::get().reads(1 as Weight))
299 .saturating_add(RocksDbWeight::get().writes(1 as Weight))