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
......@@ -1842,6 +1842,7 @@ dependencies = [
"pallet-certification",
"pallet-grandpa",
"pallet-identity",
"pallet-multisig",
"pallet-randomness-collective-flip",
"pallet-sudo",
"pallet-timestamp",
......@@ -1849,6 +1850,7 @@ dependencies = [
"pallet-transaction-payment-rpc-runtime-api",
"pallet-ud-accounts-storage",
"pallet-universal-dividend",
"pallet-utility",
"parity-scale-codec",
"scale-info",
"serde",
......@@ -1898,6 +1900,7 @@ dependencies = [
"pallet-transaction-payment-rpc-runtime-api",
"pallet-ud-accounts-storage",
"pallet-universal-dividend",
"pallet-utility",
"parity-scale-codec",
"scale-info",
"serde",
......@@ -2035,6 +2038,7 @@ dependencies = [
"pallet-certification",
"pallet-grandpa",
"pallet-identity",
"pallet-multisig",
"pallet-randomness-collective-flip",
"pallet-sudo",
"pallet-timestamp",
......@@ -2042,6 +2046,7 @@ dependencies = [
"pallet-transaction-payment-rpc-runtime-api",
"pallet-ud-accounts-storage",
"pallet-universal-dividend",
"pallet-utility",
"parity-scale-codec",
"scale-info",
"serde",
......@@ -4190,6 +4195,21 @@ dependencies = [
"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]]
name = "parity-db"
version = "0.3.5"
......
......@@ -114,6 +114,34 @@ macro_rules! pallets_config {
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 {
type ConfirmPeriod = ConfirmPeriod;
type Event = Event;
......@@ -148,19 +176,16 @@ macro_rules! pallets_config {
type ValidityPeriod = ValidityPeriod;
}
impl pallet_universal_dividend::Config for Runtime {
type Currency = pallet_balances::Pallet<Runtime>;
// MUNTISIG //
impl pallet_multisig::Config for 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>;
type Call = Call;
type Currency = Balances;
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
type MaxSignatories = MaxSignatories;
type WeightInfo = pallet_multisig::weights::SubstrateWeight<Self>;
}
impl pallet_ud_accounts_storage::Config for Runtime {}
};
}
......@@ -126,6 +126,11 @@ default-features = false
git = 'https://github.com/librelois/substrate.git'
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]
default-features = false
git = 'https://github.com/librelois/substrate.git'
......@@ -151,6 +156,11 @@ default-features = false
git = 'https://github.com/librelois/substrate.git'
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]
version = "1.0.101"
optional = true
......
......@@ -175,7 +175,7 @@ construct_runtime!(
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 20,
// Cunning utilities.
//Utility: pallet_utility::{Pallet, Call, Event} = 30,
Utility: pallet_utility::{Pallet, Call, Event} = 30,
// Universal dividend.
UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 40,
......@@ -184,6 +184,9 @@ construct_runtime!(
// Web Of Trust
Identity: pallet_identity::{Pallet, Call, Config<T>, Storage, Event<T>} = 50,
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! {
pub const UdReevalPeriod: Balance = 182;
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
git = 'https://github.com/librelois/substrate.git'
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]
version = "1.0.101"
optional = true
......
......@@ -134,16 +134,6 @@ 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.
......@@ -168,7 +158,7 @@ construct_runtime!(
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 20,
// Cunning utilities.
//Utility: pallet_utility::{Pallet, Call, Event} = 30,
Utility: pallet_utility::{Pallet, Call, Event} = 30,
// Universal dividend.
UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 40,
......
......@@ -35,13 +35,6 @@ 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! {
......@@ -70,3 +63,10 @@ parameter_types! {
pub const UdReevalPeriod: Balance = 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
git = 'https://github.com/librelois/substrate.git'
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]
default-features = false
git = 'https://github.com/librelois/substrate.git'
......@@ -151,6 +156,12 @@ default-features = false
git = 'https://github.com/librelois/substrate.git'
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]
version = "1.0.101"
optional = true
......
......@@ -175,7 +175,7 @@ construct_runtime!(
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 20,
// Cunning utilities.
//Utility: pallet_utility::{Pallet, Call, Event} = 30,
Utility: pallet_utility::{Pallet, Call, Event} = 30,
// Universal dividend.
UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 40,
......@@ -184,6 +184,9 @@ construct_runtime!(
// Web Of Trust
Identity: pallet_identity::{Pallet, Call, Config<T>, Storage, Event<T>} = 50,
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! {
pub const UdReevalPeriod: Balance = 7;
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