Created
December 22, 2021 09:02
-
-
Save riordant/989a4aa11de6c699c0ccf145d5ff79b9 to your computer and use it in GitHub Desktop.
Separate Hardhat task to run tests on mainnet fork
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {task, types} from "hardhat/config"; | |
task("test-fork", "Runs mocha tests on a fork of mainnet").addOptionalParam( | |
"url", | |
"The URL of the Mainnet archive node", | |
"", | |
types.string | |
).setAction(async (taskArgs, hre) => { | |
hre.config.networks.hardhat.forking = { | |
url: taskArgs.url, | |
blockNumber: 13825000, | |
enabled: true | |
}; | |
await hre.run("test"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment