Skip to content

Commit 3af79b6

Browse files
committed
fix: use ETHEREUM_FORK_ID
1 parent 78ddcac commit 3af79b6

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

packages/spec/borrow/helper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { AaveClient, Reserve, SupplyRequest } from '@aave/client-next';
22
import {
33
bigDecimal,
4-
chainId,
54
type EvmAddress,
65
evmAddress,
76
invariant,
@@ -10,6 +9,7 @@ import {
109
type TxHash,
1110
} from '@aave/client-next';
1211
import { reserves, supply } from '@aave/client-next/actions';
12+
import { ETHEREUM_FORK_ID } from '@aave/client-next/test-utils';
1313
import { sendWith } from '@aave/client-next/viem';
1414
import type { WalletClient } from 'viem';
1515

@@ -31,7 +31,7 @@ export function findReserveToSupply(
3131
query: {
3232
tokens: [
3333
{
34-
chainId: chainId(1),
34+
chainId: ETHEREUM_FORK_ID,
3535
address: token,
3636
},
3737
],

packages/spec/misc/hub.spec.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { assertOk, chainId } from '@aave/client-next';
1+
import { assertOk } from '@aave/client-next';
22
import { hub, hubAssets, hubs } from '@aave/client-next/actions';
33
import {
44
client,
5+
ETHEREUM_FORK_ID,
56
ETHEREUM_USDC_ADDRESS,
67
ETHEREUM_WETH_ADDRESS,
78
} from '@aave/client-next/test-utils';
@@ -13,7 +14,7 @@ describe('Aave V4 Hub Scenarios', () => {
1314
describe('When fetching hubs by chain ID(s)', () => {
1415
it('Then it should return the expected data for each hub', async () => {
1516
const result = await hubs(client, {
16-
query: { chainIds: [chainId(1)] },
17+
query: { chainIds: [ETHEREUM_FORK_ID] },
1718
});
1819
assertOk(result);
1920
result.value.forEach((hub) => {
@@ -32,15 +33,15 @@ describe('Aave V4 Hub Scenarios', () => {
3233
query: {
3334
tokens: tokens.map((token) => ({
3435
address: token,
35-
chainId: chainId(1),
36+
chainId: ETHEREUM_FORK_ID,
3637
})),
3738
},
3839
});
3940
assertOk(listHubs);
4041

4142
for (const hub of listHubs.value) {
4243
const result = await hubAssets(client, {
43-
chainId: chainId(1),
44+
chainId: ETHEREUM_FORK_ID,
4445
hub: hub.address,
4546
});
4647
assertOk(result);
@@ -60,15 +61,15 @@ describe('Aave V4 Hub Scenarios', () => {
6061
it('Then it should return the expected data for the hub', async () => {
6162
const listHubs = await hubs(client, {
6263
query: {
63-
chainIds: [chainId(1)],
64+
chainIds: [ETHEREUM_FORK_ID],
6465
},
6566
});
6667
assertOk(listHubs);
6768
assertNonEmptyArray(listHubs.value);
6869

6970
const result = await hub(client, {
7071
hub: listHubs.value[0].address,
71-
chainId: chainId(1),
72+
chainId: ETHEREUM_FORK_ID,
7273
});
7374
assertOk(result);
7475
expect(result.value).toMatchObject(listHubs.value[0]);
@@ -81,7 +82,7 @@ describe('Aave V4 Hub Scenarios', () => {
8182
it('Then it should return the expected data for assets in a hub', async () => {
8283
const listHubs = await hubs(client, {
8384
query: {
84-
chainIds: [chainId(1)],
85+
chainIds: [ETHEREUM_FORK_ID],
8586
},
8687
});
8788

@@ -90,7 +91,7 @@ describe('Aave V4 Hub Scenarios', () => {
9091

9192
const result = await hubAssets(client, {
9293
hub: listHubs.value[0].address,
93-
chainId: chainId(1),
94+
chainId: ETHEREUM_FORK_ID,
9495
});
9596
assertOk(result);
9697
assertNonEmptyArray(result.value);

packages/spec/supply/business.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import {
22
assertOk,
33
bigDecimal,
4-
chainId,
54
evmAddress,
65
type Reserve,
76
} from '@aave/client-next';
87
import { supply, userSupplies } from '@aave/client-next/actions';
98
import {
109
client,
1110
createNewWallet,
11+
ETHEREUM_FORK_ID,
1212
ETHEREUM_USDC_ADDRESS,
1313
fundErc20Address,
1414
} from '@aave/client-next/test-utils';
@@ -47,7 +47,7 @@ describe('Aave V4 Supply Scenarios', () => {
4747
const result = await supply(client, {
4848
reserve: {
4949
reserveId: reserveToSupply.value.id,
50-
chainId: chainId(1),
50+
chainId: ETHEREUM_FORK_ID,
5151
spoke: reserveToSupply.value.spoke.address,
5252
},
5353
amount: {
@@ -65,7 +65,7 @@ describe('Aave V4 Supply Scenarios', () => {
6565
userSpoke: {
6666
spoke: {
6767
address: reserveToSupply.value.spoke.address,
68-
chainId: chainId(1),
68+
chainId: ETHEREUM_FORK_ID,
6969
},
7070
user: evmAddress(user.account!.address),
7171
},

0 commit comments

Comments
 (0)