Files
openzeppelin-contracts/test/helpers/chainid.js
Hadrien Croubois 149e1b79fe Migrate Ownable tests (#4657)
Co-authored-by: ernestognw <ernestognw@gmail.com>
2023-10-17 10:05:58 +02:00

13 lines
364 B
JavaScript

const hre = require('hardhat');
async function getChainId() {
const chainIdHex = await hre.network.provider.send('eth_chainId', []);
return new hre.web3.utils.BN(chainIdHex, 'hex');
}
module.exports = {
getChainId,
// TODO: when tests are ready to support bigint chainId
// getChainId: ethers.provider.getNetwork().then(network => network.chainId),
};