From 5f44dda8a83922e22b1b8489d6b4881019d21d50 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Mon, 31 Jan 2022 11:14:20 +0100 Subject: [PATCH 1/3] add missing constant/getter --- frame/mosaic/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frame/mosaic/src/lib.rs b/frame/mosaic/src/lib.rs index b3933bfb18e..08c204aea65 100644 --- a/frame/mosaic/src/lib.rs +++ b/frame/mosaic/src/lib.rs @@ -56,7 +56,9 @@ pub mod pallet { type PalletId: Get; type Assets: Mutate> + Transfer>; + #[pallet::constant] type MinimumTTL: Get>; + #[pallet::constant] type MinimumTimeLockPeriod: Get>; type BudgetPenaltyDecayer: Decayer, BlockNumberOf> @@ -116,6 +118,7 @@ pub mod pallet { } #[pallet::storage] + #[pallet::getter(fn relayer)] pub type Relayer = StorageValue<_, StaleRelayer, OptionQuery>; From 96164c23ac64e369df5e401dd4f37c874dc43e0e Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Mon, 31 Jan 2022 11:14:41 +0100 Subject: [PATCH 2/3] fix mosaic bringing std via num-traits default features --- frame/mosaic/Cargo.toml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/frame/mosaic/Cargo.toml b/frame/mosaic/Cargo.toml index 6b6d6a68060..4853e9d7bba 100644 --- a/frame/mosaic/Cargo.toml +++ b/frame/mosaic/Cargo.toml @@ -36,16 +36,14 @@ xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.1 log = { version = "0.4.14", default-features = false } scale-info = { version = "1.0", default-features = false, features = ["derive"] } -num-traits = "0.2.14" +num-traits = { version = "0.2.14", default-features = false } plotters = {version = "0.3.1", optional = true} [dev-dependencies] -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } proptest = "0.9.6" -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "17a791edf431d7d7aee1ea3dfaeeb7bc21944301" } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "17a791edf431d7d7aee1ea3dfaeeb7bc21944301", default-features = false} orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "17a791edf431d7d7aee1ea3dfaeeb7bc21944301", default-features = false } -composable-tests-helpers = { version = "0.0.1", path = "../composable-tests-helpers", default-features = false } - +composable-tests-helpers = { path = "../composable-tests-helpers", default-features = false } [features] default = ["std"] @@ -61,12 +59,13 @@ std = [ "sp-core/std", "sp-std/std", "xcm/std", + "num-traits/std", ] runtime-benchmarks = [ - 'frame-benchmarking', - 'frame-support/runtime-benchmarks', - 'frame-system/runtime-benchmarks', + "frame-benchmarking", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", ] visualization = ["plotters"] From 9078c27a9148adff71bc6f147f1c002315258add Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Mon, 31 Jan 2022 11:15:04 +0100 Subject: [PATCH 3/3] add mosaic to dali runtime --- Cargo.lock | 2 +- runtime/dali/Cargo.toml | 7 +++++-- runtime/dali/src/lib.rs | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index efacee828b6..fcc37358a4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2392,6 +2392,7 @@ dependencies = [ "pallet-identity", "pallet-indices", "pallet-membership", + "pallet-mosaic", "pallet-multisig", "pallet-oracle", "pallet-randomness-collective-flip", @@ -7093,7 +7094,6 @@ dependencies = [ "num-traits", "orml-tokens", "orml-traits", - "pallet-balances", "parity-scale-codec", "plotters", "proptest 0.9.6", diff --git a/runtime/dali/Cargo.toml b/runtime/dali/Cargo.toml index 2108e83a47d..97c5b8c6932 100644 --- a/runtime/dali/Cargo.toml +++ b/runtime/dali/Cargo.toml @@ -58,7 +58,7 @@ assets = { package = "pallet-assets", path = '../../frame/assets', default-featu crowdloan-rewards = { package = "pallet-crowdloan-rewards", path = '../../frame/crowdloan-rewards', default-features = false } bonded-finance = { package = "pallet-bonded-finance", path = "../../frame/bonded-finance", default-features = false } vesting = { package = "pallet-vesting", path = "../../frame/vesting", default-features = false } - dutch-auction = { package = "pallet-dutch-auction", path = "../../frame/dutch-auction", default-features = false } +dutch-auction = { package = "pallet-dutch-auction", path = "../../frame/dutch-auction", default-features = false } common = { path = "../common", default-features = false } primitives = { path = "../primitives", default-features = false } oracle = { package = "pallet-oracle", path = "../../frame/oracle", default-features = false } @@ -67,6 +67,7 @@ governance-registry = { package = "pallet-governance-registry", path = "../../fr currency-factory = { package = "pallet-currency-factory", path = "../../frame/currency-factory", default-features = false } composable-traits = { path = "../../frame/composable-traits" , default-features = false} call-filter = { package = "pallet-call-filter", path = "../../frame/call-filter", default-features = false } +mosaic = { package = "pallet-mosaic", path = "../../frame/mosaic", default-features = false } # Used for the node template's RPCs system-rpc-runtime-api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false } @@ -172,7 +173,8 @@ std = [ "crowdloan-rewards/std", "bonded-finance/std", "dutch-auction/std", - "vesting/std" + "vesting/std", + "mosaic/std" ] runtime-benchmarks = [ "assets/runtime-benchmarks", @@ -207,4 +209,5 @@ runtime-benchmarks = [ "assets/runtime-benchmarks", "bonded-finance/runtime-benchmarks", "dutch-auction/runtime-benchmarks", + "mosaic/runtime-benchmarks" ] diff --git a/runtime/dali/src/lib.rs b/runtime/dali/src/lib.rs index e3ea818b77b..addc91bd2d2 100644 --- a/runtime/dali/src/lib.rs +++ b/runtime/dali/src/lib.rs @@ -859,6 +859,22 @@ impl dutch_auction::Config for Runtime { type WeightInfo = weights::dutch_auction::WeightInfo; } +parameter_types! { + pub const MosaicId: PalletId = PalletId(*b"plmosaic"); + pub const MinimumTTL: BlockNumber = 10; + pub const MinimumTimeLockPeriod: BlockNumber = 20; +} + +impl mosaic::Config for Runtime { + type Event = Event; + type PalletId = MosaicId; + type Assets = Assets; + type MinimumTTL = MinimumTTL; + type MinimumTimeLockPeriod = MinimumTimeLockPeriod; + type BudgetPenaltyDecayer = mosaic::BudgetPenaltyDecayer; + type NetworkId = u32; +} + construct_runtime!( pub enum Runtime where Block = Block, @@ -913,6 +929,7 @@ construct_runtime!( Vesting: vesting::{Call, Event, Pallet, Storage} = 59, BondedFinance: bonded_finance::{Call, Event, Pallet, Storage} = 60, DutchAuction: dutch_auction::{Pallet, Call, Storage, Event} = 61, + Mosaic: mosaic::{Pallet, Call, Storage, Event} = 62, CallFilter: call_filter::{Pallet, Call, Storage, Event} = 100, }