From b59eacdaa0467164a8a958e02665734488bac464 Mon Sep 17 00:00:00 2001 From: tuxmain <tuxmain@zettascript.org> Date: Thu, 29 Jul 2021 23:45:49 +0200 Subject: [PATCH] feat: add multisig pallet --- Cargo.lock | 15 +++++++++++++++ runtime/gdev/Cargo.toml | 6 ++++++ runtime/gdev/src/lib.rs | 11 +++++++++++ runtime/gdev/src/parameters.rs | 7 +++++++ 4 files changed, 39 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 95074041e..eecbf7959 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2008,6 +2008,7 @@ dependencies = [ "pallet-certification", "pallet-grandpa", "pallet-identity", + "pallet-multisig", "pallet-randomness-collective-flip", "pallet-sudo", "pallet-transaction-payment", @@ -4079,6 +4080,20 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-multisig" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?tag=monthly-2021-08#4d28ebeb8b027ca0227fe7779c5beb70a7b56467" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" diff --git a/runtime/gdev/Cargo.toml b/runtime/gdev/Cargo.toml index 15a5fc16e..121e82af6 100644 --- a/runtime/gdev/Cargo.toml +++ b/runtime/gdev/Cargo.toml @@ -38,6 +38,7 @@ std = [ 'pallet-certification/std', 'pallet-identity/std', 'pallet-grandpa/std', + 'pallet-multisig/std', 'pallet-randomness-collective-flip/std', 'pallet-sudo/std', 'pallet-universal-dividend/std', @@ -123,6 +124,11 @@ default-features = false git = 'https://github.com/paritytech/substrate.git' tag = 'monthly-2021-08' +[dependencies.pallet-multisig] +default-features = false +git = 'https://github.com/paritytech/substrate.git' +tag = 'monthly-2021-08' + [dependencies.pallet-randomness-collective-flip] default-features = false git = 'https://github.com/paritytech/substrate.git' diff --git a/runtime/gdev/src/lib.rs b/runtime/gdev/src/lib.rs index cbe02cce4..2b3479c1f 100644 --- a/runtime/gdev/src/lib.rs +++ b/runtime/gdev/src/lib.rs @@ -132,6 +132,16 @@ common_runtime::pallets_config! { type Event = Event; type Call = Call; } + + impl pallet_multisig::Config for Runtime { + type Event = Event; + type Call = Call; + type Currency = Balances; + type DepositBase = DepositBase; + type DepositFactor = DepositFactor; + type MaxSignatories = MaxSignatories; + type WeightInfo = pallet_multisig::weights::SubstrateWeight<Self>; + } } // Create the runtime by composing the FRAME pallets that were previously configured. @@ -145,6 +155,7 @@ construct_runtime!( RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage}, Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>}, + Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>}, TransactionPayment: pallet_transaction_payment::{Pallet, Storage}, Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>}, UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage}, diff --git a/runtime/gdev/src/parameters.rs b/runtime/gdev/src/parameters.rs index c7d9c87e4..8e44733c2 100644 --- a/runtime/gdev/src/parameters.rs +++ b/runtime/gdev/src/parameters.rs @@ -30,6 +30,13 @@ frame_support::parameter_types! { pub const TransactionByteFee: Balance = 0; } +// Multisig +parameter_types! { + pub const DepositBase: Balance = 1000; + pub const DepositFactor: Balance = 10; + pub const MaxSignatories: u16 = 5; +} + // Identity pub const IDTY_CREATE_PERIOD: BlockNumber = 100; frame_support::parameter_types! { -- GitLab