@@ -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