dsa-connectors/test/ubiquity/utils.js
2021-10-11 18:47:51 +02:00

25 lines
555 B
JavaScript

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 };