feat: Rebrand Polkadot/Substrate references to PezkuwiChain
This commit systematically rebrands various references from Parity Technologies' Polkadot/Substrate ecosystem to PezkuwiChain within the kurdistan-sdk. Key changes include: - Updated external repository URLs (zombienet-sdk, parity-db, parity-scale-codec, wasm-instrument) to point to pezkuwichain forks. - Modified internal documentation and code comments to reflect PezkuwiChain naming and structure. - Replaced direct references to with or specific paths within the for XCM, Pezkuwi, and other modules. - Cleaned up deprecated issue and PR references in various and files, particularly in and modules. - Adjusted image and logo URLs in documentation to point to PezkuwiChain assets. - Removed or rephrased comments related to external Polkadot/Substrate PRs and issues. This is a significant step towards fully customizing the SDK for the PezkuwiChain ecosystem.
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
[package]
|
||||
name = "pezpallet-collective"
|
||||
version = "28.0.0"
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "Collective system: Members of a set of account IDs can make their collective feelings known through dispatched calls from one of two specialized origins."
|
||||
readme = "README.md"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
codec = { features = ["derive"], workspace = true }
|
||||
docify = { workspace = true }
|
||||
pezframe-benchmarking = { optional = true, workspace = true }
|
||||
pezframe-support = { features = ["experimental"], workspace = true }
|
||||
pezframe-system = { workspace = true }
|
||||
log = { workspace = true }
|
||||
scale-info = { features = ["derive"], workspace = true }
|
||||
pezsp-core = { workspace = true }
|
||||
pezsp-io = { workspace = true }
|
||||
pezsp-runtime = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
pezpallet-balances = { workspace = true, default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"codec/std",
|
||||
"pezframe-benchmarking?/std",
|
||||
"pezframe-support/std",
|
||||
"pezframe-system/std",
|
||||
"log/std",
|
||||
"pezpallet-balances/std",
|
||||
"scale-info/std",
|
||||
"pezsp-core/std",
|
||||
"pezsp-io/std",
|
||||
"pezsp-runtime/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"pezframe-benchmarking/runtime-benchmarks",
|
||||
"pezframe-support/runtime-benchmarks",
|
||||
"pezframe-system/runtime-benchmarks",
|
||||
"pezpallet-balances/runtime-benchmarks",
|
||||
"pezsp-io/runtime-benchmarks",
|
||||
"pezsp-runtime/runtime-benchmarks",
|
||||
]
|
||||
try-runtime = [
|
||||
"pezframe-support/try-runtime",
|
||||
"pezframe-system/try-runtime",
|
||||
"pezpallet-balances/try-runtime",
|
||||
"pezsp-runtime/try-runtime",
|
||||
]
|
||||
@@ -0,0 +1,25 @@
|
||||
Collective system: Members of a set of account IDs can make their collective feelings known
|
||||
through dispatched calls from one of two specialized origins.
|
||||
|
||||
The membership can be provided in one of two ways: either directly, using the Root-dispatchable
|
||||
function `set_members`, or indirectly, through implementing the `ChangeMembers`.
|
||||
The pallet assumes that the amount of members stays at or below `MaxMembers` for its weight
|
||||
calculations, but enforces this neither in `set_members` nor in `change_members_sorted`.
|
||||
|
||||
A "prime" member may be set to help determine the default vote behavior based on chain
|
||||
config. If `PrimeDefaultVote` is used, the prime vote acts as the default vote in case of any
|
||||
abstentions after the voting period. If `MoreThanMajorityThenPrimeDefaultVote` is used, then
|
||||
abstentions will first follow the majority of the collective voting, and then the prime
|
||||
member.
|
||||
|
||||
Voting happens through motions comprising a proposal (i.e. a dispatchable) plus a
|
||||
number of approvals required for it to pass and be called. Motions are open for members to
|
||||
vote on for a minimum period given by `MotionDuration`. As soon as the required number of
|
||||
approvals is given, the motion is closed and executed. If the number of approvals is not reached
|
||||
during the voting period, then `close` may be called by any account in order to force the end
|
||||
the motion explicitly. If a prime member is defined, then their vote is used instead of any
|
||||
abstentions and the proposal is executed if there are enough approvals counting the new votes.
|
||||
|
||||
If there are not, or if no prime member is set, then the motion is dropped without being executed.
|
||||
|
||||
License: Apache-2.0
|
||||
@@ -0,0 +1,897 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Staking pallet benchmarking.
|
||||
|
||||
use super::*;
|
||||
use crate::Pallet as Collective;
|
||||
|
||||
use core::mem::size_of;
|
||||
use pezsp_runtime::traits::Bounded;
|
||||
|
||||
use pezframe_benchmarking::{
|
||||
v1::{account, whitelisted_caller},
|
||||
v2::*,
|
||||
};
|
||||
use pezframe_system::{
|
||||
pezpallet_prelude::BlockNumberFor, Call as SystemCall, Pallet as System, RawOrigin as SystemOrigin,
|
||||
};
|
||||
|
||||
const SEED: u32 = 0;
|
||||
|
||||
const MAX_BYTES: u32 = 1_024;
|
||||
|
||||
fn assert_last_event<T: Config<I>, I: 'static>(generic_event: <T as Config<I>>::RuntimeEvent) {
|
||||
pezframe_system::Pallet::<T>::assert_last_event(generic_event.into());
|
||||
}
|
||||
|
||||
fn assert_has_event<T: Config<I>, I: 'static>(generic_event: <T as Config<I>>::RuntimeEvent) {
|
||||
pezframe_system::Pallet::<T>::assert_has_event(generic_event.into());
|
||||
}
|
||||
|
||||
fn id_to_remark_data(id: u32, length: usize) -> Vec<u8> {
|
||||
id.to_le_bytes().into_iter().cycle().take(length).collect()
|
||||
}
|
||||
|
||||
#[instance_benchmarks(where T: Config<I>, I: 'static)]
|
||||
mod benchmarks {
|
||||
use super::*;
|
||||
|
||||
#[benchmark]
|
||||
fn set_members(
|
||||
m: Linear<0, { T::MaxMembers::get() }>,
|
||||
n: Linear<0, { T::MaxMembers::get() }>,
|
||||
p: Linear<0, { T::MaxProposals::get() }>,
|
||||
) -> Result<(), BenchmarkError> {
|
||||
// Set old members.
|
||||
// We compute the difference of old and new members, so it should influence timing.
|
||||
let mut old_members = vec![];
|
||||
for i in 0..m {
|
||||
let old_member = account::<T::AccountId>("old member", i, SEED);
|
||||
old_members.push(old_member);
|
||||
}
|
||||
|
||||
Collective::<T, I>::set_members(
|
||||
SystemOrigin::Root.into(),
|
||||
old_members.clone(),
|
||||
old_members.last().cloned(),
|
||||
T::MaxMembers::get(),
|
||||
)?;
|
||||
|
||||
// If there were any old members generate a bunch of proposals.
|
||||
if m > 0 {
|
||||
let caller = old_members.last().unwrap().clone();
|
||||
// Set a high threshold for proposals passing so that they stay around.
|
||||
let threshold = m.max(2);
|
||||
// Length of the proposals should be irrelevant to `set_members`.
|
||||
let length = 100;
|
||||
for i in 0..p {
|
||||
T::Consideration::ensure_successful(&caller, i);
|
||||
// Proposals should be different so that different proposal hashes are generated
|
||||
let proposal: T::Proposal =
|
||||
SystemCall::<T>::remark { remark: id_to_remark_data(i, length) }.into();
|
||||
Collective::<T, I>::propose(
|
||||
SystemOrigin::Signed(caller.clone()).into(),
|
||||
threshold,
|
||||
Box::new(proposal.clone()),
|
||||
MAX_BYTES,
|
||||
)?;
|
||||
let hash = T::Hashing::hash_of(&proposal);
|
||||
// Vote on the proposal to increase state relevant for `set_members`.
|
||||
// Not voting for last old member because they proposed and not voting for the first
|
||||
// member to keep the proposal from passing.
|
||||
for j in 2..m - 1 {
|
||||
let voter = &old_members[j as usize];
|
||||
let approve = true;
|
||||
Collective::<T, I>::vote(
|
||||
SystemOrigin::Signed(voter.clone()).into(),
|
||||
hash,
|
||||
i,
|
||||
approve,
|
||||
)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Construct `new_members`.
|
||||
// It should influence timing since it will sort this vector.
|
||||
let mut new_members = vec![];
|
||||
for i in 0..n {
|
||||
let member = account::<T::AccountId>("member", i, SEED);
|
||||
new_members.push(member);
|
||||
}
|
||||
#[extrinsic_call]
|
||||
_(
|
||||
SystemOrigin::Root,
|
||||
new_members.clone(),
|
||||
new_members.last().cloned(),
|
||||
T::MaxMembers::get(),
|
||||
);
|
||||
|
||||
new_members.sort();
|
||||
assert_eq!(Members::<T, I>::get(), new_members);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark]
|
||||
fn execute(
|
||||
b: Linear<2, MAX_BYTES>,
|
||||
m: Linear<1, { T::MaxMembers::get() }>,
|
||||
) -> Result<(), BenchmarkError> {
|
||||
let bytes_in_storage = b + size_of::<u32>() as u32;
|
||||
|
||||
// Construct `members`.
|
||||
let mut members = vec![];
|
||||
for i in 0..m - 1 {
|
||||
let member = account::<T::AccountId>("member", i, SEED);
|
||||
members.push(member);
|
||||
}
|
||||
|
||||
let caller: T::AccountId = whitelisted_caller();
|
||||
members.push(caller.clone());
|
||||
|
||||
Collective::<T, I>::set_members(
|
||||
SystemOrigin::Root.into(),
|
||||
members,
|
||||
None,
|
||||
T::MaxMembers::get(),
|
||||
)?;
|
||||
|
||||
let proposal: T::Proposal =
|
||||
SystemCall::<T>::remark { remark: id_to_remark_data(1, b as usize) }.into();
|
||||
|
||||
#[extrinsic_call]
|
||||
_(SystemOrigin::Signed(caller), Box::new(proposal.clone()), bytes_in_storage);
|
||||
|
||||
let proposal_hash = T::Hashing::hash_of(&proposal);
|
||||
// Note that execution fails due to mis-matched origin
|
||||
assert_last_event::<T, I>(Event::MemberExecuted { proposal_hash, result: Ok(()) }.into());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// This tests when execution would happen immediately after proposal
|
||||
#[benchmark]
|
||||
fn propose_execute(
|
||||
b: Linear<2, MAX_BYTES>,
|
||||
m: Linear<1, { T::MaxMembers::get() }>,
|
||||
) -> Result<(), BenchmarkError> {
|
||||
let bytes_in_storage = b + size_of::<u32>() as u32;
|
||||
|
||||
// Construct `members`.
|
||||
let mut members = vec![];
|
||||
for i in 0..m - 1 {
|
||||
let member = account::<T::AccountId>("member", i, SEED);
|
||||
members.push(member);
|
||||
}
|
||||
|
||||
let caller: T::AccountId = whitelisted_caller();
|
||||
members.push(caller.clone());
|
||||
|
||||
Collective::<T, I>::set_members(
|
||||
SystemOrigin::Root.into(),
|
||||
members,
|
||||
None,
|
||||
T::MaxMembers::get(),
|
||||
)?;
|
||||
|
||||
let proposal: T::Proposal =
|
||||
SystemCall::<T>::remark { remark: id_to_remark_data(1, b as usize) }.into();
|
||||
let threshold = 1;
|
||||
|
||||
#[extrinsic_call]
|
||||
propose(
|
||||
SystemOrigin::Signed(caller),
|
||||
threshold,
|
||||
Box::new(proposal.clone()),
|
||||
bytes_in_storage,
|
||||
);
|
||||
|
||||
let proposal_hash = T::Hashing::hash_of(&proposal);
|
||||
// Note that execution fails due to mis-matched origin
|
||||
assert_last_event::<T, I>(Event::Executed { proposal_hash, result: Ok(()) }.into());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// This tests when proposal is created and queued as "proposed"
|
||||
#[benchmark]
|
||||
fn propose_proposed(
|
||||
b: Linear<2, MAX_BYTES>,
|
||||
m: Linear<2, { T::MaxMembers::get() }>,
|
||||
p: Linear<1, { T::MaxProposals::get() }>,
|
||||
) -> Result<(), BenchmarkError> {
|
||||
let bytes_in_storage = b + size_of::<u32>() as u32;
|
||||
|
||||
// Construct `members`.
|
||||
let mut members = vec![];
|
||||
for i in 0..m - 1 {
|
||||
let member = account::<T::AccountId>("member", i, SEED);
|
||||
members.push(member);
|
||||
}
|
||||
let caller: T::AccountId = whitelisted_caller();
|
||||
members.push(caller.clone());
|
||||
Collective::<T, I>::set_members(
|
||||
SystemOrigin::Root.into(),
|
||||
members,
|
||||
None,
|
||||
T::MaxMembers::get(),
|
||||
)?;
|
||||
|
||||
let threshold = m;
|
||||
// Add previous proposals.
|
||||
for i in 0..p - 1 {
|
||||
T::Consideration::ensure_successful(&caller, i);
|
||||
// Proposals should be different so that different proposal hashes are generated
|
||||
let proposal: T::Proposal =
|
||||
SystemCall::<T>::remark { remark: id_to_remark_data(i, b as usize) }.into();
|
||||
Collective::<T, I>::propose(
|
||||
SystemOrigin::Signed(caller.clone()).into(),
|
||||
threshold,
|
||||
Box::new(proposal),
|
||||
bytes_in_storage,
|
||||
)?;
|
||||
}
|
||||
|
||||
assert_eq!(Proposals::<T, I>::get().len(), (p - 1) as usize);
|
||||
|
||||
T::Consideration::ensure_successful(&caller, p);
|
||||
|
||||
let proposal: T::Proposal =
|
||||
SystemCall::<T>::remark { remark: id_to_remark_data(p, b as usize) }.into();
|
||||
#[extrinsic_call]
|
||||
propose(
|
||||
SystemOrigin::Signed(caller.clone()),
|
||||
threshold,
|
||||
Box::new(proposal.clone()),
|
||||
bytes_in_storage,
|
||||
);
|
||||
|
||||
// New proposal is recorded
|
||||
assert_eq!(Proposals::<T, I>::get().len(), p as usize);
|
||||
let proposal_hash = T::Hashing::hash_of(&proposal);
|
||||
assert_last_event::<T, I>(
|
||||
Event::Proposed { account: caller, proposal_index: p - 1, proposal_hash, threshold }
|
||||
.into(),
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark]
|
||||
// We choose 5 as a minimum so we always trigger a vote in the voting loop (`for j in ...`)
|
||||
fn vote(m: Linear<5, { T::MaxMembers::get() }>) -> Result<(), BenchmarkError> {
|
||||
let p = T::MaxProposals::get();
|
||||
let b = MAX_BYTES;
|
||||
let bytes_in_storage = b + size_of::<u32>() as u32;
|
||||
|
||||
// Construct `members`.
|
||||
let mut members = vec![];
|
||||
let proposer: T::AccountId = account::<T::AccountId>("proposer", 0, SEED);
|
||||
members.push(proposer.clone());
|
||||
for i in 1..m - 1 {
|
||||
let member = account::<T::AccountId>("member", i, SEED);
|
||||
members.push(member);
|
||||
}
|
||||
let voter: T::AccountId = account::<T::AccountId>("voter", 0, SEED);
|
||||
members.push(voter.clone());
|
||||
Collective::<T, I>::set_members(
|
||||
SystemOrigin::Root.into(),
|
||||
members.clone(),
|
||||
None,
|
||||
T::MaxMembers::get(),
|
||||
)?;
|
||||
|
||||
// Threshold is 1 less than the number of members so that one person can vote nay
|
||||
let threshold = m - 1;
|
||||
|
||||
// Add previous proposals
|
||||
let mut last_hash = T::Hash::default();
|
||||
for i in 0..p {
|
||||
T::Consideration::ensure_successful(&proposer, i);
|
||||
// Proposals should be different so that different proposal hashes are generated
|
||||
let proposal: T::Proposal =
|
||||
SystemCall::<T>::remark { remark: id_to_remark_data(i, b as usize) }.into();
|
||||
Collective::<T, I>::propose(
|
||||
SystemOrigin::Signed(proposer.clone()).into(),
|
||||
threshold,
|
||||
Box::new(proposal.clone()),
|
||||
bytes_in_storage,
|
||||
)?;
|
||||
last_hash = T::Hashing::hash_of(&proposal);
|
||||
}
|
||||
|
||||
let index = p - 1;
|
||||
// Have almost everyone vote aye on last proposal, while keeping it from passing.
|
||||
for j in 0..m - 3 {
|
||||
let voter = &members[j as usize];
|
||||
let approve = true;
|
||||
Collective::<T, I>::vote(
|
||||
SystemOrigin::Signed(voter.clone()).into(),
|
||||
last_hash,
|
||||
index,
|
||||
approve,
|
||||
)?;
|
||||
}
|
||||
// Voter votes aye without resolving the vote.
|
||||
let approve = true;
|
||||
Collective::<T, I>::vote(
|
||||
SystemOrigin::Signed(voter.clone()).into(),
|
||||
last_hash,
|
||||
index,
|
||||
approve,
|
||||
)?;
|
||||
|
||||
assert_eq!(Proposals::<T, I>::get().len(), p as usize);
|
||||
|
||||
// Voter switches vote to nay, but does not kill the vote, just updates + inserts
|
||||
let approve = false;
|
||||
|
||||
// Whitelist voter account from further DB operations.
|
||||
let voter_key = pezframe_system::Account::<T>::hashed_key_for(&voter);
|
||||
pezframe_benchmarking::benchmarking::add_to_whitelist(voter_key.into());
|
||||
|
||||
#[extrinsic_call]
|
||||
_(SystemOrigin::Signed(voter), last_hash, index, approve);
|
||||
|
||||
// All proposals exist and the last proposal has just been updated.
|
||||
assert_eq!(Proposals::<T, I>::get().len(), p as usize);
|
||||
let voting = Voting::<T, I>::get(&last_hash).ok_or("Proposal Missing")?;
|
||||
assert_eq!(voting.ayes.len(), (m - 3) as usize);
|
||||
assert_eq!(voting.nays.len(), 1);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// We choose 4 as a minimum so we always trigger a vote in the voting loop (`for j in ...`)
|
||||
#[benchmark]
|
||||
fn close_early_disapproved(
|
||||
m: Linear<4, { T::MaxMembers::get() }>,
|
||||
p: Linear<1, { T::MaxProposals::get() }>,
|
||||
) -> Result<(), BenchmarkError> {
|
||||
let bytes = 100;
|
||||
let bytes_in_storage = bytes + size_of::<u32>() as u32;
|
||||
|
||||
// Construct `members`.
|
||||
let mut members = vec![];
|
||||
let proposer = account::<T::AccountId>("proposer", 0, SEED);
|
||||
members.push(proposer.clone());
|
||||
for i in 1..m - 1 {
|
||||
let member = account::<T::AccountId>("member", i, SEED);
|
||||
members.push(member);
|
||||
}
|
||||
let voter = account::<T::AccountId>("voter", 0, SEED);
|
||||
members.push(voter.clone());
|
||||
Collective::<T, I>::set_members(
|
||||
SystemOrigin::Root.into(),
|
||||
members.clone(),
|
||||
None,
|
||||
T::MaxMembers::get(),
|
||||
)?;
|
||||
|
||||
// Threshold is total members so that one nay will disapprove the vote
|
||||
let threshold = m;
|
||||
|
||||
// Add previous proposals
|
||||
let mut last_hash = T::Hash::default();
|
||||
for i in 0..p {
|
||||
T::Consideration::ensure_successful(&proposer, i);
|
||||
// Proposals should be different so that different proposal hashes are generated
|
||||
let proposal: T::Proposal =
|
||||
SystemCall::<T>::remark { remark: id_to_remark_data(i, bytes as usize) }.into();
|
||||
Collective::<T, I>::propose(
|
||||
SystemOrigin::Signed(proposer.clone()).into(),
|
||||
threshold,
|
||||
Box::new(proposal.clone()),
|
||||
bytes_in_storage,
|
||||
)?;
|
||||
last_hash = T::Hashing::hash_of(&proposal);
|
||||
}
|
||||
|
||||
let index = p - 1;
|
||||
// Have most everyone vote aye on last proposal, while keeping it from passing.
|
||||
for j in 0..m - 2 {
|
||||
let voter = &members[j as usize];
|
||||
let approve = true;
|
||||
Collective::<T, I>::vote(
|
||||
SystemOrigin::Signed(voter.clone()).into(),
|
||||
last_hash,
|
||||
index,
|
||||
approve,
|
||||
)?;
|
||||
}
|
||||
// Voter votes aye without resolving the vote.
|
||||
let approve = true;
|
||||
Collective::<T, I>::vote(
|
||||
SystemOrigin::Signed(voter.clone()).into(),
|
||||
last_hash,
|
||||
index,
|
||||
approve,
|
||||
)?;
|
||||
|
||||
assert_eq!(Proposals::<T, I>::get().len(), p as usize);
|
||||
|
||||
// Voter switches vote to nay, which kills the vote
|
||||
let approve = false;
|
||||
Collective::<T, I>::vote(
|
||||
SystemOrigin::Signed(voter.clone()).into(),
|
||||
last_hash,
|
||||
index,
|
||||
approve,
|
||||
)?;
|
||||
|
||||
// Whitelist voter account from further DB operations.
|
||||
let voter_key = pezframe_system::Account::<T>::hashed_key_for(&voter);
|
||||
pezframe_benchmarking::benchmarking::add_to_whitelist(voter_key.into());
|
||||
|
||||
#[extrinsic_call]
|
||||
close(SystemOrigin::Signed(voter), last_hash, index, Weight::MAX, bytes_in_storage);
|
||||
|
||||
// The last proposal is removed.
|
||||
assert_eq!(Proposals::<T, I>::get().len(), (p - 1) as usize);
|
||||
assert_last_event::<T, I>(Event::Disapproved { proposal_hash: last_hash }.into());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// m: we choose 4 as a minimum so we always trigger a vote in the voting loop (`for j in ...`)
|
||||
#[benchmark]
|
||||
fn close_early_approved(
|
||||
b: Linear<2, MAX_BYTES>,
|
||||
m: Linear<4, { T::MaxMembers::get() }>,
|
||||
p: Linear<1, { T::MaxProposals::get() }>,
|
||||
) -> Result<(), BenchmarkError> {
|
||||
let bytes_in_storage = b + size_of::<u32>() as u32;
|
||||
|
||||
// Construct `members`.
|
||||
let mut members = vec![];
|
||||
for i in 0..m - 1 {
|
||||
let member = account::<T::AccountId>("member", i, SEED);
|
||||
members.push(member);
|
||||
}
|
||||
let caller: T::AccountId = whitelisted_caller();
|
||||
members.push(caller.clone());
|
||||
Collective::<T, I>::set_members(
|
||||
SystemOrigin::Root.into(),
|
||||
members.clone(),
|
||||
None,
|
||||
T::MaxMembers::get(),
|
||||
)?;
|
||||
|
||||
// Threshold is 2 so any two ayes will approve the vote
|
||||
let threshold = 2;
|
||||
|
||||
// Add previous proposals
|
||||
let mut last_hash = T::Hash::default();
|
||||
for i in 0..p {
|
||||
T::Consideration::ensure_successful(&caller, i);
|
||||
// Proposals should be different so that different proposal hashes are generated
|
||||
let proposal: T::Proposal =
|
||||
SystemCall::<T>::remark { remark: id_to_remark_data(i, b as usize) }.into();
|
||||
Collective::<T, I>::propose(
|
||||
SystemOrigin::Signed(caller.clone()).into(),
|
||||
threshold,
|
||||
Box::new(proposal.clone()),
|
||||
bytes_in_storage,
|
||||
)?;
|
||||
last_hash = T::Hashing::hash_of(&proposal);
|
||||
}
|
||||
|
||||
// Caller switches vote to nay on their own proposal, allowing them to be the deciding
|
||||
// approval vote
|
||||
Collective::<T, I>::vote(
|
||||
SystemOrigin::Signed(caller.clone()).into(),
|
||||
last_hash,
|
||||
p - 1,
|
||||
false,
|
||||
)?;
|
||||
|
||||
// Have almost everyone vote nay on last proposal, while keeping it from failing.
|
||||
for j in 2..m - 1 {
|
||||
let voter = &members[j as usize];
|
||||
let approve = false;
|
||||
Collective::<T, I>::vote(
|
||||
SystemOrigin::Signed(voter.clone()).into(),
|
||||
last_hash,
|
||||
p - 1,
|
||||
approve,
|
||||
)?;
|
||||
}
|
||||
|
||||
// Member zero is the first aye
|
||||
Collective::<T, I>::vote(
|
||||
SystemOrigin::Signed(members[0].clone()).into(),
|
||||
last_hash,
|
||||
p - 1,
|
||||
true,
|
||||
)?;
|
||||
|
||||
assert_eq!(Proposals::<T, I>::get().len(), p as usize);
|
||||
|
||||
// Caller switches vote to aye, which passes the vote
|
||||
let index = p - 1;
|
||||
let approve = true;
|
||||
Collective::<T, I>::vote(
|
||||
SystemOrigin::Signed(caller.clone()).into(),
|
||||
last_hash,
|
||||
index,
|
||||
approve,
|
||||
)?;
|
||||
|
||||
#[extrinsic_call]
|
||||
close(SystemOrigin::Signed(caller), last_hash, index, Weight::MAX, bytes_in_storage);
|
||||
|
||||
// The last proposal is removed.
|
||||
assert_eq!(Proposals::<T, I>::get().len(), (p - 1) as usize);
|
||||
assert_last_event::<T, I>(
|
||||
Event::Executed { proposal_hash: last_hash, result: Ok(()) }.into(),
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// m: we choose 4 as a minimum so we always trigger a vote in the voting loop (`for j in ...`)
|
||||
#[benchmark]
|
||||
fn close_disapproved(
|
||||
m: Linear<4, { T::MaxMembers::get() }>,
|
||||
p: Linear<1, { T::MaxProposals::get() }>,
|
||||
) -> Result<(), BenchmarkError> {
|
||||
let bytes = 100;
|
||||
let bytes_in_storage = bytes + size_of::<u32>() as u32;
|
||||
|
||||
// Construct `members`.
|
||||
let mut members = vec![];
|
||||
for i in 0..m - 1 {
|
||||
let member = account::<T::AccountId>("member", i, SEED);
|
||||
members.push(member);
|
||||
}
|
||||
let caller: T::AccountId = whitelisted_caller();
|
||||
members.push(caller.clone());
|
||||
Collective::<T, I>::set_members(
|
||||
SystemOrigin::Root.into(),
|
||||
members.clone(),
|
||||
Some(caller.clone()),
|
||||
T::MaxMembers::get(),
|
||||
)?;
|
||||
|
||||
// Threshold is one less than total members so that two nays will disapprove the vote
|
||||
let threshold = m - 1;
|
||||
|
||||
// Add proposals
|
||||
let mut last_hash = T::Hash::default();
|
||||
for i in 0..p {
|
||||
T::Consideration::ensure_successful(&caller, i);
|
||||
// Proposals should be different so that different proposal hashes are generated
|
||||
let proposal: T::Proposal =
|
||||
SystemCall::<T>::remark { remark: id_to_remark_data(i, bytes as usize) }.into();
|
||||
Collective::<T, I>::propose(
|
||||
SystemOrigin::Signed(caller.clone()).into(),
|
||||
threshold,
|
||||
Box::new(proposal.clone()),
|
||||
bytes_in_storage,
|
||||
)?;
|
||||
last_hash = T::Hashing::hash_of(&proposal);
|
||||
}
|
||||
|
||||
let index = p - 1;
|
||||
// Have almost everyone vote aye on last proposal, while keeping it from passing.
|
||||
// A few abstainers will be the nay votes needed to fail the vote.
|
||||
let mut yes_votes: MemberCount = 0;
|
||||
for j in 2..m - 1 {
|
||||
let voter = &members[j as usize];
|
||||
let approve = true;
|
||||
yes_votes += 1;
|
||||
// vote aye till a prime nay vote keeps the proposal disapproved.
|
||||
if <<T as Config<I>>::DefaultVote as DefaultVote>::default_vote(
|
||||
Some(false),
|
||||
yes_votes,
|
||||
0,
|
||||
m,
|
||||
) {
|
||||
break;
|
||||
}
|
||||
Collective::<T, I>::vote(
|
||||
SystemOrigin::Signed(voter.clone()).into(),
|
||||
last_hash,
|
||||
index,
|
||||
approve,
|
||||
)?;
|
||||
}
|
||||
|
||||
// caller is prime, prime votes nay
|
||||
Collective::<T, I>::vote(
|
||||
SystemOrigin::Signed(caller.clone()).into(),
|
||||
last_hash,
|
||||
index,
|
||||
false,
|
||||
)?;
|
||||
|
||||
System::<T>::set_block_number(BlockNumberFor::<T>::max_value());
|
||||
assert_eq!(Proposals::<T, I>::get().len(), p as usize);
|
||||
|
||||
// Prime nay will close it as disapproved
|
||||
#[extrinsic_call]
|
||||
close(SystemOrigin::Signed(caller), last_hash, index, Weight::MAX, bytes_in_storage);
|
||||
|
||||
assert_eq!(Proposals::<T, I>::get().len(), (p - 1) as usize);
|
||||
assert_last_event::<T, I>(Event::Disapproved { proposal_hash: last_hash }.into());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// m: we choose 4 as a minimum so we always trigger a vote in the voting loop (`for j in ...`)
|
||||
#[benchmark]
|
||||
fn close_approved(
|
||||
b: Linear<2, MAX_BYTES>,
|
||||
m: Linear<4, { T::MaxMembers::get() }>,
|
||||
p: Linear<1, { T::MaxProposals::get() }>,
|
||||
) -> Result<(), BenchmarkError> {
|
||||
let bytes_in_storage = b + size_of::<u32>() as u32;
|
||||
|
||||
// Construct `members`.
|
||||
let mut members = vec![];
|
||||
for i in 0..m - 1 {
|
||||
let member = account::<T::AccountId>("member", i, SEED);
|
||||
members.push(member);
|
||||
}
|
||||
let caller: T::AccountId = whitelisted_caller();
|
||||
members.push(caller.clone());
|
||||
Collective::<T, I>::set_members(
|
||||
SystemOrigin::Root.into(),
|
||||
members.clone(),
|
||||
Some(caller.clone()),
|
||||
T::MaxMembers::get(),
|
||||
)?;
|
||||
|
||||
// Threshold is two, so any two ayes will pass the vote
|
||||
let threshold = 2;
|
||||
|
||||
// Add proposals
|
||||
let mut last_hash = T::Hash::default();
|
||||
for i in 0..p {
|
||||
T::Consideration::ensure_successful(&caller, i);
|
||||
// Proposals should be different so that different proposal hashes are generated
|
||||
let proposal: T::Proposal =
|
||||
SystemCall::<T>::remark { remark: id_to_remark_data(i, b as usize) }.into();
|
||||
Collective::<T, I>::propose(
|
||||
SystemOrigin::Signed(caller.clone()).into(),
|
||||
threshold,
|
||||
Box::new(proposal.clone()),
|
||||
bytes_in_storage,
|
||||
)?;
|
||||
last_hash = T::Hashing::hash_of(&proposal);
|
||||
}
|
||||
|
||||
// The prime member votes aye, so abstentions default to aye.
|
||||
Collective::<T, _>::vote(
|
||||
SystemOrigin::Signed(caller.clone()).into(),
|
||||
last_hash,
|
||||
p - 1,
|
||||
true, // Vote aye.
|
||||
)?;
|
||||
|
||||
// Have almost everyone vote nay on last proposal, while keeping it from failing.
|
||||
// A few abstainers will be the aye votes needed to pass the vote.
|
||||
for j in 2..m - 1 {
|
||||
let voter = &members[j as usize];
|
||||
let approve = false;
|
||||
Collective::<T, I>::vote(
|
||||
SystemOrigin::Signed(voter.clone()).into(),
|
||||
last_hash,
|
||||
p - 1,
|
||||
approve,
|
||||
)?;
|
||||
}
|
||||
|
||||
// caller is prime, prime already votes aye by creating the proposal
|
||||
System::<T>::set_block_number(BlockNumberFor::<T>::max_value());
|
||||
assert_eq!(Proposals::<T, I>::get().len(), p as usize);
|
||||
|
||||
// Prime aye will close it as approved
|
||||
#[extrinsic_call]
|
||||
close(SystemOrigin::Signed(caller), last_hash, p - 1, Weight::MAX, bytes_in_storage);
|
||||
|
||||
assert_eq!(Proposals::<T, I>::get().len(), (p - 1) as usize);
|
||||
assert_last_event::<T, I>(
|
||||
Event::Executed { proposal_hash: last_hash, result: Ok(()) }.into(),
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark]
|
||||
fn disapprove_proposal(p: Linear<1, { T::MaxProposals::get() }>) -> Result<(), BenchmarkError> {
|
||||
let m = 3;
|
||||
let b = MAX_BYTES;
|
||||
let bytes_in_storage = b + size_of::<u32>() as u32;
|
||||
|
||||
// Construct `members`.
|
||||
let mut members = vec![];
|
||||
for i in 0..m - 1 {
|
||||
let member = account::<T::AccountId>("member", i, SEED);
|
||||
members.push(member);
|
||||
}
|
||||
let caller = account::<T::AccountId>("caller", 0, SEED);
|
||||
members.push(caller.clone());
|
||||
Collective::<T, I>::set_members(
|
||||
SystemOrigin::Root.into(),
|
||||
members.clone(),
|
||||
Some(caller.clone()),
|
||||
T::MaxMembers::get(),
|
||||
)?;
|
||||
|
||||
// Threshold is one less than total members so that two nays will disapprove the vote
|
||||
let threshold = m - 1;
|
||||
|
||||
// Add proposals
|
||||
let mut last_hash = T::Hash::default();
|
||||
for i in 0..p {
|
||||
T::Consideration::ensure_successful(&caller, i);
|
||||
// Proposals should be different so that different proposal hashes are generated
|
||||
let proposal: T::Proposal =
|
||||
SystemCall::<T>::remark { remark: id_to_remark_data(i, b as usize) }.into();
|
||||
Collective::<T, I>::propose(
|
||||
SystemOrigin::Signed(caller.clone()).into(),
|
||||
threshold,
|
||||
Box::new(proposal.clone()),
|
||||
bytes_in_storage,
|
||||
)?;
|
||||
last_hash = T::Hashing::hash_of(&proposal);
|
||||
}
|
||||
|
||||
System::<T>::set_block_number(BlockNumberFor::<T>::max_value());
|
||||
assert_eq!(Proposals::<T, I>::get().len(), p as usize);
|
||||
|
||||
let origin =
|
||||
T::DisapproveOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
|
||||
|
||||
#[extrinsic_call]
|
||||
_(origin as <T as pezframe_system::Config>::RuntimeOrigin, last_hash);
|
||||
|
||||
assert_eq!(Proposals::<T, I>::get().len(), (p - 1) as usize);
|
||||
assert_last_event::<T, I>(Event::Disapproved { proposal_hash: last_hash }.into());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// d: `0` - if deposit is not present and `1` otherwise.
|
||||
#[benchmark]
|
||||
fn kill(
|
||||
d: Linear<0, 1>,
|
||||
p: Linear<1, { T::MaxProposals::get() }>,
|
||||
) -> Result<(), BenchmarkError> {
|
||||
let m = 3;
|
||||
let b = MAX_BYTES;
|
||||
let bytes_in_storage = b + size_of::<u32>() as u32;
|
||||
|
||||
// Construct `members`.
|
||||
let mut members = vec![];
|
||||
for i in 0..m - 1 {
|
||||
let member = account::<T::AccountId>("member", i, SEED);
|
||||
members.push(member);
|
||||
}
|
||||
let caller = account::<T::AccountId>("caller", 0, SEED);
|
||||
members.push(caller.clone());
|
||||
Collective::<T, I>::set_members(
|
||||
SystemOrigin::Root.into(),
|
||||
members.clone(),
|
||||
Some(caller.clone()),
|
||||
T::MaxMembers::get(),
|
||||
)?;
|
||||
|
||||
// Threshold is one less than total members so that two nays will disapprove the vote
|
||||
let threshold = m - 1;
|
||||
|
||||
// Add proposals
|
||||
let mut last_hash = T::Hash::default();
|
||||
for i in 0..p {
|
||||
T::Consideration::ensure_successful(&caller, i);
|
||||
|
||||
// Proposals should be different so that different proposal hashes are generated
|
||||
let proposal: T::Proposal =
|
||||
SystemCall::<T>::remark { remark: id_to_remark_data(i, b as usize) }.into();
|
||||
Collective::<T, I>::propose(
|
||||
SystemOrigin::Signed(caller.clone()).into(),
|
||||
threshold,
|
||||
Box::new(proposal.clone()),
|
||||
bytes_in_storage,
|
||||
)?;
|
||||
last_hash = T::Hashing::hash_of(&proposal);
|
||||
}
|
||||
|
||||
System::<T>::set_block_number(BlockNumberFor::<T>::max_value());
|
||||
assert_eq!(Proposals::<T, I>::get().len(), p as usize);
|
||||
|
||||
if d == 0 {
|
||||
CostOf::<T, I>::remove(last_hash);
|
||||
}
|
||||
let cost_present = CostOf::<T, I>::get(last_hash).is_some();
|
||||
|
||||
let origin =
|
||||
T::KillOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
|
||||
|
||||
#[extrinsic_call]
|
||||
_(origin as <T as pezframe_system::Config>::RuntimeOrigin, last_hash);
|
||||
|
||||
assert_eq!(Proposals::<T, I>::get().len(), (p - 1) as usize);
|
||||
assert_last_event::<T, I>(Event::Killed { proposal_hash: last_hash }.into());
|
||||
if cost_present {
|
||||
assert_has_event::<T, I>(
|
||||
Event::ProposalCostBurned { proposal_hash: last_hash, who: caller }.into(),
|
||||
);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark]
|
||||
fn release_proposal_cost() -> Result<(), BenchmarkError> {
|
||||
let m = 3;
|
||||
let p = T::MaxProposals::get();
|
||||
let b = MAX_BYTES;
|
||||
let bytes_in_storage = b + size_of::<u32>() as u32;
|
||||
|
||||
// Construct `members`.
|
||||
let mut members = vec![];
|
||||
for i in 0..m - 1 {
|
||||
let member = account::<T::AccountId>("member", i, SEED);
|
||||
members.push(member);
|
||||
}
|
||||
let caller = account::<T::AccountId>("caller", 0, SEED);
|
||||
members.push(caller.clone());
|
||||
Collective::<T, I>::set_members(
|
||||
SystemOrigin::Root.into(),
|
||||
members.clone(),
|
||||
Some(caller.clone()),
|
||||
T::MaxMembers::get(),
|
||||
)?;
|
||||
|
||||
// Add proposals
|
||||
let threshold = 2;
|
||||
let mut last_hash = T::Hash::default();
|
||||
for i in 0..p {
|
||||
T::Consideration::ensure_successful(&caller, i);
|
||||
|
||||
// Proposals should be different so that different proposal hashes are generated
|
||||
let proposal: T::Proposal =
|
||||
SystemCall::<T>::remark { remark: id_to_remark_data(i, b as usize) }.into();
|
||||
Collective::<T, I>::propose(
|
||||
SystemOrigin::Signed(caller.clone()).into(),
|
||||
threshold,
|
||||
Box::new(proposal.clone()),
|
||||
bytes_in_storage,
|
||||
)?;
|
||||
last_hash = T::Hashing::hash_of(&proposal);
|
||||
}
|
||||
|
||||
System::<T>::set_block_number(BlockNumberFor::<T>::max_value());
|
||||
assert_eq!(Proposals::<T, I>::get().len(), p as usize);
|
||||
|
||||
assert_eq!(Proposals::<T, I>::get().len(), p as usize);
|
||||
let _ = Collective::<T, I>::remove_proposal(last_hash);
|
||||
assert_eq!(Proposals::<T, I>::get().len(), (p - 1) as usize);
|
||||
|
||||
let cost_present = CostOf::<T, I>::get(last_hash).is_some();
|
||||
|
||||
#[extrinsic_call]
|
||||
_(SystemOrigin::Signed(caller.clone()), last_hash);
|
||||
|
||||
assert_eq!(CostOf::<T, I>::get(last_hash), None);
|
||||
if cost_present {
|
||||
assert_last_event::<T, I>(
|
||||
Event::ProposalCostReleased { proposal_hash: last_hash, who: caller }.into(),
|
||||
);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
impl_benchmark_test_suite!(
|
||||
Collective,
|
||||
crate::tests::ExtBuilder::default().build(),
|
||||
crate::tests::Test
|
||||
);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,19 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/// Version 4.
|
||||
pub mod v4;
|
||||
@@ -0,0 +1,148 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use pezsp_io::hashing::twox_128;
|
||||
|
||||
use super::super::LOG_TARGET;
|
||||
use pezframe_support::{
|
||||
traits::{
|
||||
Get, GetStorageVersion, PalletInfoAccess, StorageVersion,
|
||||
STORAGE_VERSION_STORAGE_KEY_POSTFIX,
|
||||
},
|
||||
weights::Weight,
|
||||
};
|
||||
|
||||
/// Migrate the entire storage of this pallet to a new prefix.
|
||||
///
|
||||
/// This new prefix must be the same as the one set in construct_runtime. For safety, use
|
||||
/// `PalletInfo` to get it, as:
|
||||
/// `<Runtime as pezframe_system::Config>::PalletInfo::name::<CollectivePallet>`.
|
||||
///
|
||||
/// The migration will look into the storage version in order not to trigger a migration on an up
|
||||
/// to date storage. Thus the on chain storage version must be less than 4 in order to trigger the
|
||||
/// migration.
|
||||
pub fn migrate<T: pezframe_system::Config, P: GetStorageVersion + PalletInfoAccess, N: AsRef<str>>(
|
||||
old_pallet_name: N,
|
||||
) -> Weight {
|
||||
let old_pallet_name = old_pallet_name.as_ref();
|
||||
let new_pallet_name = <P as PalletInfoAccess>::name();
|
||||
|
||||
if new_pallet_name == old_pallet_name {
|
||||
log::info!(
|
||||
target: LOG_TARGET,
|
||||
"New pallet name is equal to the old pallet name. No migration needs to be done.",
|
||||
);
|
||||
return Weight::zero();
|
||||
}
|
||||
|
||||
let on_chain_storage_version = <P as GetStorageVersion>::on_chain_storage_version();
|
||||
log::info!(
|
||||
target: LOG_TARGET,
|
||||
"Running migration to v4 for collective with storage version {:?}",
|
||||
on_chain_storage_version,
|
||||
);
|
||||
|
||||
if on_chain_storage_version < 4 {
|
||||
pezframe_support::storage::migration::move_pallet(
|
||||
old_pallet_name.as_bytes(),
|
||||
new_pallet_name.as_bytes(),
|
||||
);
|
||||
log_migration("migration", old_pallet_name, new_pallet_name);
|
||||
|
||||
StorageVersion::new(4).put::<P>();
|
||||
<T as pezframe_system::Config>::BlockWeights::get().max_block
|
||||
} else {
|
||||
log::warn!(
|
||||
target: LOG_TARGET,
|
||||
"Attempted to apply migration to v4 but failed because storage version is {:?}",
|
||||
on_chain_storage_version,
|
||||
);
|
||||
Weight::zero()
|
||||
}
|
||||
}
|
||||
|
||||
/// Some checks prior to migration. This can be linked to
|
||||
/// `pezframe_support::traits::OnRuntimeUpgrade::pre_upgrade` for further testing.
|
||||
///
|
||||
/// Panics if anything goes wrong.
|
||||
pub fn pre_migrate<P: GetStorageVersion + PalletInfoAccess, N: AsRef<str>>(old_pallet_name: N) {
|
||||
let old_pallet_name = old_pallet_name.as_ref();
|
||||
let new_pallet_name = <P as PalletInfoAccess>::name();
|
||||
log_migration("pre-migration", old_pallet_name, new_pallet_name);
|
||||
|
||||
if new_pallet_name == old_pallet_name {
|
||||
return;
|
||||
}
|
||||
|
||||
let new_pallet_prefix = twox_128(new_pallet_name.as_bytes());
|
||||
let storage_version_key = twox_128(STORAGE_VERSION_STORAGE_KEY_POSTFIX);
|
||||
|
||||
let mut new_pallet_prefix_iter = pezframe_support::storage::KeyPrefixIterator::new(
|
||||
new_pallet_prefix.to_vec(),
|
||||
new_pallet_prefix.to_vec(),
|
||||
|key| Ok(key.to_vec()),
|
||||
);
|
||||
|
||||
// Ensure nothing except the storage_version_key is stored in the new prefix.
|
||||
assert!(new_pallet_prefix_iter.all(|key| key == storage_version_key));
|
||||
|
||||
assert!(<P as GetStorageVersion>::on_chain_storage_version() < 4);
|
||||
}
|
||||
|
||||
/// Some checks for after migration. This can be linked to
|
||||
/// `pezframe_support::traits::OnRuntimeUpgrade::post_upgrade` for further testing.
|
||||
///
|
||||
/// Panics if anything goes wrong.
|
||||
pub fn post_migrate<P: GetStorageVersion + PalletInfoAccess, N: AsRef<str>>(old_pallet_name: N) {
|
||||
let old_pallet_name = old_pallet_name.as_ref();
|
||||
let new_pallet_name = <P as PalletInfoAccess>::name();
|
||||
log_migration("post-migration", old_pallet_name, new_pallet_name);
|
||||
|
||||
if new_pallet_name == old_pallet_name {
|
||||
return;
|
||||
}
|
||||
|
||||
// Assert that nothing remains at the old prefix.
|
||||
let old_pallet_prefix = twox_128(old_pallet_name.as_bytes());
|
||||
let old_pallet_prefix_iter = pezframe_support::storage::KeyPrefixIterator::new(
|
||||
old_pallet_prefix.to_vec(),
|
||||
old_pallet_prefix.to_vec(),
|
||||
|_| Ok(()),
|
||||
);
|
||||
assert_eq!(old_pallet_prefix_iter.count(), 0);
|
||||
|
||||
// NOTE: storage_version_key is already in the new prefix.
|
||||
let new_pallet_prefix = twox_128(new_pallet_name.as_bytes());
|
||||
let new_pallet_prefix_iter = pezframe_support::storage::KeyPrefixIterator::new(
|
||||
new_pallet_prefix.to_vec(),
|
||||
new_pallet_prefix.to_vec(),
|
||||
|_| Ok(()),
|
||||
);
|
||||
assert!(new_pallet_prefix_iter.count() >= 1);
|
||||
|
||||
assert_eq!(<P as GetStorageVersion>::on_chain_storage_version(), 4);
|
||||
}
|
||||
|
||||
fn log_migration(stage: &str, old_pallet_name: &str, new_pallet_name: &str) {
|
||||
log::info!(
|
||||
target: LOG_TARGET,
|
||||
"{}, prefix: '{}' ==> '{}'",
|
||||
stage,
|
||||
old_pallet_name,
|
||||
new_pallet_name,
|
||||
);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,716 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Autogenerated weights for `pezpallet_collective`
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE BIZINIKIWI BENCHMARK CLI VERSION 32.0.0
|
||||
//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! WORST CASE MAP SIZE: `1000000`
|
||||
//! HOSTNAME: `4563561839a5`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
|
||||
//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
|
||||
|
||||
// Executed Command:
|
||||
// frame-omni-bencher
|
||||
// v1
|
||||
// benchmark
|
||||
// pallet
|
||||
// --extrinsic=*
|
||||
// --runtime=target/production/wbuild/kitchensink-runtime/kitchensink_runtime.wasm
|
||||
// --pallet=pezpallet_collective
|
||||
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
|
||||
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/collective/src/weights.rs
|
||||
// --wasm-execution=compiled
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --heap-pages=4096
|
||||
// --template=bizinikiwi/.maintain/frame-weight-template.hbs
|
||||
// --no-storage-info
|
||||
// --no-min-squares
|
||||
// --no-median-slopes
|
||||
// --genesis-builder-policy=none
|
||||
// --exclude-pallets=pezpallet_xcm,pezpallet_xcm_benchmarks::fungible,pezpallet_xcm_benchmarks::generic,pezpallet_nomination_pools,pezpallet_remark,pezpallet_transaction_storage,pezpallet_election_provider_multi_block,pezpallet_election_provider_multi_block::signed,pezpallet_election_provider_multi_block::unsigned,pezpallet_election_provider_multi_block::verifier
|
||||
|
||||
#![cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
#![allow(missing_docs)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
use pezframe_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use core::marker::PhantomData;
|
||||
|
||||
/// Weight functions needed for `pezpallet_collective`.
|
||||
pub trait WeightInfo {
|
||||
fn set_members(m: u32, n: u32, p: u32, ) -> Weight;
|
||||
fn execute(b: u32, m: u32, ) -> Weight;
|
||||
fn propose_execute(b: u32, m: u32, ) -> Weight;
|
||||
fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight;
|
||||
fn vote(m: u32, ) -> Weight;
|
||||
fn close_early_disapproved(m: u32, p: u32, ) -> Weight;
|
||||
fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight;
|
||||
fn close_disapproved(m: u32, p: u32, ) -> Weight;
|
||||
fn close_approved(b: u32, m: u32, p: u32, ) -> Weight;
|
||||
fn disapprove_proposal(p: u32, ) -> Weight;
|
||||
fn kill(d: u32, p: u32, ) -> Weight;
|
||||
fn release_proposal_cost() -> Weight;
|
||||
}
|
||||
|
||||
/// Weights for `pezpallet_collective` using the Bizinikiwi node and recommended hardware.
|
||||
pub struct BizinikiwiWeight<T>(PhantomData<T>);
|
||||
impl<T: pezframe_system::Config> WeightInfo for BizinikiwiWeight<T> {
|
||||
/// Storage: `Council::Members` (r:1 w:1)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Proposals` (r:1 w:0)
|
||||
/// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Voting` (r:100 w:100)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Prime` (r:0 w:1)
|
||||
/// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `m` is `[0, 100]`.
|
||||
/// The range of component `n` is `[0, 100]`.
|
||||
/// The range of component `p` is `[0, 100]`.
|
||||
fn set_members(m: u32, _n: u32, p: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0 + m * (3232 ±0) + p * (3190 ±0)`
|
||||
// Estimated: `15670 + m * (1967 ±23) + p * (4332 ±23)`
|
||||
// Minimum execution time: 12_462_000 picoseconds.
|
||||
Weight::from_parts(12_646_000, 15670)
|
||||
// Standard Error: 79_289
|
||||
.saturating_add(Weight::from_parts(5_961_291, 0).saturating_mul(m.into()))
|
||||
// Standard Error: 79_289
|
||||
.saturating_add(Weight::from_parts(10_323_837, 0).saturating_mul(p.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(2_u64))
|
||||
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into())))
|
||||
.saturating_add(T::DbWeight::get().writes(2_u64))
|
||||
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into())))
|
||||
.saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into()))
|
||||
.saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into()))
|
||||
}
|
||||
/// Storage: `Council::Members` (r:1 w:0)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
|
||||
/// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
|
||||
/// Storage: `TxPause::PausedCalls` (r:1 w:0)
|
||||
/// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`)
|
||||
/// The range of component `b` is `[2, 1024]`.
|
||||
/// The range of component `m` is `[1, 100]`.
|
||||
fn execute(b: u32, m: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `7 + m * (32 ±0)`
|
||||
// Estimated: `3997 + m * (32 ±0)`
|
||||
// Minimum execution time: 13_735_000 picoseconds.
|
||||
Weight::from_parts(12_877_692, 3997)
|
||||
// Standard Error: 32
|
||||
.saturating_add(Weight::from_parts(1_555, 0).saturating_mul(b.into()))
|
||||
// Standard Error: 334
|
||||
.saturating_add(Weight::from_parts(14_710, 0).saturating_mul(m.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(3_u64))
|
||||
.saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into()))
|
||||
}
|
||||
/// Storage: `Council::Members` (r:1 w:0)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::ProposalOf` (r:1 w:0)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
|
||||
/// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
|
||||
/// Storage: `TxPause::PausedCalls` (r:1 w:0)
|
||||
/// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`)
|
||||
/// The range of component `b` is `[2, 1024]`.
|
||||
/// The range of component `m` is `[1, 100]`.
|
||||
fn propose_execute(b: u32, m: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `7 + m * (32 ±0)`
|
||||
// Estimated: `3997 + m * (32 ±0)`
|
||||
// Minimum execution time: 15_883_000 picoseconds.
|
||||
Weight::from_parts(14_905_569, 3997)
|
||||
// Standard Error: 30
|
||||
.saturating_add(Weight::from_parts(1_636, 0).saturating_mul(b.into()))
|
||||
// Standard Error: 313
|
||||
.saturating_add(Weight::from_parts(26_237, 0).saturating_mul(m.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(4_u64))
|
||||
.saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into()))
|
||||
}
|
||||
/// Storage: `Council::Members` (r:1 w:0)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::ProposalOf` (r:1 w:1)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Proposals` (r:1 w:1)
|
||||
/// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Balances::Holds` (r:1 w:1)
|
||||
/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Council::ProposalCount` (r:1 w:1)
|
||||
/// Proof: `Council::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Voting` (r:0 w:1)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::CostOf` (r:0 w:1)
|
||||
/// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `b` is `[2, 1024]`.
|
||||
/// The range of component `m` is `[2, 100]`.
|
||||
/// The range of component `p` is `[1, 100]`.
|
||||
fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `394 + m * (32 ±0) + p * (36 ±0)`
|
||||
// Estimated: `3892 + m * (33 ±0) + p * (36 ±0)`
|
||||
// Minimum execution time: 40_695_000 picoseconds.
|
||||
Weight::from_parts(61_454_712, 3892)
|
||||
// Standard Error: 349
|
||||
.saturating_add(Weight::from_parts(4_274, 0).saturating_mul(b.into()))
|
||||
// Standard Error: 3_648
|
||||
.saturating_add(Weight::from_parts(30_746, 0).saturating_mul(m.into()))
|
||||
// Standard Error: 3_601
|
||||
.saturating_add(Weight::from_parts(262_875, 0).saturating_mul(p.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(5_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(6_u64))
|
||||
.saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into()))
|
||||
.saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into()))
|
||||
}
|
||||
/// Storage: `Council::Members` (r:1 w:0)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Voting` (r:1 w:1)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `m` is `[5, 100]`.
|
||||
fn vote(m: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `787 + m * (64 ±0)`
|
||||
// Estimated: `4251 + m * (64 ±0)`
|
||||
// Minimum execution time: 27_325_000 picoseconds.
|
||||
Weight::from_parts(27_882_147, 4251)
|
||||
// Standard Error: 808
|
||||
.saturating_add(Weight::from_parts(40_139, 0).saturating_mul(m.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(2_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
.saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into()))
|
||||
}
|
||||
/// Storage: `Council::Voting` (r:1 w:1)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Members` (r:1 w:0)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Proposals` (r:1 w:1)
|
||||
/// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::ProposalOf` (r:0 w:1)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `m` is `[4, 100]`.
|
||||
/// The range of component `p` is `[1, 100]`.
|
||||
fn close_early_disapproved(m: u32, p: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `376 + m * (64 ±0) + p * (36 ±0)`
|
||||
// Estimated: `3818 + m * (65 ±0) + p * (36 ±0)`
|
||||
// Minimum execution time: 24_117_000 picoseconds.
|
||||
Weight::from_parts(27_410_759, 3818)
|
||||
// Standard Error: 2_202
|
||||
.saturating_add(Weight::from_parts(40_245, 0).saturating_mul(m.into()))
|
||||
// Standard Error: 2_147
|
||||
.saturating_add(Weight::from_parts(211_095, 0).saturating_mul(p.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(3_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(3_u64))
|
||||
.saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into()))
|
||||
.saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into()))
|
||||
}
|
||||
/// Storage: `Council::Voting` (r:1 w:1)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Members` (r:1 w:0)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::ProposalOf` (r:1 w:1)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
|
||||
/// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
|
||||
/// Storage: `TxPause::PausedCalls` (r:1 w:0)
|
||||
/// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Council::Proposals` (r:1 w:1)
|
||||
/// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `b` is `[2, 1024]`.
|
||||
/// The range of component `m` is `[4, 100]`.
|
||||
/// The range of component `p` is `[1, 100]`.
|
||||
fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `677 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)`
|
||||
// Estimated: `3997 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)`
|
||||
// Minimum execution time: 36_730_000 picoseconds.
|
||||
Weight::from_parts(40_759_167, 3997)
|
||||
// Standard Error: 228
|
||||
.saturating_add(Weight::from_parts(3_423, 0).saturating_mul(b.into()))
|
||||
// Standard Error: 2_413
|
||||
.saturating_add(Weight::from_parts(39_895, 0).saturating_mul(m.into()))
|
||||
// Standard Error: 2_352
|
||||
.saturating_add(Weight::from_parts(242_036, 0).saturating_mul(p.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(6_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(3_u64))
|
||||
.saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into()))
|
||||
.saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into()))
|
||||
.saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into()))
|
||||
}
|
||||
/// Storage: `Council::Voting` (r:1 w:1)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Members` (r:1 w:0)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Prime` (r:1 w:0)
|
||||
/// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Proposals` (r:1 w:1)
|
||||
/// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::ProposalOf` (r:0 w:1)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `m` is `[4, 100]`.
|
||||
/// The range of component `p` is `[1, 100]`.
|
||||
fn close_disapproved(m: u32, p: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `396 + m * (64 ±0) + p * (36 ±0)`
|
||||
// Estimated: `3838 + m * (65 ±0) + p * (36 ±0)`
|
||||
// Minimum execution time: 26_633_000 picoseconds.
|
||||
Weight::from_parts(30_258_684, 3838)
|
||||
// Standard Error: 1_818
|
||||
.saturating_add(Weight::from_parts(41_737, 0).saturating_mul(m.into()))
|
||||
// Standard Error: 1_772
|
||||
.saturating_add(Weight::from_parts(206_682, 0).saturating_mul(p.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(4_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(3_u64))
|
||||
.saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into()))
|
||||
.saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into()))
|
||||
}
|
||||
/// Storage: `Council::Voting` (r:1 w:1)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Members` (r:1 w:0)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Prime` (r:1 w:0)
|
||||
/// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::ProposalOf` (r:1 w:1)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
|
||||
/// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
|
||||
/// Storage: `TxPause::PausedCalls` (r:1 w:0)
|
||||
/// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Council::Proposals` (r:1 w:1)
|
||||
/// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `b` is `[2, 1024]`.
|
||||
/// The range of component `m` is `[4, 100]`.
|
||||
/// The range of component `p` is `[1, 100]`.
|
||||
fn close_approved(b: u32, m: u32, p: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `697 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)`
|
||||
// Estimated: `4010 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)`
|
||||
// Minimum execution time: 40_885_000 picoseconds.
|
||||
Weight::from_parts(46_459_730, 4010)
|
||||
// Standard Error: 234
|
||||
.saturating_add(Weight::from_parts(1_914, 0).saturating_mul(b.into()))
|
||||
// Standard Error: 2_476
|
||||
.saturating_add(Weight::from_parts(27_310, 0).saturating_mul(m.into()))
|
||||
// Standard Error: 2_414
|
||||
.saturating_add(Weight::from_parts(237_527, 0).saturating_mul(p.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(7_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(3_u64))
|
||||
.saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into()))
|
||||
.saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into()))
|
||||
.saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into()))
|
||||
}
|
||||
/// Storage: `Council::Proposals` (r:1 w:1)
|
||||
/// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Voting` (r:0 w:1)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::ProposalOf` (r:0 w:1)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `p` is `[1, 100]`.
|
||||
fn disapprove_proposal(p: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `168 + p * (32 ±0)`
|
||||
// Estimated: `1653 + p * (32 ±0)`
|
||||
// Minimum execution time: 11_806_000 picoseconds.
|
||||
Weight::from_parts(14_714_942, 1653)
|
||||
// Standard Error: 1_358
|
||||
.saturating_add(Weight::from_parts(182_535, 0).saturating_mul(p.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(1_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(3_u64))
|
||||
.saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into()))
|
||||
}
|
||||
/// Storage: `Council::ProposalOf` (r:1 w:1)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::CostOf` (r:1 w:1)
|
||||
/// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `System::Account` (r:1 w:1)
|
||||
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Balances::Holds` (r:1 w:1)
|
||||
/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Council::Proposals` (r:1 w:1)
|
||||
/// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Voting` (r:0 w:1)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `d` is `[0, 1]`.
|
||||
/// The range of component `p` is `[1, 100]`.
|
||||
fn kill(d: u32, p: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `1639 + d * (163 ±0) + p * (41 ±0)`
|
||||
// Estimated: `4954 + d * (1946 ±14) + p * (43 ±0)`
|
||||
// Minimum execution time: 18_912_000 picoseconds.
|
||||
Weight::from_parts(18_315_857, 4954)
|
||||
// Standard Error: 364_977
|
||||
.saturating_add(Weight::from_parts(32_810_580, 0).saturating_mul(d.into()))
|
||||
// Standard Error: 5_652
|
||||
.saturating_add(Weight::from_parts(320_835, 0).saturating_mul(p.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(3_u64))
|
||||
.saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into())))
|
||||
.saturating_add(T::DbWeight::get().writes(3_u64))
|
||||
.saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(d.into())))
|
||||
.saturating_add(Weight::from_parts(0, 1946).saturating_mul(d.into()))
|
||||
.saturating_add(Weight::from_parts(0, 43).saturating_mul(p.into()))
|
||||
}
|
||||
/// Storage: `Council::ProposalOf` (r:1 w:0)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::CostOf` (r:1 w:1)
|
||||
/// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `System::Account` (r:1 w:1)
|
||||
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Balances::Holds` (r:1 w:1)
|
||||
/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
|
||||
fn release_proposal_cost() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `1691`
|
||||
// Estimated: `5156`
|
||||
// Minimum execution time: 64_168_000 picoseconds.
|
||||
Weight::from_parts(65_123_000, 5156)
|
||||
.saturating_add(T::DbWeight::get().reads(4_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(3_u64))
|
||||
}
|
||||
}
|
||||
|
||||
// For backwards compatibility and tests.
|
||||
impl WeightInfo for () {
|
||||
/// Storage: `Council::Members` (r:1 w:1)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Proposals` (r:1 w:0)
|
||||
/// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Voting` (r:100 w:100)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Prime` (r:0 w:1)
|
||||
/// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `m` is `[0, 100]`.
|
||||
/// The range of component `n` is `[0, 100]`.
|
||||
/// The range of component `p` is `[0, 100]`.
|
||||
fn set_members(m: u32, _n: u32, p: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0 + m * (3232 ±0) + p * (3190 ±0)`
|
||||
// Estimated: `15670 + m * (1967 ±23) + p * (4332 ±23)`
|
||||
// Minimum execution time: 12_462_000 picoseconds.
|
||||
Weight::from_parts(12_646_000, 15670)
|
||||
// Standard Error: 79_289
|
||||
.saturating_add(Weight::from_parts(5_961_291, 0).saturating_mul(m.into()))
|
||||
// Standard Error: 79_289
|
||||
.saturating_add(Weight::from_parts(10_323_837, 0).saturating_mul(p.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(2_u64))
|
||||
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(p.into())))
|
||||
.saturating_add(RocksDbWeight::get().writes(2_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(p.into())))
|
||||
.saturating_add(Weight::from_parts(0, 1967).saturating_mul(m.into()))
|
||||
.saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into()))
|
||||
}
|
||||
/// Storage: `Council::Members` (r:1 w:0)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
|
||||
/// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
|
||||
/// Storage: `TxPause::PausedCalls` (r:1 w:0)
|
||||
/// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`)
|
||||
/// The range of component `b` is `[2, 1024]`.
|
||||
/// The range of component `m` is `[1, 100]`.
|
||||
fn execute(b: u32, m: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `7 + m * (32 ±0)`
|
||||
// Estimated: `3997 + m * (32 ±0)`
|
||||
// Minimum execution time: 13_735_000 picoseconds.
|
||||
Weight::from_parts(12_877_692, 3997)
|
||||
// Standard Error: 32
|
||||
.saturating_add(Weight::from_parts(1_555, 0).saturating_mul(b.into()))
|
||||
// Standard Error: 334
|
||||
.saturating_add(Weight::from_parts(14_710, 0).saturating_mul(m.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(3_u64))
|
||||
.saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into()))
|
||||
}
|
||||
/// Storage: `Council::Members` (r:1 w:0)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::ProposalOf` (r:1 w:0)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
|
||||
/// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
|
||||
/// Storage: `TxPause::PausedCalls` (r:1 w:0)
|
||||
/// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`)
|
||||
/// The range of component `b` is `[2, 1024]`.
|
||||
/// The range of component `m` is `[1, 100]`.
|
||||
fn propose_execute(b: u32, m: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `7 + m * (32 ±0)`
|
||||
// Estimated: `3997 + m * (32 ±0)`
|
||||
// Minimum execution time: 15_883_000 picoseconds.
|
||||
Weight::from_parts(14_905_569, 3997)
|
||||
// Standard Error: 30
|
||||
.saturating_add(Weight::from_parts(1_636, 0).saturating_mul(b.into()))
|
||||
// Standard Error: 313
|
||||
.saturating_add(Weight::from_parts(26_237, 0).saturating_mul(m.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(4_u64))
|
||||
.saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into()))
|
||||
}
|
||||
/// Storage: `Council::Members` (r:1 w:0)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::ProposalOf` (r:1 w:1)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Proposals` (r:1 w:1)
|
||||
/// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Balances::Holds` (r:1 w:1)
|
||||
/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Council::ProposalCount` (r:1 w:1)
|
||||
/// Proof: `Council::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Voting` (r:0 w:1)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::CostOf` (r:0 w:1)
|
||||
/// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `b` is `[2, 1024]`.
|
||||
/// The range of component `m` is `[2, 100]`.
|
||||
/// The range of component `p` is `[1, 100]`.
|
||||
fn propose_proposed(b: u32, m: u32, p: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `394 + m * (32 ±0) + p * (36 ±0)`
|
||||
// Estimated: `3892 + m * (33 ±0) + p * (36 ±0)`
|
||||
// Minimum execution time: 40_695_000 picoseconds.
|
||||
Weight::from_parts(61_454_712, 3892)
|
||||
// Standard Error: 349
|
||||
.saturating_add(Weight::from_parts(4_274, 0).saturating_mul(b.into()))
|
||||
// Standard Error: 3_648
|
||||
.saturating_add(Weight::from_parts(30_746, 0).saturating_mul(m.into()))
|
||||
// Standard Error: 3_601
|
||||
.saturating_add(Weight::from_parts(262_875, 0).saturating_mul(p.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(5_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(6_u64))
|
||||
.saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into()))
|
||||
.saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into()))
|
||||
}
|
||||
/// Storage: `Council::Members` (r:1 w:0)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Voting` (r:1 w:1)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `m` is `[5, 100]`.
|
||||
fn vote(m: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `787 + m * (64 ±0)`
|
||||
// Estimated: `4251 + m * (64 ±0)`
|
||||
// Minimum execution time: 27_325_000 picoseconds.
|
||||
Weight::from_parts(27_882_147, 4251)
|
||||
// Standard Error: 808
|
||||
.saturating_add(Weight::from_parts(40_139, 0).saturating_mul(m.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(2_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
.saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into()))
|
||||
}
|
||||
/// Storage: `Council::Voting` (r:1 w:1)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Members` (r:1 w:0)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Proposals` (r:1 w:1)
|
||||
/// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::ProposalOf` (r:0 w:1)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `m` is `[4, 100]`.
|
||||
/// The range of component `p` is `[1, 100]`.
|
||||
fn close_early_disapproved(m: u32, p: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `376 + m * (64 ±0) + p * (36 ±0)`
|
||||
// Estimated: `3818 + m * (65 ±0) + p * (36 ±0)`
|
||||
// Minimum execution time: 24_117_000 picoseconds.
|
||||
Weight::from_parts(27_410_759, 3818)
|
||||
// Standard Error: 2_202
|
||||
.saturating_add(Weight::from_parts(40_245, 0).saturating_mul(m.into()))
|
||||
// Standard Error: 2_147
|
||||
.saturating_add(Weight::from_parts(211_095, 0).saturating_mul(p.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(3_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(3_u64))
|
||||
.saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into()))
|
||||
.saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into()))
|
||||
}
|
||||
/// Storage: `Council::Voting` (r:1 w:1)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Members` (r:1 w:0)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::ProposalOf` (r:1 w:1)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
|
||||
/// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
|
||||
/// Storage: `TxPause::PausedCalls` (r:1 w:0)
|
||||
/// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Council::Proposals` (r:1 w:1)
|
||||
/// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `b` is `[2, 1024]`.
|
||||
/// The range of component `m` is `[4, 100]`.
|
||||
/// The range of component `p` is `[1, 100]`.
|
||||
fn close_early_approved(b: u32, m: u32, p: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `677 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)`
|
||||
// Estimated: `3997 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)`
|
||||
// Minimum execution time: 36_730_000 picoseconds.
|
||||
Weight::from_parts(40_759_167, 3997)
|
||||
// Standard Error: 228
|
||||
.saturating_add(Weight::from_parts(3_423, 0).saturating_mul(b.into()))
|
||||
// Standard Error: 2_413
|
||||
.saturating_add(Weight::from_parts(39_895, 0).saturating_mul(m.into()))
|
||||
// Standard Error: 2_352
|
||||
.saturating_add(Weight::from_parts(242_036, 0).saturating_mul(p.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(6_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(3_u64))
|
||||
.saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into()))
|
||||
.saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into()))
|
||||
.saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into()))
|
||||
}
|
||||
/// Storage: `Council::Voting` (r:1 w:1)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Members` (r:1 w:0)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Prime` (r:1 w:0)
|
||||
/// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Proposals` (r:1 w:1)
|
||||
/// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::ProposalOf` (r:0 w:1)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `m` is `[4, 100]`.
|
||||
/// The range of component `p` is `[1, 100]`.
|
||||
fn close_disapproved(m: u32, p: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `396 + m * (64 ±0) + p * (36 ±0)`
|
||||
// Estimated: `3838 + m * (65 ±0) + p * (36 ±0)`
|
||||
// Minimum execution time: 26_633_000 picoseconds.
|
||||
Weight::from_parts(30_258_684, 3838)
|
||||
// Standard Error: 1_818
|
||||
.saturating_add(Weight::from_parts(41_737, 0).saturating_mul(m.into()))
|
||||
// Standard Error: 1_772
|
||||
.saturating_add(Weight::from_parts(206_682, 0).saturating_mul(p.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(4_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(3_u64))
|
||||
.saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into()))
|
||||
.saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into()))
|
||||
}
|
||||
/// Storage: `Council::Voting` (r:1 w:1)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Members` (r:1 w:0)
|
||||
/// Proof: `Council::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Prime` (r:1 w:0)
|
||||
/// Proof: `Council::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::ProposalOf` (r:1 w:1)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
|
||||
/// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
|
||||
/// Storage: `TxPause::PausedCalls` (r:1 w:0)
|
||||
/// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Council::Proposals` (r:1 w:1)
|
||||
/// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `b` is `[2, 1024]`.
|
||||
/// The range of component `m` is `[4, 100]`.
|
||||
/// The range of component `p` is `[1, 100]`.
|
||||
fn close_approved(b: u32, m: u32, p: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `697 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)`
|
||||
// Estimated: `4010 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)`
|
||||
// Minimum execution time: 40_885_000 picoseconds.
|
||||
Weight::from_parts(46_459_730, 4010)
|
||||
// Standard Error: 234
|
||||
.saturating_add(Weight::from_parts(1_914, 0).saturating_mul(b.into()))
|
||||
// Standard Error: 2_476
|
||||
.saturating_add(Weight::from_parts(27_310, 0).saturating_mul(m.into()))
|
||||
// Standard Error: 2_414
|
||||
.saturating_add(Weight::from_parts(237_527, 0).saturating_mul(p.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(7_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(3_u64))
|
||||
.saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into()))
|
||||
.saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into()))
|
||||
.saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into()))
|
||||
}
|
||||
/// Storage: `Council::Proposals` (r:1 w:1)
|
||||
/// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Voting` (r:0 w:1)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::ProposalOf` (r:0 w:1)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `p` is `[1, 100]`.
|
||||
fn disapprove_proposal(p: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `168 + p * (32 ±0)`
|
||||
// Estimated: `1653 + p * (32 ±0)`
|
||||
// Minimum execution time: 11_806_000 picoseconds.
|
||||
Weight::from_parts(14_714_942, 1653)
|
||||
// Standard Error: 1_358
|
||||
.saturating_add(Weight::from_parts(182_535, 0).saturating_mul(p.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(1_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(3_u64))
|
||||
.saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into()))
|
||||
}
|
||||
/// Storage: `Council::ProposalOf` (r:1 w:1)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::CostOf` (r:1 w:1)
|
||||
/// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `System::Account` (r:1 w:1)
|
||||
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Balances::Holds` (r:1 w:1)
|
||||
/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Council::Proposals` (r:1 w:1)
|
||||
/// Proof: `Council::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::Voting` (r:0 w:1)
|
||||
/// Proof: `Council::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// The range of component `d` is `[0, 1]`.
|
||||
/// The range of component `p` is `[1, 100]`.
|
||||
fn kill(d: u32, p: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `1639 + d * (163 ±0) + p * (41 ±0)`
|
||||
// Estimated: `4954 + d * (1946 ±14) + p * (43 ±0)`
|
||||
// Minimum execution time: 18_912_000 picoseconds.
|
||||
Weight::from_parts(18_315_857, 4954)
|
||||
// Standard Error: 364_977
|
||||
.saturating_add(Weight::from_parts(32_810_580, 0).saturating_mul(d.into()))
|
||||
// Standard Error: 5_652
|
||||
.saturating_add(Weight::from_parts(320_835, 0).saturating_mul(p.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(3_u64))
|
||||
.saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(d.into())))
|
||||
.saturating_add(RocksDbWeight::get().writes(3_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(d.into())))
|
||||
.saturating_add(Weight::from_parts(0, 1946).saturating_mul(d.into()))
|
||||
.saturating_add(Weight::from_parts(0, 43).saturating_mul(p.into()))
|
||||
}
|
||||
/// Storage: `Council::ProposalOf` (r:1 w:0)
|
||||
/// Proof: `Council::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `Council::CostOf` (r:1 w:1)
|
||||
/// Proof: `Council::CostOf` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `System::Account` (r:1 w:1)
|
||||
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Balances::Holds` (r:1 w:1)
|
||||
/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(427), added: 2902, mode: `MaxEncodedLen`)
|
||||
fn release_proposal_cost() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `1691`
|
||||
// Estimated: `5156`
|
||||
// Minimum execution time: 64_168_000 picoseconds.
|
||||
Weight::from_parts(65_123_000, 5156)
|
||||
.saturating_add(RocksDbWeight::get().reads(4_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(3_u64))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user