multisig first config

This commit is contained in:
Ozgun Ozerk
2023-11-11 20:31:30 +03:00
parent 55a77ca05b
commit 41d77834af
6 changed files with 128 additions and 0 deletions
Generated
+1
View File
@@ -7380,6 +7380,7 @@ dependencies = [
"pallet-authorship",
"pallet-balances",
"pallet-collator-selection",
"pallet-multisig",
"pallet-parachain-template",
"pallet-session",
"pallet-sudo",
+4
View File
@@ -39,6 +39,7 @@ frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch
pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
@@ -104,6 +105,7 @@ std = [
"pallet-balances/std",
"pallet-collator-selection/std",
"pallet-parachain-template/std",
"pallet-multisig/std",
"pallet-session/std",
"pallet-sudo/std",
"pallet-timestamp/std",
@@ -144,6 +146,7 @@ runtime-benchmarks = [
"hex-literal",
"pallet-balances/runtime-benchmarks",
"pallet-collator-selection/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
"pallet-parachain-template/runtime-benchmarks",
"pallet-sudo/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
@@ -169,6 +172,7 @@ try-runtime = [
"pallet-authorship/try-runtime",
"pallet-balances/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-multisig/try-runtime",
"pallet-parachain-template/try-runtime",
"pallet-session/try-runtime",
"pallet-sudo/try-runtime",
+11
View File
@@ -0,0 +1,11 @@
pub mod currency {
use crate::Balance;
pub const MILLICENTS: Balance = 1_000_000_000;
pub const CENTS: Balance = 1_000 * MILLICENTS; // assume this is worth about a cent.
pub const DOLLARS: Balance = 100 * CENTS;
pub const fn deposit(items: u32, bytes: u32) -> Balance {
items as Balance * 15 * CENTS + (bytes as Balance) * 6 * CENTS
}
}
+22
View File
@@ -6,6 +6,8 @@
#[cfg(feature = "std")]
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
pub mod constants;
use constants::currency::*;
mod weights;
pub mod xcm_config;
@@ -27,6 +29,7 @@ use frame_system::{
limits::{BlockLength, BlockWeights},
EnsureRoot,
};
pub use pallet_multisig;
/// Import the template pallet.
pub use pallet_parachain_template;
use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
@@ -426,6 +429,24 @@ impl cumulus_pallet_dmp_queue::Config for Runtime {
type XcmExecutor = XcmExecutor<XcmConfig>;
}
parameter_types! {
// One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes.
pub const DepositBase: Balance = deposit(1, 88);
// Additional storage item size of 32 bytes.
pub const DepositFactor: Balance = deposit(0, 32);
pub const MaxSignatories: u16 = 100;
}
impl pallet_multisig::Config for Runtime {
type Currency = Balances;
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
type MaxSignatories = MaxSignatories;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>; // TODO: others should check too, I copied this from: https://github.com/paritytech/statemint/blob/master/runtime/statemine/src/weights/pallet_multisig.rs
}
parameter_types! {
pub const Period: u32 = 6 * HOURS;
pub const Offset: u32 = 0;
@@ -506,6 +527,7 @@ construct_runtime!(
// Governance
Sudo: pallet_sudo = 15,
Multisig: pallet_multisig,
// Collator support. The order of these 4 are important and shall not change.
Authorship: pallet_authorship = 20,
+1
View File
@@ -19,6 +19,7 @@
pub mod block_weights;
pub mod extrinsic_weights;
pub mod pallet_multisig;
pub mod paritydb_weights;
pub mod rocksdb_weights;
+89
View File
@@ -0,0 +1,89 @@
//! Autogenerated weights for pallet_multisig
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-05-31, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE:
//! `[]` EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN:
//! Some("statemine-dev"), DB CACHE: 128
// Executed Command:
// ./target/release/statemint
// benchmark
// --chain=statemine-dev
// --execution=wasm
// --wasm-execution=compiled
// --pallet=pallet_multisig
// --extrinsic=*
// --steps=50
// --repeat=20
// --raw
// --output=./runtime/statemine/src/weights/
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weight functions for pallet_multisig.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> {
fn as_multi_threshold_1(z: u32) -> Weight {
Weight::from(15_911_000)
// Standard Error: 0
.saturating_add((Weight::from(1_000)).saturating_mul(z.into()))
}
fn as_multi_create(s: u32, z: u32) -> Weight {
Weight::from(55_326_000)
// Standard Error: 0
.saturating_add(Weight::from(133_000).saturating_mul(s.into()))
// Standard Error: 0
.saturating_add(Weight::from(1_000).saturating_mul(z.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
fn as_multi_approve(s: u32, z: u32) -> Weight {
Weight::from(32_430_000)
// Standard Error: 0
.saturating_add(Weight::from(148_000).saturating_mul(s.into()))
// Standard Error: 0
.saturating_add(Weight::from(1_000).saturating_mul(z.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
fn as_multi_complete(s: u32, z: u32) -> Weight {
Weight::from(80_926_000)
// Standard Error: 0
.saturating_add(Weight::from(276_000).saturating_mul(s.into()))
// Standard Error: 0
.saturating_add(Weight::from(5_000).saturating_mul(z.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
fn approve_as_multi_create(s: u32) -> Weight {
Weight::from(54_860_000)
// Standard Error: 0
.saturating_add(Weight::from(134_000).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
fn approve_as_multi_approve(s: u32) -> Weight {
Weight::from(31_924_000)
// Standard Error: 0
.saturating_add(Weight::from(154_000).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
fn cancel_as_multi(s: u32) -> Weight {
Weight::from(103_770_000)
// Standard Error: 0
.saturating_add(Weight::from(130_000).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
}