diff --git a/pallets/minter-reward/src/tests.rs b/pallets/minter-reward/src/tests.rs index 0754c0ee3..7c9376703 100644 --- a/pallets/minter-reward/src/tests.rs +++ b/pallets/minter-reward/src/tests.rs @@ -75,6 +75,12 @@ fn minter_reward_should_work() { let deadline: BlockNumberFor = >::block_number() + ::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, diff --git a/runtime/dev/src/lib.rs b/runtime/dev/src/lib.rs index 5f1e14e52..329bfc46c 100644 --- a/runtime/dev/src/lib.rs +++ b/runtime/dev/src/lib.rs @@ -1601,6 +1601,38 @@ impl_runtime_apis! { ) -> Option> { ZenlinkProtocol::get_pair_by_asset_id(asset_0, asset_1) } + + fn get_amount_in_price( + supply: AssetBalance, + path: Vec + ) -> AssetBalance { + ZenlinkProtocol::desired_in_amount(supply, path) + } + + fn get_amount_out_price( + supply: AssetBalance, + path: Vec + ) -> 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 for Runtime {