Skip to content

Commit

Permalink
Merge pull request #624 from galacticcouncil/refactor_adapters
Browse files Browse the repository at this point in the history
refactor: move adapters to one place
  • Loading branch information
mrq1911 authored Jul 4, 2023
2 parents e952315 + 4cf4487 commit 0afe67c
Show file tree
Hide file tree
Showing 13 changed files with 490 additions and 468 deletions.
21 changes: 17 additions & 4 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "runtime-integration-tests"
version = "1.7.18"
version = "1.7.19"
description = "Integration tests"
authors = ["GalacticCouncil"]
edition = "2021"
Expand All @@ -14,6 +14,7 @@ tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
scraper = { workspace = true }
primitives = { workspace = true }
hydradx-runtime = { workspace = true }
hydradx-adapters = { workspace = true }
pallet-omnipool = { workspace = true }
pallet-circuit-breaker = { workspace = true }
pallet-omnipool-liquidity-mining = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion integration-tests/src/omnipool_price_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ use crate::polkadot_test_net::*;

use frame_support::assert_ok;
use frame_system::RawOrigin;
use hydradx_runtime::{adapters::OraclePriceProviderAdapterForOmnipool, Omnipool, RuntimeOrigin, Tokens};
use hydradx_adapters::OraclePriceProviderAdapterForOmnipool;
use hydradx_runtime::{Omnipool, RuntimeOrigin, Tokens};
use hydradx_traits::{OraclePeriod, PriceOracle};
use primitives::{AssetId, Balance};
use sp_runtime::{FixedU128, Permill};
Expand Down
3 changes: 2 additions & 1 deletion integration-tests/src/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ use frame_support::{
sp_runtime::{FixedU128, Permill},
traits::{tokens::fungibles::Mutate, OnFinalize, OnInitialize},
};
use hydradx_runtime::{EmaOracle, RuntimeOrigin, OMNIPOOL_SOURCE};
use hydradx_runtime::{EmaOracle, RuntimeOrigin};
use hydradx_traits::{
AggregatedPriceOracle,
OraclePeriod::{self, *},
};
use pallet_ema_oracle::OracleError;
use polkadot_primitives::v2::BlockNumber;
use primitives::constants::chain::OMNIPOOL_SOURCE;
use xcm_emulator::TestExt;

pub fn hydradx_run_to_block(to: BlockNumber) {
Expand Down
2 changes: 1 addition & 1 deletion primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "primitives"
version = "5.8.0"
version = "5.8.1"
authors = ["GalacticCouncil"]
edition = "2021"
repository = "https://github.com/galacticcouncil/HydraDX-node"
Expand Down
3 changes: 3 additions & 0 deletions primitives/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ pub mod chain {
WEIGHT_REF_TIME_PER_SECOND.saturating_div(2),
polkadot_primitives::v2::MAX_POV_SIZE as u64,
);

/// The source of the data for the oracle.
pub const OMNIPOOL_SOURCE: [u8; 8] = *b"omnipool";
}

#[cfg(test)]
Expand Down
16 changes: 15 additions & 1 deletion runtime/adapters/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hydradx-adapters"
version = "0.3.0"
version = "0.4.0"
description = "Structs and other generic types for building runtimes."
authors = ["GalacticCouncil"]
edition = "2021"
Expand All @@ -12,19 +12,33 @@ codec = { default-features = false, features = ["derive"], package = "parity-sca
log = { version = "0.4.17", default-features = false }

# HydraDX dependencies
primitives = { workspace = true }
hydradx-traits = { workspace = true }
hydra-dx-math = { workspace = true }
pallet-transaction-multi-payment = { workspace = true }
pallet-omnipool = { workspace = true }
pallet-ema-oracle = { workspace = true }
pallet-circuit-breaker = { workspace = true }
warehouse-liquidity-mining = { workspace = true }
pallet-omnipool-liquidity-mining = { workspace = true }
pallet-dynamic-fees = { workspace = true }

# Substrate dependencies
frame-support = { workspace = true }
frame-system = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
primitive-types = { workspace = true }

# Polkadot dependencies
polkadot-xcm = { workspace = true }
xcm-builder = { workspace = true }
xcm-executor = { workspace = true }

# ORML dependencies
orml-xcm-support = { workspace = true }
orml-traits = { workspace = true }

[dev-dependencies]
lazy_static = { features = ["spin_no_std"], version = "1.4.0" }

Expand Down
Loading

0 comments on commit 0afe67c

Please sign in to comment.