@@ -14,7 +14,9 @@ const GetFungibleBalanceLive = GetFungibleBalanceService.Default;
1414const GetComponentStateLive = GetComponentStateService . Default ;
1515const GetEntityDetailsServiceLive = GetEntityDetailsService . Default ;
1616const EntityFungiblesPageLive = EntityFungiblesPageService . Default ;
17- const GetLedgerStateLive = GetLedgerStateService . Default ;
17+ const GetLedgerStateLive = GetLedgerStateService . Default . pipe (
18+ Layer . provide ( GatewayApiClientLive ) ,
19+ ) ;
1820
1921const getSurgeLiquidityPositionsLive = GetSurgeLiquidityPositionsLive . pipe (
2022 Layer . provide ( GetFungibleBalanceLive ) ,
@@ -29,14 +31,26 @@ describe('GetSurgeLiquidityPositionsService', () => {
2931 it ( 'should get surge liquidity positions' , async ( ) => {
3032 const result = await Effect . runPromiseExit (
3133 Effect . gen ( function * ( ) {
32- const service = yield * GetSurgeLiquidityPositionsService ;
34+ const service = yield * Effect . provide (
35+ GetSurgeLiquidityPositionsService ,
36+ getSurgeLiquidityPositionsLive ,
37+ ) ;
38+ const getLedgerState = yield * Effect . provide (
39+ GetLedgerStateService ,
40+ GetLedgerStateLive ,
41+ ) ;
42+
43+ const state = yield * getLedgerState ( {
44+ at_ledger_state : { timestamp : new Date ( '2024-09-01T00:00:00Z' ) } ,
45+ } ) ;
46+
3347 return yield * service . getSurgeLiquidityPositions ( {
3448 accountAddresses : [
3549 'account_rdx12x7dulvhrvz2ney3992n5y4y590cqj58ge5y2xesjlkzgrydg8xdd7' ,
3650 ] ,
37- at_ledger_state : { state_version : 325927555 } ,
51+ at_ledger_state : { state_version : state . state_version } ,
3852 } ) ;
39- } ) . pipe ( Effect . provide ( getSurgeLiquidityPositionsLive ) ) ,
53+ } ) ,
4054 ) ;
4155
4256 Exit . match ( result , {
0 commit comments