git.delta.rocks / unique-network / refs/commits / 10b295e0706d

difftreelog

NFTPAR-149. Benchmark EnableContractSponsoring

str-mv2020-12-08parent: #2e29cff.patch.diff
in: master

5 files changed

modifiedpallets/nft/src/benchmarking.rsdiffbeforeafterboth
311311
312 }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)312 }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
313
314 enable_contract_sponsoring {
315 let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
316
317 }: enable_contract_sponsoring(RawOrigin::Signed(caller.clone()), caller.clone(), true)
313318
314 set_offchain_schema {319 set_offchain_schema {
315 let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();320 let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
modifiedpallets/nft/src/default_weights.rsdiffbeforeafterboth
110 // fn set_chain_limits() -> Weight {110 // fn set_chain_limits() -> Weight {
111 // (0 as Weight)111 // (0 as Weight)
112 // .saturating_add(DbWeight::get().reads(1 as Weight))112 // .saturating_add(DbWeight::get().reads(1 as Weight))
113 // .saturating_add(DbWeight::get().writes(1 as Weight))
114 // }
115 // fn enable_contract_sponsoring() -> Weight {
116 // (0 as Weight)
117 // .saturating_add(DbWeight::get().reads(1 as Weight))
118 // .saturating_add(DbWeight::get().writes(1 as Weight))113 // .saturating_add(DbWeight::get().writes(1 as Weight))
119 // }114 // }
115 fn enable_contract_sponsoring() -> Weight {
116 (13_000_000 as Weight)
117 .saturating_add(DbWeight::get().reads(1 as Weight))
118 .saturating_add(DbWeight::get().writes(1 as Weight))
119 }
120 // fn set_contract_sponsoring_rate_limit() -> Weight {120 // fn set_contract_sponsoring_rate_limit() -> Weight {
121 // (0 as Weight)121 // (0 as Weight)
122 // .saturating_add(DbWeight::get().reads(1 as Weight))122 // .saturating_add(DbWeight::get().reads(1 as Weight))
modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
200 fn set_const_on_chain_schema() -> Weight;200 fn set_const_on_chain_schema() -> Weight;
201 fn set_variable_on_chain_schema() -> Weight;201 fn set_variable_on_chain_schema() -> Weight;
202 fn set_variable_meta_data() -> Weight;202 fn set_variable_meta_data() -> Weight;
203 // fn enable_contract_sponsoring() -> Weight;203 fn enable_contract_sponsoring() -> Weight;
204}204}
205205
206#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]206#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
1307 /// * contract address1307 /// * contract address
1308 /// * enable flag1308 /// * enable flag
1309 /// 1309 ///
1310 #[weight = 0]1310 #[weight = T::WeightInfo::enable_contract_sponsoring()]
1311 pub fn enable_contract_sponsoring(1311 pub fn enable_contract_sponsoring(
1312 origin,1312 origin,
1313 contract_address: T::AccountId,1313 contract_address: T::AccountId,
modifiedruntime/Cargo.tomldiffbeforeafterboth
73 'frame-system-benchmarking',73 'frame-system-benchmarking',
74 'frame-system/runtime-benchmarks',74 'frame-system/runtime-benchmarks',
75 'pallet-balances/runtime-benchmarks',75 'pallet-balances/runtime-benchmarks',
76 'pallet-collective/runtime-benchmarks',
76 'pallet-timestamp/runtime-benchmarks',77 'pallet-timestamp/runtime-benchmarks',
77 'pallet-nft/runtime-benchmarks',78 'pallet-nft/runtime-benchmarks',
78 'sp-runtime/runtime-benchmarks',79 'sp-runtime/runtime-benchmarks',
modifiedruntime/src/nft_weights.rsdiffbeforeafterboth
111 // fn set_chain_limits() -> Weight {111 // fn set_chain_limits() -> Weight {
112 // (0 as Weight)112 // (0 as Weight)
113 // .saturating_add(DbWeight::get().reads(1 as Weight))113 // .saturating_add(DbWeight::get().reads(1 as Weight))
114 // .saturating_add(DbWeight::get().writes(1 as Weight))
115 // }
116 // fn enable_contract_sponsoring() -> Weight {
117 // (0 as Weight)
118 // .saturating_add(DbWeight::get().reads(1 as Weight))
119 // .saturating_add(DbWeight::get().writes(1 as Weight))114 // .saturating_add(DbWeight::get().writes(1 as Weight))
120 // }115 // }
116 fn enable_contract_sponsoring() -> Weight {
117 (13_000_000 as Weight)
118 .saturating_add(DbWeight::get().reads(1 as Weight))
119 .saturating_add(DbWeight::get().writes(1 as Weight))
120 }
121 // fn set_contract_sponsoring_rate_limit() -> Weight {121 // fn set_contract_sponsoring_rate_limit() -> Weight {
122 // (0 as Weight)122 // (0 as Weight)
123 // .saturating_add(DbWeight::get().reads(1 as Weight))123 // .saturating_add(DbWeight::get().reads(1 as Weight))