diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3f69eed8..986b68dd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,6 +37,11 @@ jobs: run: | SILENT=true make start-ganache make test + - name: Forked Mainnet Tests + run: | + fuser -k 8545/tcp + make start-forkedMainnet + npx truffle test testUnderForked/* coverage: needs: test diff --git a/Makefile b/Makefile index 09fccea4..c6f72143 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,11 @@ start-ganache: @echo " > \033[32mStarting ganache... \033[0m " ./scripts/start_ganache.sh +start-forkedMainnet: + @echo " > \033[32mStarting forked environment... \033[0m " + ganache-cli -f https://eth-mainnet.g.alchemy.com/v2/34NZ4AoqM8OSolHSol6jh5xZSPq1rcL- + sleep 3 + start-geth: @echo " > \033[32mStarting geth... \033[0m " ./scripts/geth/start_geth.sh diff --git a/test/handlers/fee/dynamic/V2/admin.js b/testUnderForked/admin.js similarity index 99% rename from test/handlers/fee/dynamic/V2/admin.js rename to testUnderForked/admin.js index 828d7b77..4f695fc0 100644 --- a/test/handlers/fee/dynamic/V2/admin.js +++ b/testUnderForked/admin.js @@ -2,7 +2,7 @@ // SPDX-License-Identifier: LGPL-3.0-only const Ethers = require("ethers"); const TruffleAssert = require("truffle-assertions"); -const Helpers = require("../../../../helpers"); +const Helpers = require("../../test/helpers"); const DynamicFeeHandlerContract = artifacts.require("DynamicERC20FeeHandlerEVMV2"); const FeeHandlerRouterContract = artifacts.require("FeeHandlerRouter"); const TwapOracleContract = artifacts.require("TwapOracle"); diff --git a/test/handlers/fee/dynamic/V2/calculateFeeERC20EVM.js b/testUnderForked/calculateFeeERC20EVM.js similarity index 99% rename from test/handlers/fee/dynamic/V2/calculateFeeERC20EVM.js rename to testUnderForked/calculateFeeERC20EVM.js index b49d6b8f..a1ae5299 100644 --- a/test/handlers/fee/dynamic/V2/calculateFeeERC20EVM.js +++ b/testUnderForked/calculateFeeERC20EVM.js @@ -1,7 +1,7 @@ // The Licensed Work is (c) 2022 Sygma // SPDX-License-Identifier: LGPL-3.0-only const Ethers = require("ethers"); -const Helpers = require("../../../../helpers"); +const Helpers = require("../../test/helpers"); const DynamicFeeHandlerContract = artifacts.require("DynamicERC20FeeHandlerEVMV2"); const FeeHandlerRouterContract = artifacts.require("FeeHandlerRouter"); const ERC20MintableContract = artifacts.require("ERC20PresetMinterPauser"); diff --git a/test/handlers/fee/dynamic/V2/collectFeeERC20EVM.js b/testUnderForked/collectFeeERC20EVM.js similarity index 99% rename from test/handlers/fee/dynamic/V2/collectFeeERC20EVM.js rename to testUnderForked/collectFeeERC20EVM.js index 5e58b00f..8f363f15 100644 --- a/test/handlers/fee/dynamic/V2/collectFeeERC20EVM.js +++ b/testUnderForked/collectFeeERC20EVM.js @@ -4,7 +4,7 @@ const TruffleAssert = require("truffle-assertions"); const Ethers = require("ethers"); -const Helpers = require("../../../../helpers"); +const Helpers = require("../../test/helpers"); const ERC20MintableContract = artifacts.require("ERC20PresetMinterPauser"); const ERC20HandlerContract = artifacts.require("ERC20Handler"); diff --git a/test/handlers/fee/dynamic/V2/collectFeeGenericEVM.js b/testUnderForked/collectFeeGenericEVM.js similarity index 99% rename from test/handlers/fee/dynamic/V2/collectFeeGenericEVM.js rename to testUnderForked/collectFeeGenericEVM.js index 32d892ca..7be6b88b 100644 --- a/test/handlers/fee/dynamic/V2/collectFeeGenericEVM.js +++ b/testUnderForked/collectFeeGenericEVM.js @@ -3,7 +3,7 @@ const TruffleAssert = require("truffle-assertions"); const Ethers = require("ethers"); -const Helpers = require("../../../../helpers"); +const Helpers = require("../../test/helpers"); const DynamicFeeHandlerContract = artifacts.require("DynamicGenericFeeHandlerEVMV2"); const FeeHandlerRouterContract = artifacts.require("FeeHandlerRouter");