diff --git a/Cargo.lock b/Cargo.lock index 1d0fca3faec000fbd214ec8282cf209d77dbd128..8065b66be1dace06ec430446a8b3a7a87f9e7164 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -873,6 +873,7 @@ dependencies = [ "pallet-session", "pallet-treasury", "pallet-ud-accounts-storage", + "pallet-universal-dividend", "parity-scale-codec", "scale-info", "serde", diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 2c96efe3f0b75328fdda12c092309f110ff18521..7036573993e8676f823890c050ef351a261a5041 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -39,6 +39,7 @@ std = [ 'pallet-membership/std', 'pallet-provide-randomness/std', 'pallet-treasury/std', + 'pallet-universal-dividend/std', 'pallet-ud-accounts-storage/std', "serde/std", "serde_derive", @@ -65,6 +66,7 @@ pallet-identity = { path = '../../pallets/identity', default-features = false } pallet-membership = { path = '../../pallets/membership', default-features = false } pallet-provide-randomness = { path = '../../pallets/provide-randomness', default-features = false } pallet-ud-accounts-storage = { path = '../../pallets/ud-accounts-storage', default-features = false } +pallet-universal-dividend = { path = '../../pallets/universal-dividend', default-features = false } sp-membership = { path = '../../primitives/membership', default-features = false } # Crates.io diff --git a/runtime/common/src/pallets_config.rs b/runtime/common/src/pallets_config.rs index 734ecb9a3505dc333dcfb6d10ed4b6f5f75d897b..b1e618f5261c7237d6e3b6ba3018f4f0e6486f92 100644 --- a/runtime/common/src/pallets_config.rs +++ b/runtime/common/src/pallets_config.rs @@ -385,6 +385,7 @@ macro_rules! pallets_config { type UdCreationPeriod = UdCreationPeriod; type UdReevalPeriod = UdReevalPeriod; type UnitsPerUd = frame_support::traits::ConstU64<1_000>; + type WeightInfo = common_runtime::weights::pallet_universal_dividend::WeightInfo<Runtime>; } impl pallet_ud_accounts_storage::Config for Runtime {} diff --git a/runtime/common/src/weights.rs b/runtime/common/src/weights.rs index 67dca2777d5688481a4d015ffed6d9aa9931b7ed..09779a432768986a78d525ac899403034a193839 100644 --- a/runtime/common/src/weights.rs +++ b/runtime/common/src/weights.rs @@ -18,3 +18,4 @@ pub mod frame_system; pub mod pallet_babe; pub mod pallet_balances; pub mod pallet_grandpa; +pub mod pallet_universal_dividend; diff --git a/runtime/common/src/weights/pallet_universal_dividend.rs b/runtime/common/src/weights/pallet_universal_dividend.rs new file mode 100644 index 0000000000000000000000000000000000000000..570bf073c42bd1c75862fa35dae99e1bff3d58c3 --- /dev/null +++ b/runtime/common/src/weights/pallet_universal_dividend.rs @@ -0,0 +1,68 @@ +// Copyright 2021-2022 Axiom-Team +// +// This file is part of Duniter-v2S. +// +// Duniter-v2S is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, version 3 of the License. +// +// Duniter-v2S is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>. + +//! Autogenerated weights for `pallet_universal_dividend` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-06-12, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Interpreted, CHAIN: Some("dev"), DB CACHE: 1024 + +// Executed Command: +// ./duniter +// benchmark +// --chain=dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_universal_dividend +// --extrinsic=* +// --execution=wasm +// --wasm-execution=interpreted-i-know-what-i-do +// --heap-pages=4096 +// --header=./file_header.txt +// --output=. + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_universal_dividend`. +pub struct WeightInfo<T>(PhantomData<T>); +impl<T: frame_system::Config> pallet_universal_dividend::WeightInfo for WeightInfo<T> { + // Storage: Parameters ParametersStorage (r:1 w:0) + fn on_initialize() -> Weight { + (104_055_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + } + // Storage: UniversalDividend CurrentUd (r:1 w:0) + // Storage: System Account (r:1 w:1) + // Storage: Account PendingNewAccounts (r:0 w:1) + fn transfer_ud() -> Weight { + (2_468_842_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + // Storage: UniversalDividend CurrentUd (r:1 w:0) + // Storage: System Account (r:1 w:1) + // Storage: Account PendingNewAccounts (r:0 w:1) + fn transfer_ud_keep_alive() -> Weight { + (1_442_150_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } +}