dsa-connectors/test/ubiquity/utils.js

25 lines
555 B
JavaScript
Raw Normal View History

2021-10-11 16:47:51 +00:00
const hre = require("hardhat");
const hardhatConfig = require("../../hardhat.config");
async function forkReset(blockNumber) {
await hre.network.provider.request({
method: "hardhat_reset",
params: [
{
forking: {
jsonRpcUrl: hardhatConfig.networks.hardhat.forking.url,
blockNumber,
},
},
],
});
}
async function sendEth(from, to, amount) {
await from.sendTransaction({
to: to,
value: ethers.BigNumber.from(10).pow(18).mul(amount),
});
}
module.exports = { forkReset, sendEth };