diff --git a/Cargo.lock b/Cargo.lock index c0fc162f7e1d280fa007d29cdd279a7b2acaf9e7..868905f53e2f3d424c748e64c7b54c3bc3cb43a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1902,6 +1902,7 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "hex-literal", + "pallet-atomic-swap", "pallet-authority-discovery", "pallet-authority-members", "pallet-authorship", @@ -1958,6 +1959,7 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "hex-literal", + "pallet-atomic-swap", "pallet-authority-discovery", "pallet-authority-members", "pallet-authorship", @@ -2153,6 +2155,7 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "hex-literal", + "pallet-atomic-swap", "pallet-authority-discovery", "pallet-authority-members", "pallet-authorship", @@ -4204,6 +4207,21 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "pallet-atomic-swap" +version = "4.0.0-dev" +source = "git+https://github.com/librelois/substrate.git?branch=duniter-monthly-2022-01#277da611dd03bc181b094682acf83138e2ea85aa" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" diff --git a/runtime/common/src/pallets_config.rs b/runtime/common/src/pallets_config.rs index f24979285a5c3b649fb78747cf35f691f897163f..ef3fe5ac25ae94dc64939fadfa535fa8d47fbec5 100644 --- a/runtime/common/src/pallets_config.rs +++ b/runtime/common/src/pallets_config.rs @@ -260,6 +260,12 @@ macro_rules! pallets_config { // UTILITIES // + impl pallet_atomic_swap::Config for Runtime { + type Event = Event; + type SwapAction = pallet_atomic_swap::BalanceSwapAction<AccountId, Balances>; + type ProofLimit = frame_support::traits::ConstU32<255>; + } + parameter_types! { // One storage item; key size 32, value size 8; . pub const ProxyDepositBase: Balance = deposit(1, 8); @@ -283,6 +289,16 @@ macro_rules! pallets_config { type WeightInfo = pallet_proxy::weights::SubstrateWeight<Self>; } + 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>; + } + impl pallet_utility::Config for Runtime { type Event = Event; type Call = Call; @@ -399,17 +415,5 @@ macro_rules! pallets_config { type CertRenewablePeriod = SmithCertRenewablePeriod; type ValidityPeriod = SmithValidityPeriod; } - - // MULTISIG // - - 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 4b4701332d1e7d29897f8e78e3b285812fceee7c..06d0a4fca1781435aa273c00fb8e19c7f8fcab1a 100644 --- a/runtime/g1/Cargo.toml +++ b/runtime/g1/Cargo.toml @@ -32,6 +32,7 @@ std = [ 'frame-support/std', 'frame-system-rpc-runtime-api/std', 'frame-system/std', + 'pallet-atomic-swap/std', 'pallet-authority-discovery/std', 'pallet-authority-members/std', 'pallet-babe/std', @@ -124,6 +125,11 @@ branch = 'duniter-monthly-2022-01' optional = true version = '0.3.1' +[dependencies.pallet-atomic-swap] +default-features = false +git = 'https://github.com/librelois/substrate.git' +branch = 'duniter-monthly-2022-01' + [dependencies.pallet-authority-discovery] default-features = false git = 'https://github.com/librelois/substrate.git' diff --git a/runtime/g1/src/lib.rs b/runtime/g1/src/lib.rs index 6df027d4c8ad1d989af3319bec9ae27a00d177ca..d6afbed998fa586800e9f0dc53c5eab10c864831 100644 --- a/runtime/g1/src/lib.rs +++ b/runtime/g1/src/lib.rs @@ -219,27 +219,26 @@ construct_runtime!( // Governance stuff. Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 20, - // Cunning utilities. - Proxy: pallet_proxy::{Pallet, Call, Storage, Event<T>} = 30, - Utility: pallet_utility::{Pallet, Call, Event} = 31, - - // Universal dividend. - UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 40, - UniversalDividend: pallet_universal_dividend::{Pallet, Call, Config<T>, Storage, Event<T>} = 41, + // Universal dividend + UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 30, + UniversalDividend: pallet_universal_dividend::{Pallet, Call, Config<T>, Storage, Event<T>} = 31, // Web Of Trust - Wot: pallet_duniter_wot::<Instance1>::{Pallet} = 50, - Identity: pallet_identity::{Pallet, Call, Config<T>, Storage, Event<T>} = 51, - Membership: pallet_membership::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 52, - Cert: pallet_certification::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 53, + Wot: pallet_duniter_wot::<Instance1>::{Pallet} = 40, + Identity: pallet_identity::{Pallet, Call, Config<T>, Storage, Event<T>} = 41, + Membership: pallet_membership::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 42, + Cert: pallet_certification::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 43, // Smiths Sub-Wot - SmithsSubWot: pallet_duniter_wot::<Instance2>::{Pallet} = 60, - SmithsMembership: pallet_membership::<Instance2>::{Pallet, Call, Config<T>, Storage, Event<T>} = 62, - SmithsCert: pallet_certification::<Instance2>::{Pallet, Call, Config<T>, Storage, Event<T>} = 63, + SmithsSubWot: pallet_duniter_wot::<Instance2>::{Pallet} = 50, + SmithsMembership: pallet_membership::<Instance2>::{Pallet, Call, Config<T>, Storage, Event<T>} = 52, + SmithsCert: pallet_certification::<Instance2>::{Pallet, Call, Config<T>, Storage, Event<T>} = 53, - // Multisig dispatch. - Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>} = 70, + // Utilities + AtomicSwap: pallet_atomic_swap::{Pallet, Call, Storage, Event<T>} = 60, + Proxy: pallet_proxy::{Pallet, Call, Storage, Event<T>} = 61, + Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>} = 62, + Utility: pallet_utility::{Pallet, Call, Event} = 63, } ); diff --git a/runtime/gdev/Cargo.toml b/runtime/gdev/Cargo.toml index ba759bb8d1e2db9969b9a74a182ad0c206345040..96e93f929095d320621dabb204f492d510c6a6b3 100644 --- a/runtime/gdev/Cargo.toml +++ b/runtime/gdev/Cargo.toml @@ -33,6 +33,7 @@ std = [ 'frame-support/std', 'frame-system-rpc-runtime-api/std', 'frame-system/std', + 'pallet-atomic-swap/std', 'pallet-authority-discovery/std', 'pallet-authority-members/std', 'pallet-babe/std', @@ -127,6 +128,11 @@ branch = 'duniter-monthly-2022-01' optional = true version = '0.3.1' +[dependencies.pallet-atomic-swap] +default-features = false +git = 'https://github.com/librelois/substrate.git' +branch = 'duniter-monthly-2022-01' + [dependencies.pallet-authority-discovery] default-features = false git = 'https://github.com/librelois/substrate.git' diff --git a/runtime/gdev/src/lib.rs b/runtime/gdev/src/lib.rs index 8b0e56323c78fda1639dbee18faefe06726f6437..393b5dde2a10c5948d7782a2e6498f313ce2e59e 100644 --- a/runtime/gdev/src/lib.rs +++ b/runtime/gdev/src/lib.rs @@ -266,27 +266,26 @@ construct_runtime!( // Governance stuff Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 20, - // Utilities - Proxy: pallet_proxy::{Pallet, Call, Storage, Event<T>} = 30, - Utility: pallet_utility::{Pallet, Call, Event} = 31, - // Universal dividend - UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 40, - UniversalDividend: pallet_universal_dividend::{Pallet, Call, Config<T>, Storage, Event<T>} = 41, + UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 30, + UniversalDividend: pallet_universal_dividend::{Pallet, Call, Config<T>, Storage, Event<T>} = 31, // Web Of Trust - Wot: pallet_duniter_wot::<Instance1>::{Pallet} = 50, - Identity: pallet_identity::{Pallet, Call, Config<T>, Storage, Event<T>} = 51, - Membership: pallet_membership::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 52, - Cert: pallet_certification::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 53, + Wot: pallet_duniter_wot::<Instance1>::{Pallet} = 40, + Identity: pallet_identity::{Pallet, Call, Config<T>, Storage, Event<T>} = 41, + Membership: pallet_membership::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 42, + Cert: pallet_certification::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 43, // Smiths Sub-Wot - SmithsSubWot: pallet_duniter_wot::<Instance2>::{Pallet} = 60, - SmithsMembership: pallet_membership::<Instance2>::{Pallet, Call, Config<T>, Storage, Event<T>} = 62, - SmithsCert: pallet_certification::<Instance2>::{Pallet, Call, Config<T>, Storage, Event<T>} = 63, + SmithsSubWot: pallet_duniter_wot::<Instance2>::{Pallet} = 50, + SmithsMembership: pallet_membership::<Instance2>::{Pallet, Call, Config<T>, Storage, Event<T>} = 52, + SmithsCert: pallet_certification::<Instance2>::{Pallet, Call, Config<T>, Storage, Event<T>} = 53, - // Multisig dispatch. - Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>} = 70, + // Utilities + AtomicSwap: pallet_atomic_swap::{Pallet, Call, Storage, Event<T>} = 60, + Proxy: pallet_proxy::{Pallet, Call, Storage, Event<T>} = 61, + Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>} = 62, + Utility: pallet_utility::{Pallet, Call, Event} = 63, } ); diff --git a/runtime/gtest/Cargo.toml b/runtime/gtest/Cargo.toml index 248bc42fee7fa6c1e50709f5480cccd821e5770d..4e559b825ae83ddc26994633efcc1476fc883ce5 100644 --- a/runtime/gtest/Cargo.toml +++ b/runtime/gtest/Cargo.toml @@ -32,6 +32,7 @@ std = [ 'frame-support/std', 'frame-system-rpc-runtime-api/std', 'frame-system/std', + 'pallet-atomic-swap/std', 'pallet-authority-discovery/std', 'pallet-authority-members/std', 'pallet-babe/std', @@ -124,6 +125,11 @@ branch = 'duniter-monthly-2022-01' optional = true version = '0.3.1' +[dependencies.pallet-atomic-swap] +default-features = false +git = 'https://github.com/librelois/substrate.git' +branch = 'duniter-monthly-2022-01' + [dependencies.pallet-authority-discovery] default-features = false git = 'https://github.com/librelois/substrate.git' diff --git a/runtime/gtest/src/lib.rs b/runtime/gtest/src/lib.rs index 9edf36e92005c6d653423ea7a4de93f15287cfce..b13f1c1cd2ae75c793d41a356b30c22bd04fe323 100644 --- a/runtime/gtest/src/lib.rs +++ b/runtime/gtest/src/lib.rs @@ -219,27 +219,26 @@ construct_runtime!( // Governance stuff. Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 20, - // Cunning utilities. - Proxy: pallet_proxy::{Pallet, Call, Storage, Event<T>} = 30, - Utility: pallet_utility::{Pallet, Call, Event} = 31, - - // Universal dividend. - UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 40, - UniversalDividend: pallet_universal_dividend::{Pallet, Call, Config<T>, Storage, Event<T>} = 41, + // Universal dividend + UdAccountsStorage: pallet_ud_accounts_storage::{Pallet, Config<T>, Storage} = 30, + UniversalDividend: pallet_universal_dividend::{Pallet, Call, Config<T>, Storage, Event<T>} = 31, // Web Of Trust - Wot: pallet_duniter_wot::<Instance1>::{Pallet} = 50, - Identity: pallet_identity::{Pallet, Call, Config<T>, Storage, Event<T>} = 51, - Membership: pallet_membership::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 52, - Cert: pallet_certification::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 53, + Wot: pallet_duniter_wot::<Instance1>::{Pallet} = 40, + Identity: pallet_identity::{Pallet, Call, Config<T>, Storage, Event<T>} = 41, + Membership: pallet_membership::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 42, + Cert: pallet_certification::<Instance1>::{Pallet, Call, Config<T>, Storage, Event<T>} = 43, // Smiths Sub-Wot - SmithsSubWot: pallet_duniter_wot::<Instance2>::{Pallet} = 60, - SmithsMembership: pallet_membership::<Instance2>::{Pallet, Call, Config<T>, Storage, Event<T>} = 62, - SmithsCert: pallet_certification::<Instance2>::{Pallet, Call, Config<T>, Storage, Event<T>} = 63, + SmithsSubWot: pallet_duniter_wot::<Instance2>::{Pallet} = 50, + SmithsMembership: pallet_membership::<Instance2>::{Pallet, Call, Config<T>, Storage, Event<T>} = 52, + SmithsCert: pallet_certification::<Instance2>::{Pallet, Call, Config<T>, Storage, Event<T>} = 53, - // Multisig dispatch. - Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>} = 70, + // Utilities + AtomicSwap: pallet_atomic_swap::{Pallet, Call, Storage, Event<T>} = 60, + Proxy: pallet_proxy::{Pallet, Call, Storage, Event<T>} = 61, + Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>} = 62, + Utility: pallet_utility::{Pallet, Call, Event} = 63, } );