Skip to content

Commit

Permalink
bump zenlink (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
herryho authored Sep 29, 2021
1 parent 5948e6b commit bcb4238
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pallets/minter-reward/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ fn minter_reward_should_work() {

let deadline: BlockNumberFor<Runtime> = <frame_system::Pallet<Runtime>>::block_number() +
<Runtime as frame_system::Config>::BlockNumber::from(100u32);

assert_ok!(ZenlinkProtocol::create_pair(Origin::root(), ausd_asset_id, dot_asset_id));
assert_ok!(ZenlinkProtocol::create_pair(Origin::root(), ausd_asset_id, vdot_asset_id));
assert_ok!(ZenlinkProtocol::create_pair(Origin::root(), ausd_asset_id, ksm_asset_id));
assert_ok!(ZenlinkProtocol::create_pair(Origin::root(), ausd_asset_id, vksm_asset_id));

assert_ok!(ZenlinkProtocol::add_liquidity(
Origin::signed(ALICE),
ausd_asset_id,
Expand Down
32 changes: 32 additions & 0 deletions runtime/dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1601,6 +1601,38 @@ impl_runtime_apis! {
) -> Option<PairInfo<AccountId, AssetBalance>> {
ZenlinkProtocol::get_pair_by_asset_id(asset_0, asset_1)
}

fn get_amount_in_price(
supply: AssetBalance,
path: Vec<AssetId>
) -> AssetBalance {
ZenlinkProtocol::desired_in_amount(supply, path)
}

fn get_amount_out_price(
supply: AssetBalance,
path: Vec<AssetId>
) -> AssetBalance {
ZenlinkProtocol::supply_out_amount(supply, path)
}

fn get_estimate_lptoken(
token_0: AssetId,
token_1: AssetId,
amount_0_desired: AssetBalance,
amount_1_desired: AssetBalance,
amount_0_min: AssetBalance,
amount_1_min: AssetBalance,
) -> AssetBalance{
ZenlinkProtocol::get_estimate_lptoken(
token_0,
token_1,
amount_0_desired,
amount_1_desired,
amount_0_min,
amount_1_min
)
}
}

impl bifrost_salp_rpc_runtime_api::SalpRuntimeApi<Block, ParaId, AccountId> for Runtime {
Expand Down

0 comments on commit bcb4238

Please sign in to comment.