Skip to content

Commit

Permalink
Update zenlink to rely on Polkadot-0.9.13 dependencies (#452)
Browse files Browse the repository at this point in the history
* add merkle distributor pallet and zenlink bootstrap reward functionality (#443)

* add merkle distributor pallet and zenlink bootstrap reward functionality

* change merkle distributor palletId

* update zenlink dependency
  • Loading branch information
herryho authored Dec 24, 2021
1 parent 02a128c commit ac3b28a
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 9 deletions.
34 changes: 28 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,11 @@ substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate",
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }

zenlink-protocol = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "2458c585b0313de495092a5633a547f7e8fa0588"}
zenlink-protocol-rpc = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "2458c585b0313de495092a5633a547f7e8fa0588" }
zenlink-protocol-runtime-api = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "2458c585b0313de495092a5633a547f7e8fa0588" }
zenlink-protocol = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "e5747a897cfd0fb5d322781ffe656220ae1e814f"}
zenlink-protocol-rpc = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "e5747a897cfd0fb5d322781ffe656220ae1e814f" }
zenlink-protocol-runtime-api = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "e5747a897cfd0fb5d322781ffe656220ae1e814f" }
merkle-distributor = { git = "https://github.com/zenlinkpro/merkle-distributor", rev = "e9bba954baaa0b1539e2647988da35f5fe81b0b3" }


orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "17a791edf431d7d7aee1ea3dfaeeb7bc21944301" }
orml-currencies = {git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "17a791edf431d7d7aee1ea3dfaeeb7bc21944301" }
Expand Down
2 changes: 2 additions & 0 deletions runtime/asgard/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ orml-benchmarking = { version = "0.4.1-dev", default-features = false, optional

zenlink-protocol = { version = "*", default-features = false }
zenlink-protocol-runtime-api = { version = "*", default-features = false }
merkle-distributor = {version = "*", default-features = false }

[build-dependencies]
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
Expand Down Expand Up @@ -204,6 +205,7 @@ std = [
"orml-benchmarking/std",
"zenlink-protocol/std",
"zenlink-protocol-runtime-api/std",
"merkle-distributor/std",
]

runtime-benchmarks = [
Expand Down
17 changes: 17 additions & 0 deletions runtime/asgard/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ parameter_types! {
pub const LiquidityMiningPalletId: PalletId = PalletId(*b"bf/lm###");
pub const LiquidityMiningDOTPalletId: PalletId = PalletId(*b"bf/lmdot");
pub const LighteningRedeemPalletId: PalletId = PalletId(*b"bf/ltnrd");
pub const MerkleDirtributorPalletId: PalletId = PalletId(*b"bf/mklds");
}

pub fn get_all_pallet_accounts() -> Vec<AccountId> {
Expand Down Expand Up @@ -1492,6 +1493,21 @@ impl bifrost_call_switchgear::Config for Runtime {
// bifrost runtime end

// zenlink runtime start
parameter_types! {
pub const StringLimit: u32 = 50;
}

impl merkle_distributor::Config for Runtime {
type Event = Event;
type CurrencyId = CurrencyId;
type MultiCurrency = Currencies;
type Balance = Balance;
type MerkleDistributorId = u32;
type PalletId = MerkleDirtributorPalletId;
type StringLimit = StringLimit;
type WeightInfo = ();
}

parameter_types! {
pub const ZenlinkPalletId: PalletId = PalletId(*b"/zenlink");
pub const GetExchangeFee: (u32, u32) = (3, 1000); // 0.3%
Expand Down Expand Up @@ -1658,6 +1674,7 @@ construct_runtime! {
OrmlXcm: orml_xcm::{Pallet, Call, Event<T>} = 74,

ZenlinkProtocol: zenlink_protocol::{Pallet, Call, Storage, Event<T>} = 80,
MerkleDistributor: merkle_distributor::{Pallet, Call, Storage, Event<T>} = 81,

// Bifrost modules
FlexibleFee: bifrost_flexible_fee::{Pallet, Call, Storage, Event<T>} = 100,
Expand Down
2 changes: 2 additions & 0 deletions runtime/bifrost/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ orml-xcm-support = { version = "0.4.1-dev", default-features = false }

zenlink-protocol = { version = "*", default-features = false }
zenlink-protocol-runtime-api = { version = "*", default-features = false }
merkle-distributor = {version = "*", default-features = false }

[build-dependencies]
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
Expand Down Expand Up @@ -183,6 +184,7 @@ std = [
"bifrost-lightening-redeem/std",
"zenlink-protocol/std",
"zenlink-protocol-runtime-api/std",
"merkle-distributor/std",
"xcm-support/std"
]
with-tracing = ["frame-executive/with-tracing"]
Expand Down
18 changes: 18 additions & 0 deletions runtime/bifrost/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ parameter_types! {
pub const LiquidityMiningPalletId: PalletId = PalletId(*b"bf/lm###");
pub const LiquidityMiningDOTPalletId: PalletId = PalletId(*b"bf/lmdot");
pub const LighteningRedeemPalletId: PalletId = PalletId(*b"bf/ltnrd");
pub const MerkleDirtributorPalletId: PalletId = PalletId(*b"bf/mklds");
}

impl frame_system::Config for Runtime {
Expand Down Expand Up @@ -1465,6 +1466,22 @@ impl bifrost_call_switchgear::Config for Runtime {
// Bifrost modules end

// zenlink runtime start

parameter_types! {
pub const StringLimit: u32 = 50;
}

impl merkle_distributor::Config for Runtime {
type Event = Event;
type CurrencyId = CurrencyId;
type MultiCurrency = Currencies;
type Balance = Balance;
type MerkleDistributorId = u32;
type PalletId = MerkleDirtributorPalletId;
type StringLimit = StringLimit;
type WeightInfo = ();
}

parameter_types! {
pub const ZenlinkPalletId: PalletId = PalletId(*b"/zenlink");
pub const GetExchangeFee: (u32, u32) = (3, 1000); // 0.3%
Expand Down Expand Up @@ -1629,6 +1646,7 @@ construct_runtime! {
UnknownTokens: orml_unknown_tokens::{Pallet, Storage, Event} = 73,
OrmlXcm: orml_xcm::{Pallet, Call, Event<T>} = 74,
ZenlinkProtocol: zenlink_protocol::{Pallet, Call, Storage, Event<T>} = 80,
MerkleDistributor: merkle_distributor::{Pallet, Call, Storage, Event<T>} = 81,

// Bifrost modules
FlexibleFee: bifrost_flexible_fee::{Pallet, Call, Storage, Event<T>} = 100,
Expand Down

0 comments on commit ac3b28a

Please sign in to comment.