diff --git a/Cargo.lock b/Cargo.lock index 6a425298c77157b141cdb581cde72934f300e7c8..46df2a5460cfe2d10760ac185c9d96bff4163689 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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" diff --git a/runtime/common/src/pallets_config.rs b/runtime/common/src/pallets_config.rs index a9bd788e6d18dec6bbe96f73789e15a4c285ba25..93e22bfa4431e973a5415d8269fc1966da6c2d20 100644 --- a/runtime/common/src/pallets_config.rs +++ b/runtime/common/src/pallets_config.rs @@ -114,7 +114,35 @@ macro_rules! pallets_config { type FeeMultiplierUpdate = (); } - impl pallet_identity::Config for Runtime { + // 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; type AddRightOrigin = EnsureRoot<Self::AccountId>; @@ -148,19 +176,16 @@ macro_rules! pallets_config { type ValidityPeriod = ValidityPeriod; } - 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>; - } + // MUNTISIG // - impl pallet_ud_accounts_storage::Config for Runtime {} + 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>; + } }; } diff --git a/runtime/g1/Cargo.toml b/runtime/g1/Cargo.toml index 815112a989ffba9b56b6bc87d8b86b6b7647ce5f..e12cc5fcf1deda839c2a4f723575eb371e8b04dc 100644 --- a/runtime/g1/Cargo.toml +++ b/runtime/g1/Cargo.toml @@ -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 diff --git a/runtime/g1/src/lib.rs b/runtime/g1/src/lib.rs index 88c2eaf381a876aa053cb4822f1510d7a83b98f1..c1b7654777c7d8a48f56f89154777625265c175a 100644 --- a/runtime/g1/src/lib.rs +++ b/runtime/g1/src/lib.rs @@ -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, } ); diff --git a/runtime/g1/src/parameters.rs b/runtime/g1/src/parameters.rs index 952f1b2766f79f8bfcb48adc6eba0f3b442542d7..6cdd3c1c340c4c6624883dc263b8327efe1f8135 100644 --- a/runtime/g1/src/parameters.rs +++ b/runtime/g1/src/parameters.rs @@ -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; +} diff --git a/runtime/gdev/Cargo.toml b/runtime/gdev/Cargo.toml index 973ed82ea15905534b6f65c4566a244dffcac3d7..68362062565c245edbb7b1928bd709c39c0d14ab 100644 --- a/runtime/gdev/Cargo.toml +++ b/runtime/gdev/Cargo.toml @@ -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 diff --git a/runtime/gdev/src/lib.rs b/runtime/gdev/src/lib.rs index 8ce521229ef3fee67056f683600e84c4b4695c6f..b32ddf09c93f6a59b0a7765f87abc08b0ce16317 100644 --- a/runtime/gdev/src/lib.rs +++ b/runtime/gdev/src/lib.rs @@ -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, diff --git a/runtime/gdev/src/parameters.rs b/runtime/gdev/src/parameters.rs index 13fd4e842d738a6569bb52781c6709639323d097..fd3b8fee5c522c7638ee60f3a0a56d7439357c6c 100644 --- a/runtime/gdev/src/parameters.rs +++ b/runtime/gdev/src/parameters.rs @@ -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; +} diff --git a/runtime/gtest/Cargo.toml b/runtime/gtest/Cargo.toml index 6bc6f3a046038f575b8587706148ad43c0b6c9b4..0be68f7c4e63d8f7bde8bcff97ec53dad98937cb 100644 --- a/runtime/gtest/Cargo.toml +++ b/runtime/gtest/Cargo.toml @@ -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 diff --git a/runtime/gtest/src/lib.rs b/runtime/gtest/src/lib.rs index 6d6f0dbedc18ea3798173aa2a6267cfe9bfc8ad1..daa107033bd8d1324b281b58aa007d851a008783 100644 --- a/runtime/gtest/src/lib.rs +++ b/runtime/gtest/src/lib.rs @@ -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, } ); diff --git a/runtime/gtest/src/parameters.rs b/runtime/gtest/src/parameters.rs index 1c6f300eb2fd1d0ebbf165dbf2cbcc8604b9b01c..8c3f78b74587a320175034aa85c2baa77a61873c 100644 --- a/runtime/gtest/src/parameters.rs +++ b/runtime/gtest/src/parameters.rs @@ -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; +}