@@ -13,8 +13,8 @@ import {
1313 ETHEREUM_FORK_ID ,
1414 fetchReserve ,
1515 fundErc20Address ,
16- WETH_ADDRESS ,
1716 wait ,
17+ WETH_ADDRESS ,
1818} from '../test-utils' ;
1919import { sendWith } from '../viem' ;
2020import { market } from './markets' ;
@@ -56,7 +56,6 @@ async function supplyAndCheck(
5656
5757describe ( 'Given an Aave Market' , ( ) => {
5858 let marketInfo : Market ;
59-
6059 const wallet : WalletClient = createNewWallet ( ) ;
6160
6261 beforeAll ( async ( ) => {
@@ -91,11 +90,36 @@ describe('Given an Aave Market', () => {
9190 describe ( 'And a user with a supply position' , ( ) => {
9291 describe ( 'When user set the supply as collateral' , async ( ) => {
9392 it ( 'Then it should be possible to borrow from the reserve' , async ( ) => {
93+ // TODO: enable if confirmed that when supplying the isCollateral should be set to false
94+ // Enable collateral
95+ // const result = await collateralToggle(client, {
96+ // market: initialPosition!.market.address,
97+ // underlyingToken: initialPosition!.currency.address,
98+ // chainId: initialPosition!.market.chain.chainId,
99+ // user: evmAddress(wallet.account!.address),
100+ // })
101+ // .andThen(sendWith(wallet))
102+ // .andTee((tx) => console.log(`tx to enable collateral: ${tx}`))
103+ // .andThen(() => {
104+ // return userSupplies(client, {
105+ // markets: [
106+ // {
107+ // address: initialPosition!.market.address,
108+ // chainId: initialPosition!.market.chain.chainId,
109+ // },
110+ // ],
111+ // user: evmAddress(wallet.account!.address),
112+ // });
113+ // });
114+ // assertOk(result);
115+ // expect(result.value).toEqual([
116+ // expect.objectContaining({
117+ // isCollateral: true,
118+ // }),
119+ // ]);
120+
94121 // Borrow from the reserve
95- const borrowReserve = await fetchReserve (
96- WETH_ADDRESS ,
97- evmAddress ( wallet . account ! . address ) ,
98- ) ;
122+ const borrowReserve = await fetchReserve ( WETH_ADDRESS , evmAddress ( wallet . account ! . address ) ) ;
99123 const borrowResult = await borrow ( client , {
100124 market : marketInfo . address ,
101125 chainId : marketInfo . chain . chainId ,
@@ -109,7 +133,7 @@ describe('Given an Aave Market', () => {
109133 } )
110134 . andThen ( sendWith ( wallet ) )
111135 . andTee ( ( tx ) => console . log ( `tx to borrow: ${ tx } ` ) )
112- . andTee ( ( ) => wait ( 5000 ) )
136+ . andTee ( ( ) => wait ( 10000 ) )
113137 . andThen ( ( ) =>
114138 userBorrows ( client , {
115139 markets : [
0 commit comments