difftreelog
Merge pull request #27 from usetech-llc/feature/nftpar-149
in: master
NFTPAR-149. Benchmark EnableContractSponsoring
5 files changed
pallets/nft/src/benchmarking.rsdiffbeforeafterboth311311312 }: 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)313314 enable_contract_sponsoring {315 let caller: T::AccountId = T::AccountId::from(whitelisted_caller());316317 }: enable_contract_sponsoring(RawOrigin::Signed(caller.clone()), caller.clone(), true)313318314 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>>();pallets/nft/src/default_weights.rsdiffbeforeafterboth--- a/pallets/nft/src/default_weights.rs
+++ b/pallets/nft/src/default_weights.rs
@@ -112,11 +112,11 @@
// .saturating_add(DbWeight::get().reads(1 as Weight))
// .saturating_add(DbWeight::get().writes(1 as Weight))
// }
- // fn enable_contract_sponsoring() -> Weight {
- // (0 as Weight)
- // .saturating_add(DbWeight::get().reads(1 as Weight))
- // .saturating_add(DbWeight::get().writes(1 as Weight))
- // }
+ fn enable_contract_sponsoring() -> Weight {
+ (13_000_000 as Weight)
+ .saturating_add(DbWeight::get().reads(1 as Weight))
+ .saturating_add(DbWeight::get().writes(1 as Weight))
+ }
// fn set_contract_sponsoring_rate_limit() -> Weight {
// (0 as Weight)
// .saturating_add(DbWeight::get().reads(1 as Weight))
pallets/nft/src/lib.rsdiffbeforeafterboth--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -200,7 +200,7 @@
fn set_const_on_chain_schema() -> Weight;
fn set_variable_on_chain_schema() -> Weight;
fn set_variable_meta_data() -> Weight;
- // fn enable_contract_sponsoring() -> Weight;
+ fn enable_contract_sponsoring() -> Weight;
}
#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
@@ -1307,7 +1307,7 @@
/// * contract address
/// * enable flag
///
- #[weight = 0]
+ #[weight = T::WeightInfo::enable_contract_sponsoring()]
pub fn enable_contract_sponsoring(
origin,
contract_address: T::AccountId,
runtime/Cargo.tomldiffbeforeafterboth--- a/runtime/Cargo.toml
+++ b/runtime/Cargo.toml
@@ -73,6 +73,7 @@
'frame-system-benchmarking',
'frame-system/runtime-benchmarks',
'pallet-balances/runtime-benchmarks',
+ 'pallet-collective/runtime-benchmarks',
'pallet-timestamp/runtime-benchmarks',
'pallet-nft/runtime-benchmarks',
'sp-runtime/runtime-benchmarks',
runtime/src/nft_weights.rsdiffbeforeafterboth--- a/runtime/src/nft_weights.rs
+++ b/runtime/src/nft_weights.rs
@@ -113,11 +113,11 @@
// .saturating_add(DbWeight::get().reads(1 as Weight))
// .saturating_add(DbWeight::get().writes(1 as Weight))
// }
- // fn enable_contract_sponsoring() -> Weight {
- // (0 as Weight)
- // .saturating_add(DbWeight::get().reads(1 as Weight))
- // .saturating_add(DbWeight::get().writes(1 as Weight))
- // }
+ fn enable_contract_sponsoring() -> Weight {
+ (13_000_000 as Weight)
+ .saturating_add(DbWeight::get().reads(1 as Weight))
+ .saturating_add(DbWeight::get().writes(1 as Weight))
+ }
// fn set_contract_sponsoring_rate_limit() -> Weight {
// (0 as Weight)
// .saturating_add(DbWeight::get().reads(1 as Weight))