Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dmarket and modified Migration pallet to testnet #212

Merged
merged 16 commits into from
Aug 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add dmarket to testnet
valentinfernandez1 committed Aug 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit c5f67c3a223451c56048463406198b67306b4d9f
23 changes: 23 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions runtime/testnet/Cargo.toml
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ smallvec = { workspace = true }

# Local
runtime-common = { workspace = true, default-features = false }
pallet-dmarket = { workspace = true, default-features = false }
pallet-marketplace = { workspace = true, default-features = false }
pallet-multibatching = { workspace = true, default-features = false }
xcm-primitives = { path = "../../primitives/xcm", default-features = false }
@@ -120,6 +121,7 @@ std = [
"pallet-balances/std",
"pallet-collator-selection/std",
"pallet-collective/std",
"pallet-dmarket/std",
"pallet-multibatching/std",
"pallet-marketplace/std",
"pallet-multisig/std",
@@ -170,6 +172,7 @@ runtime-benchmarks = [
"pallet-collator-selection/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"pallet-dmarket/runtime-benchmarks",
"pallet-marketplace/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
"pallet-multibatching/runtime-benchmarks",
@@ -204,6 +207,7 @@ try-runtime = [
"pallet-balances/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-collective/try-runtime",
"pallet-dmarket/try-runtime",
"pallet-multibatching/try-runtime",
"pallet-marketplace/try-runtime",
"pallet-multisig/try-runtime",
27 changes: 27 additions & 0 deletions runtime/testnet/src/lib.rs
Original file line number Diff line number Diff line change
@@ -41,9 +41,11 @@ use frame_system::{
limits::{BlockLength, BlockWeights},
EnsureRoot,
};
use pallet_dmarket::{Item, TradeParams};
use pallet_nfts::PalletFeatures;
use parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling};
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use polkadot_primitives::Moment;
pub use runtime_common::{
AccountId, Balance, BlockNumber, DealWithFees, Hash, IncrementableU256, Nonce, Signature,
AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, MINUTES, NORMAL_DISPATCH_RATIO,
@@ -654,6 +656,17 @@ impl pallet_marketplace::Config for Runtime {
type BenchmarkHelper = ();
}

impl pallet_dmarket::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type Currency = Balances;
type Signature = Signature;
type Signer = <Signature as Verify>::Signer;
type Domain = DOMAIN;
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = ();
}

parameter_types! {
pub const ProxyDepositBase: Balance = deposit(1, 8);
pub const ProxyDepositFactor: Balance = deposit(0, 33);
@@ -850,6 +863,7 @@ construct_runtime!(

Escrow: pallet_escrow = 50,
MythProxy: pallet_myth_proxy = 51,
Dmarket: pallet_dmarket = 52,
}
);

@@ -926,6 +940,7 @@ mod benches {
[pallet_vesting, Vesting]
[pallet_collective, Council]
[pallet_myth_proxy, MythProxy]
[pallet_dmarket, Dmarket]
);
}

@@ -1081,6 +1096,18 @@ impl_runtime_apis! {
}
}

impl pallet_dmarket::DmarketApi<Block, AccountId, Balance, Moment, Hash> for Runtime {
fn hash_ask_bid_data(trade: TradeParams<Balance, Item, u64>)-> (Hash, Hash) {
Dmarket::hash_ask_bid_data(&trade)
}
fn get_ask_message(caller: AccountId, fee_address: AccountId, trade: TradeParams<Balance, Item, Moment>) -> Vec<u8> {
Dmarket::get_ask_message(&caller, &fee_address, &trade)
}
fn get_bid_message(caller: AccountId, fee_address: AccountId, trade: TradeParams<Balance, Item, Moment>) -> Vec<u8> {
Dmarket::get_bid_message(&caller, &fee_address, &trade)
}
}

impl cumulus_primitives_aura::AuraUnincludedSegmentApi<Block> for Runtime {
fn can_build_upon(
included_hash: <Block as BlockT>::Hash,