Skip to content

Commit 3b60089

Browse files
committed
Merge branch 'master' into client_tx_priority
2 parents 8d23e31 + c16eeb7 commit 3b60089

25 files changed

Lines changed: 1237 additions & 132 deletions

File tree

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integration-tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "runtime-integration-tests"
3-
version = "1.41.0"
3+
version = "1.42.1"
44
description = "Integration tests"
55
authors = ["GalacticCouncil"]
66
edition = "2021"

integration-tests/src/driver/mod.rs

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,11 @@ impl HydrationTestDriver {
9090

9191
pub fn endow_account(&self, account: AccountId, asset_id: AssetId, amount: Balance) -> &Self {
9292
self.execute(|| {
93-
assert_ok!(Tokens::set_balance(
94-
RawOrigin::Root.into(),
93+
assert_ok!(Currencies::update_balance(
94+
hydradx_runtime::RuntimeOrigin::root(),
9595
account,
9696
asset_id,
97-
amount,
98-
0
97+
amount as i128,
9998
));
10099
});
101100
self
@@ -197,6 +196,29 @@ impl HydrationTestDriver {
197196
self.add_omnipool_assets(vec![HDX, DOT, WETH])
198197
}
199198

199+
pub fn add_asset_to_omnipool(&self, asset_id: AssetId, initial_liquidity: Balance, price: FixedU128) -> &Self {
200+
self.execute(|| {
201+
let acc = hydradx_runtime::Omnipool::protocol_account();
202+
assert_ok!(Tokens::set_balance(
203+
RawOrigin::Root.into(),
204+
acc.clone(),
205+
asset_id,
206+
initial_liquidity,
207+
0
208+
));
209+
210+
assert_ok!(hydradx_runtime::Omnipool::add_token(
211+
hydradx_runtime::RuntimeOrigin::root(),
212+
asset_id,
213+
price,
214+
Permill::from_percent(100),
215+
AccountId::from(ALICE),
216+
));
217+
});
218+
219+
self
220+
}
221+
200222
pub(crate) fn setup_stableswap(self) -> Self {
201223
let mut stable_pool_id = 0;
202224
let mut stable_assets = vec![];

0 commit comments

Comments
 (0)