@@ -8,14 +8,14 @@ import {
88 ETHEREUM_HUB_CORE_ADDRESS ,
99 ETHEREUM_SPOKE_CORE_ADDRESS ,
1010 ETHEREUM_USDC_ADDRESS ,
11- ETHEREUM_USDS_ADDRESS ,
1211 fundErc20Address ,
1312} from '@aave/client/test-utils' ;
1413import { beforeAll , describe , expect , it } from 'vitest' ;
15- import { assertSingleElementArray } from '../test-utils' ;
14+ import { findReserveAndSupply } from '../helpers/supplyBorrow' ;
15+ import { assertNonEmptyArray } from '../test-utils' ;
1616
1717const user = await createNewWallet (
18- '0x175ed519142afcfa12443d747712983ab3203cc24f7afc3a9fb2b521e635f4ba ' ,
18+ '0xb648cc3d9bdad37b60bcd7177b783a9c7ddfb36b6c7699f74f8dd27d4d150503 ' ,
1919) ;
2020
2121// Get the user balances for the protocol. This will only return assets that can be used on the protocol
@@ -31,19 +31,21 @@ describe('Querying User Balances on Aave V4', () => {
3131 } ,
3232 } ) ;
3333 assertOk ( balances ) ;
34- if ( balances . value . length < 4 ) {
35- for ( const token of [
36- ETHEREUM_USDC_ADDRESS ,
37- ETHEREUM_USDS_ADDRESS ,
38- ETHEREUM_1INCH_ADDRESS ,
39- ] ) {
34+ if ( balances . value . length < 3 ) {
35+ for ( const token of [ ETHEREUM_USDC_ADDRESS , ETHEREUM_1INCH_ADDRESS ] ) {
4036 const result = await fundErc20Address (
4137 evmAddress ( user . account . address ) ,
4238 {
4339 address : token ,
4440 amount : bigDecimal ( '100' ) ,
4541 decimals : token === ETHEREUM_1INCH_ADDRESS ? 18 : 6 ,
4642 } ,
43+ ) . andThen ( ( ) =>
44+ findReserveAndSupply ( client , user , {
45+ token : token ,
46+ amount : bigDecimal ( '50' ) ,
47+ asCollateral : true ,
48+ } ) ,
4749 ) ;
4850 assertOk ( result ) ;
4951 }
@@ -77,7 +79,8 @@ describe('Querying User Balances on Aave V4', () => {
7779 } ,
7880 } ) ;
7981 assertOk ( balances ) ;
80- expect ( balances . value . length ) . toBe ( 3 ) ;
82+ // NOTE: One less because 1INCH is not supported on the hub
83+ expect ( balances . value . length ) . toBe ( 2 ) ;
8184 } ) ;
8285 } ) ;
8386
@@ -93,7 +96,8 @@ describe('Querying User Balances on Aave V4', () => {
9396 } ,
9497 } ) ;
9598 assertOk ( balances ) ;
96- expect ( balances . value . length ) . toBe ( 3 ) ;
99+ // NOTE: One less because 1INCH is not supported on the spoke
100+ expect ( balances . value . length ) . toBe ( 2 ) ;
97101 } ) ;
98102 } ) ;
99103
@@ -122,7 +126,7 @@ describe('Querying User Balances on Aave V4', () => {
122126 } ,
123127 } ) ;
124128 assertOk ( positions ) ;
125- assertSingleElementArray ( positions . value ) ;
129+ assertNonEmptyArray ( positions . value ) ;
126130 const balances = await userBalances ( client , {
127131 user : evmAddress ( user . account . address ) ,
128132 filter : {
@@ -132,7 +136,7 @@ describe('Querying User Balances on Aave V4', () => {
132136 } ,
133137 } ) ;
134138 assertOk ( balances ) ;
135- expect ( balances . value . length ) . toBe ( 3 ) ;
139+ expect ( balances . value . length ) . toBe ( 2 ) ;
136140 } ) ;
137141 } ) ;
138142
0 commit comments