From 230e80e0ac31ebc24bd06995be9a82335a8ae118 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Tue, 25 Jun 2024 17:56:42 +0530 Subject: [PATCH] fix: fork tests for all networks --- tests/hardhat/Fork/borrowAndRepayTest.ts | 2 +- tests/hardhat/Fork/constants.ts | 2 +- tests/hardhat/Fork/liquidation.ts | 1 + tests/hardhat/Fork/reduceReservesTest.ts | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/hardhat/Fork/borrowAndRepayTest.ts b/tests/hardhat/Fork/borrowAndRepayTest.ts index 8cfc13c6..69f791b0 100644 --- a/tests/hardhat/Fork/borrowAndRepayTest.ts +++ b/tests/hardhat/Fork/borrowAndRepayTest.ts @@ -28,7 +28,7 @@ chai.use(smock.matchers); const FORK = process.env.FORK === "true"; const FORKED_NETWORK = process.env.FORKED_NETWORK || "bscmainnet"; -if (FORK) console.log(`fork tests are running on ${FORKED_NETWORK}`); +if (FORK) console.log(`fork tests are running on: ${FORKED_NETWORK}`); const { ACC1, diff --git a/tests/hardhat/Fork/constants.ts b/tests/hardhat/Fork/constants.ts index 07e2b691..1c88e613 100644 --- a/tests/hardhat/Fork/constants.ts +++ b/tests/hardhat/Fork/constants.ts @@ -181,7 +181,7 @@ export const contractAddresses = { ACC1: "0xc7f050b6F465b876c764A866d6337EabBab08Cd4", ACC2: "0xce0180B3B992649CBc3C8e1cF95b4A52Be9bA3AF", ACC3: "0x13E0a421c17Ff1e7FFccFa05714957cF530b3aa4", - BLOCK_NUMBER: 40468900, + BLOCK_NUMBER: 58181663, }, arbitrumone: { ADMIN: "0x14e0E151b33f9802b3e75b621c1457afc44DcAA0", diff --git a/tests/hardhat/Fork/liquidation.ts b/tests/hardhat/Fork/liquidation.ts index 338d19c5..3841ac91 100644 --- a/tests/hardhat/Fork/liquidation.ts +++ b/tests/hardhat/Fork/liquidation.ts @@ -356,6 +356,7 @@ if (FORK) { opbnbtestnet: 1000000000288189, opbnbmainnet: 1000000008986559, arbitrumsepolia: 1000000000046406, + arbitrumone: 1000000032216389, }; const repayAmount = NetworkRespectiveRepayAmounts[FORKED_NETWORK]; diff --git a/tests/hardhat/Fork/reduceReservesTest.ts b/tests/hardhat/Fork/reduceReservesTest.ts index ed7a2e08..6bf318db 100644 --- a/tests/hardhat/Fork/reduceReservesTest.ts +++ b/tests/hardhat/Fork/reduceReservesTest.ts @@ -109,7 +109,7 @@ if (FORK) { // Calculation of reserves let currBlockOrTimestamp = await ethers.provider.getBlockNumber(); - if (FORKED_NETWORK == "arbitrumsepolia") { + if (FORKED_NETWORK == "arbitrumsepolia" || FORKED_NETWORK == "arbitrumone") { currBlockOrTimestamp = (await ethers.provider.getBlock("latest")).timestamp; } const blockDelta = BigNumber.from(currBlockOrTimestamp).sub(BigNumber.from(accrualBlockNumberPrior));