diff --git a/Cargo.lock b/Cargo.lock index 2c04c3ab64268c6b95007ec093a799ae91cbb31e..1d0fca3faec000fbd214ec8282cf209d77dbd128 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -862,6 +862,7 @@ dependencies = [ "log", "pallet-authority-members", "pallet-babe", + "pallet-balances", "pallet-certification", "pallet-duniter-account", "pallet-duniter-wot", diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 85964c294a73176730678192f4992fb70f42d948..2c96efe3f0b75328fdda12c092309f110ff18521 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -13,6 +13,7 @@ runtime-benchmarks = [ 'frame-system-benchmarking', 'frame-system/runtime-benchmarks', "pallet-babe/runtime-benchmarks", + 'pallet-balances/runtime-benchmarks', 'pallet-certification/runtime-benchmarks', 'pallet-duniter-wot/runtime-benchmarks', 'pallet-identity/runtime-benchmarks', @@ -29,6 +30,7 @@ std = [ 'log/std', 'pallet-authority-members/std', 'pallet-babe/std', + 'pallet-balances/std', 'pallet-certification/std', 'pallet-duniter-account/std', 'pallet-duniter-wot/std', @@ -77,6 +79,7 @@ smallvec = "1.6.1" frame-support = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false } frame-system = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false } pallet-babe = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false } +pallet-balances = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false } pallet-grandpa = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false } pallet-session = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false } pallet-treasury = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-02', default-features = false } diff --git a/runtime/common/src/pallets_config.rs b/runtime/common/src/pallets_config.rs index e6c53f6f5b37c6921621e890f9ffaf9ee827d661..4f0bd34cf2ca51503cf5cdec41d5da6e866c6157 100644 --- a/runtime/common/src/pallets_config.rs +++ b/runtime/common/src/pallets_config.rs @@ -159,7 +159,7 @@ macro_rules! pallets_config { type DustRemoval = Treasury; type ExistentialDeposit = ExistentialDeposit; type AccountStore = Account; - type WeightInfo = pallet_balances::weights::SubstrateWeight<Runtime>; + type WeightInfo = common_runtime::weights::pallet_balances::WeightInfo<Runtime>; } pub struct HandleFees; diff --git a/runtime/common/src/weights.rs b/runtime/common/src/weights.rs index 664b681d730640915f519e4fd9d1f4661daaa931..422ca3ffabb750b8e72f68e33849769a4cdac18f 100644 --- a/runtime/common/src/weights.rs +++ b/runtime/common/src/weights.rs @@ -15,4 +15,5 @@ // along with Substrate-Libre-Currency. If not, see <https://www.gnu.org/licenses/>. pub mod pallet_babe; +pub mod pallet_balances; pub mod pallet_grandpa; diff --git a/runtime/common/src/weights/pallet_balances.rs b/runtime/common/src/weights/pallet_balances.rs new file mode 100644 index 0000000000000000000000000000000000000000..028c4f0a1f72b1893867d01ed16007b9a93bb4f4 --- /dev/null +++ b/runtime/common/src/weights/pallet_balances.rs @@ -0,0 +1,92 @@ +// 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_balances` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-06-11, 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_balances +// --extrinsic=* +// --execution=wasm +// --wasm-execution=interpreted-i-know-what-i-do +// --heap-pages=4096 +// --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_balances`. +pub struct WeightInfo<T>(PhantomData<T>); +impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { + // Storage: System Account (r:1 w:1) + // Storage: Account PendingNewAccounts (r:0 w:1) + fn transfer() -> Weight { + (2_412_993_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + // Storage: System Account (r:1 w:1) + // Storage: Account PendingNewAccounts (r:0 w:1) + fn transfer_keep_alive() -> Weight { + (1_414_318_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + // Storage: System Account (r:1 w:1) + fn set_balance_creating() -> Weight { + (594_104_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: System Account (r:1 w:1) + fn set_balance_killing() -> Weight { + (704_715_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: System Account (r:2 w:2) + // Storage: Account PendingNewAccounts (r:0 w:1) + fn force_transfer() -> Weight { + (2_427_122_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + // Storage: System Account (r:1 w:1) + // Storage: Account PendingNewAccounts (r:0 w:1) + fn transfer_all() -> Weight { + (1_769_185_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + // Storage: System Account (r:1 w:1) + fn force_unreserve() -> Weight { + (619_549_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } +}