From 8c9b144578bc09093a5ccfec56efcc4ef3d9f20e Mon Sep 17 00:00:00 2001 From: Justin Date: Sat, 25 Mar 2023 22:06:16 +1300 Subject: [PATCH] Update module reward benchmarking --- runtime/pioneer/src/weights/mod.rs | 2 +- runtime/pioneer/src/weights/module_reward.rs | 96 ++++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 runtime/pioneer/src/weights/module_reward.rs diff --git a/runtime/pioneer/src/weights/mod.rs b/runtime/pioneer/src/weights/mod.rs index c5da54100..b8ede7264 100644 --- a/runtime/pioneer/src/weights/mod.rs +++ b/runtime/pioneer/src/weights/mod.rs @@ -7,4 +7,4 @@ pub mod module_estate; pub mod module_metaverse; pub mod module_mining; pub mod module_nft; -//pub mod module_reward; +pub mod module_reward; diff --git a/runtime/pioneer/src/weights/module_reward.rs b/runtime/pioneer/src/weights/module_reward.rs new file mode 100644 index 000000000..38dcf81f0 --- /dev/null +++ b/runtime/pioneer/src/weights/module_reward.rs @@ -0,0 +1,96 @@ +// This default_weight is manually generated for UI integration testing purpose +// This bench_marking cli need to run to complete bench marking for all functions + +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for module_nft. +pub struct WeightInfo(PhantomData); +impl reward::WeightInfo for WeightInfo { + fn create_campaign() -> Weight { + (41_707_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(7 as Weight)) + } + fn create_nft_campaign() -> Weight { + (43_668_000 as Weight) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(8 as Weight)) + } + fn claim_reward() -> Weight { + (35_006_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn claim_reward_root() -> Weight { + (42_272_000 as Weight) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn claim_nft_reward() -> Weight { + (39_669_000 as Weight) + .saturating_add(T::DbWeight::get().reads(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn claim_nft_reward_root() -> Weight { + (44_661_000 as Weight) + .saturating_add(T::DbWeight::get().reads(8 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + fn set_reward() -> Weight { + (21_354_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + fn set_reward_root() -> Weight { + (22_813_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn set_nft_reward() -> Weight { + (22_278_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + fn set_nft_reward_root() -> Weight { + (22_938_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn close_campaign() -> Weight { + (50_279_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(7 as Weight)) + } + fn close_nft_campaign() -> Weight { + (47_338_000 as Weight) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(8 as Weight)) + } + fn cancel_campaign() -> Weight { + (38_746_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + fn cancel_nft_campaign() -> Weight { + (31_672_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn add_set_reward_origin() -> Weight { + (11_374_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + fn remove_set_reward_origin() -> Weight { + (11_973_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + fn on_finalize() -> Weight { + (13_598_000 as Weight).saturating_add(T::DbWeight::get().reads(2 as Weight)) + } +}