Skip to content
Snippets Groups Projects
Commit 846f4d8d authored by Éloïs's avatar Éloïs
Browse files

feat(runtimes): add pallet utility & pallet multisig in all runtimes

parent e7220d01
No related branches found
No related tags found
1 merge request!9upgrade substrate to monthly-2022-01
This commit is part of merge request !9. Comments created here will be created in the context of that merge request.
...@@ -1842,6 +1842,7 @@ dependencies = [ ...@@ -1842,6 +1842,7 @@ dependencies = [
"pallet-certification", "pallet-certification",
"pallet-grandpa", "pallet-grandpa",
"pallet-identity", "pallet-identity",
"pallet-multisig",
"pallet-randomness-collective-flip", "pallet-randomness-collective-flip",
"pallet-sudo", "pallet-sudo",
"pallet-timestamp", "pallet-timestamp",
...@@ -1849,6 +1850,7 @@ dependencies = [ ...@@ -1849,6 +1850,7 @@ dependencies = [
"pallet-transaction-payment-rpc-runtime-api", "pallet-transaction-payment-rpc-runtime-api",
"pallet-ud-accounts-storage", "pallet-ud-accounts-storage",
"pallet-universal-dividend", "pallet-universal-dividend",
"pallet-utility",
"parity-scale-codec", "parity-scale-codec",
"scale-info", "scale-info",
"serde", "serde",
...@@ -1898,6 +1900,7 @@ dependencies = [ ...@@ -1898,6 +1900,7 @@ dependencies = [
"pallet-transaction-payment-rpc-runtime-api", "pallet-transaction-payment-rpc-runtime-api",
"pallet-ud-accounts-storage", "pallet-ud-accounts-storage",
"pallet-universal-dividend", "pallet-universal-dividend",
"pallet-utility",
"parity-scale-codec", "parity-scale-codec",
"scale-info", "scale-info",
"serde", "serde",
...@@ -2035,6 +2038,7 @@ dependencies = [ ...@@ -2035,6 +2038,7 @@ dependencies = [
"pallet-certification", "pallet-certification",
"pallet-grandpa", "pallet-grandpa",
"pallet-identity", "pallet-identity",
"pallet-multisig",
"pallet-randomness-collective-flip", "pallet-randomness-collective-flip",
"pallet-sudo", "pallet-sudo",
"pallet-timestamp", "pallet-timestamp",
...@@ -2042,6 +2046,7 @@ dependencies = [ ...@@ -2042,6 +2046,7 @@ dependencies = [
"pallet-transaction-payment-rpc-runtime-api", "pallet-transaction-payment-rpc-runtime-api",
"pallet-ud-accounts-storage", "pallet-ud-accounts-storage",
"pallet-universal-dividend", "pallet-universal-dividend",
"pallet-utility",
"parity-scale-codec", "parity-scale-codec",
"scale-info", "scale-info",
"serde", "serde",
...@@ -4190,6 +4195,21 @@ dependencies = [ ...@@ -4190,6 +4195,21 @@ dependencies = [
"sp-std", "sp-std",
] ]
[[package]]
name = "pallet-utility"
version = "4.0.0-dev"
source = "git+https://github.com/librelois/substrate.git?branch=duniter-monthly-2022-01#dfa512d0e1475ef671bab9b4d76c17f20a1a297a"
dependencies = [
"frame-support",
"frame-system",
"parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
"sp-runtime",
"sp-std",
]
[[package]] [[package]]
name = "parity-db" name = "parity-db"
version = "0.3.5" version = "0.3.5"
......
...@@ -114,6 +114,34 @@ macro_rules! pallets_config { ...@@ -114,6 +114,34 @@ macro_rules! pallets_config {
type FeeMultiplierUpdate = (); type FeeMultiplierUpdate = ();
} }
// UTILITY //
impl pallet_utility::Config for Runtime {
type Event = Event;
type Call = Call;
type PalletsOrigin = OriginCaller;
type WeightInfo = pallet_utility::weights::SubstrateWeight<Self>;
}
// MONEY CREATION //
impl pallet_universal_dividend::Config for Runtime {
type Currency = pallet_balances::Pallet<Runtime>;
type Event = Event;
type MembersCount = common_runtime::providers::UdAccountsProvider<Runtime>;
type MembersIds = common_runtime::providers::UdAccountsProvider<Runtime>;
type SquareMoneyGrowthRate = SquareMoneyGrowthRate;
type UdCreationPeriod = UdCreationPeriod;
type UdFirstReeval = UdFirstReeval;
type UdReevalPeriod = UdReevalPeriod;
type UdReevalPeriodInBlocks = UdReevalPeriodInBlocks;
type UnitsPerUd = frame_support::traits::ConstU64<1_000>;
}
impl pallet_ud_accounts_storage::Config for Runtime {}
// WEB OF TRUST //
impl pallet_identity::Config for Runtime { impl pallet_identity::Config for Runtime {
type ConfirmPeriod = ConfirmPeriod; type ConfirmPeriod = ConfirmPeriod;
type Event = Event; type Event = Event;
...@@ -148,19 +176,16 @@ macro_rules! pallets_config { ...@@ -148,19 +176,16 @@ macro_rules! pallets_config {
type ValidityPeriod = ValidityPeriod; type ValidityPeriod = ValidityPeriod;
} }
impl pallet_universal_dividend::Config for Runtime { // MUNTISIG //
type Currency = pallet_balances::Pallet<Runtime>;
impl pallet_multisig::Config for Runtime {
type Event = Event; type Event = Event;
type MembersCount = common_runtime::providers::UdAccountsProvider<Runtime>; type Call = Call;
type MembersIds = common_runtime::providers::UdAccountsProvider<Runtime>; type Currency = Balances;
type SquareMoneyGrowthRate = SquareMoneyGrowthRate; type DepositBase = DepositBase;
type UdCreationPeriod = UdCreationPeriod; type DepositFactor = DepositFactor;
type UdFirstReeval = UdFirstReeval; type MaxSignatories = MaxSignatories;
type UdReevalPeriod = UdReevalPeriod; type WeightInfo = pallet_multisig::weights::SubstrateWeight<Self>;
type UdReevalPeriodInBlocks = UdReevalPeriodInBlocks;
type UnitsPerUd = frame_support::traits::ConstU64<1_000>;
} }
impl pallet_ud_accounts_storage::Config for Runtime {}
}; };
} }
...@@ -126,6 +126,11 @@ default-features = false ...@@ -126,6 +126,11 @@ default-features = false
git = 'https://github.com/librelois/substrate.git' git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01' branch = 'duniter-monthly-2022-01'
[dependencies.pallet-multisig]
default-features = false
git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01'
[dependencies.pallet-randomness-collective-flip] [dependencies.pallet-randomness-collective-flip]
default-features = false default-features = false
git = 'https://github.com/librelois/substrate.git' git = 'https://github.com/librelois/substrate.git'
...@@ -151,6 +156,11 @@ default-features = false ...@@ -151,6 +156,11 @@ default-features = false
git = 'https://github.com/librelois/substrate.git' git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01' branch = 'duniter-monthly-2022-01'
[dependencies.pallet-utility]
default-features = false
git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01'
[dependencies.serde] [dependencies.serde]
version = "1.0.101" version = "1.0.101"
optional = true optional = true
......
...@@ -175,7 +175,7 @@ construct_runtime!( ...@@ -175,7 +175,7 @@ construct_runtime!(
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 20, Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 20,
// Cunning utilities. // Cunning utilities.
//Utility: pallet_utility::{Pallet, Call, Event} = 30, Utility: pallet_utility::{Pallet, Call, Event} = 30,
// Universal dividend. // Universal dividend.
UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 40, UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 40,
...@@ -184,6 +184,9 @@ construct_runtime!( ...@@ -184,6 +184,9 @@ construct_runtime!(
// Web Of Trust // Web Of Trust
Identity: pallet_identity::{Pallet, Call, Config<T>, Storage, Event<T>} = 50, Identity: pallet_identity::{Pallet, Call, Config<T>, Storage, Event<T>} = 50,
StrongCert: pallet_certification::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 51, StrongCert: pallet_certification::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 51,
// Multisig dispatch.
Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>} = 60,
} }
); );
......
...@@ -69,3 +69,10 @@ parameter_types! { ...@@ -69,3 +69,10 @@ parameter_types! {
pub const UdReevalPeriod: Balance = 182; pub const UdReevalPeriod: Balance = 182;
pub const UdReevalPeriodInBlocks: BlockNumber = 2_620_800; // 86400 * 182 / 6 pub const UdReevalPeriodInBlocks: BlockNumber = 2_620_800; // 86400 * 182 / 6
} }
// Multisig
parameter_types! {
pub const DepositBase: Balance = 1000;
pub const DepositFactor: Balance = 10;
pub const MaxSignatories: u16 = 5;
}
...@@ -152,6 +152,11 @@ default-features = false ...@@ -152,6 +152,11 @@ default-features = false
git = 'https://github.com/librelois/substrate.git' git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01' branch = 'duniter-monthly-2022-01'
[dependencies.pallet-utility]
default-features = false
git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01'
[dependencies.serde] [dependencies.serde]
version = "1.0.101" version = "1.0.101"
optional = true optional = true
......
...@@ -134,16 +134,6 @@ common_runtime::pallets_config! { ...@@ -134,16 +134,6 @@ common_runtime::pallets_config! {
type Event = Event; type Event = Event;
type Call = Call; 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. // Create the runtime by composing the FRAME pallets that were previously configured.
...@@ -168,7 +158,7 @@ construct_runtime!( ...@@ -168,7 +158,7 @@ construct_runtime!(
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 20, Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 20,
// Cunning utilities. // Cunning utilities.
//Utility: pallet_utility::{Pallet, Call, Event} = 30, Utility: pallet_utility::{Pallet, Call, Event} = 30,
// Universal dividend. // Universal dividend.
UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 40, UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 40,
......
...@@ -35,13 +35,6 @@ frame_support::parameter_types! { ...@@ -35,13 +35,6 @@ frame_support::parameter_types! {
pub const TransactionByteFee: Balance = 0; pub const TransactionByteFee: Balance = 0;
} }
// Multisig
parameter_types! {
pub const DepositBase: Balance = 1000;
pub const DepositFactor: Balance = 10;
pub const MaxSignatories: u16 = 5;
}
// Identity // Identity
pub const IDTY_CREATE_PERIOD: BlockNumber = 100; pub const IDTY_CREATE_PERIOD: BlockNumber = 100;
frame_support::parameter_types! { frame_support::parameter_types! {
...@@ -70,3 +63,10 @@ parameter_types! { ...@@ -70,3 +63,10 @@ parameter_types! {
pub const UdReevalPeriod: Balance = 10; pub const UdReevalPeriod: Balance = 10;
pub const UdReevalPeriodInBlocks: BlockNumber = 20 * 10; pub const UdReevalPeriodInBlocks: BlockNumber = 20 * 10;
} }
// Multisig
parameter_types! {
pub const DepositBase: Balance = 1000;
pub const DepositFactor: Balance = 10;
pub const MaxSignatories: u16 = 5;
}
...@@ -126,6 +126,11 @@ default-features = false ...@@ -126,6 +126,11 @@ default-features = false
git = 'https://github.com/librelois/substrate.git' git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01' branch = 'duniter-monthly-2022-01'
[dependencies.pallet-multisig]
default-features = false
git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01'
[dependencies.pallet-randomness-collective-flip] [dependencies.pallet-randomness-collective-flip]
default-features = false default-features = false
git = 'https://github.com/librelois/substrate.git' git = 'https://github.com/librelois/substrate.git'
...@@ -151,6 +156,12 @@ default-features = false ...@@ -151,6 +156,12 @@ default-features = false
git = 'https://github.com/librelois/substrate.git' git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01' branch = 'duniter-monthly-2022-01'
[dependencies.pallet-utility]
default-features = false
git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01'
[dependencies.serde] [dependencies.serde]
version = "1.0.101" version = "1.0.101"
optional = true optional = true
......
...@@ -175,7 +175,7 @@ construct_runtime!( ...@@ -175,7 +175,7 @@ construct_runtime!(
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 20, Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 20,
// Cunning utilities. // Cunning utilities.
//Utility: pallet_utility::{Pallet, Call, Event} = 30, Utility: pallet_utility::{Pallet, Call, Event} = 30,
// Universal dividend. // Universal dividend.
UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 40, UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 40,
...@@ -184,6 +184,9 @@ construct_runtime!( ...@@ -184,6 +184,9 @@ construct_runtime!(
// Web Of Trust // Web Of Trust
Identity: pallet_identity::{Pallet, Call, Config<T>, Storage, Event<T>} = 50, Identity: pallet_identity::{Pallet, Call, Config<T>, Storage, Event<T>} = 50,
StrongCert: pallet_certification::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 51, StrongCert: pallet_certification::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 51,
// Multisig dispatch.
Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>} = 60,
} }
); );
......
...@@ -68,3 +68,10 @@ parameter_types! { ...@@ -68,3 +68,10 @@ parameter_types! {
pub const UdReevalPeriod: Balance = 7; pub const UdReevalPeriod: Balance = 7;
pub const UdReevalPeriodInBlocks: BlockNumber = 100800; // 86400 *7 / 6 pub const UdReevalPeriodInBlocks: BlockNumber = 100800; // 86400 *7 / 6
} }
// Multisig
parameter_types! {
pub const DepositBase: Balance = 1000;
pub const DepositFactor: Balance = 10;
pub const MaxSignatories: u16 = 5;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment