Created
October 27, 2020 14:32
-
-
Save gitpusha/a6032809024830babefe7ca288e51157 to your computer and use it in GitHub Desktop.
Where buidler-ganache has an invalid opcode bug for gelatoCore.unstakeExecutor(), hardhat has none
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
// running `npx hardhat run` automatically makes use of buidler-waffle plugin | |
const hre = require("hardhat"); | |
const { ethers } = hre; | |
const GelatoCoreLib = require("@gelatonetwork/core"); | |
const { sleep } = GelatoCoreLib; | |
(async function main() { | |
if (hre.network.name !== "hardhat") { | |
console.error("Test Suite is meant to be run on hardhat only"); | |
process.exit(1); | |
} | |
// ===== GELATO LOCAL SETUP ================== | |
const gelatoCore = await ethers.getContractAt( | |
GelatoCoreLib.GelatoCore.abi, | |
hre.network.config.GelatoCore | |
); | |
// DEBUG: buidler-ganache INVALID OPCODE bug | |
// NO BUG on hardhat | |
await gelatoCore.stakeExecutor({ value: ethers.utils.parseEther("2") }); | |
await gelatoCore.unstakeExecutor(); | |
await sleep(20000); | |
// DEBUG END | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment