Skip to content

Commit 64d37bc

Browse files
committed
fix: Fix @tenderly/hardhat-tenderly to 1.1.0-beta.5
1 parent 1d78df4 commit 64d37bc

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"@nomiclabs/hardhat-ethers": "^2.0.0",
9999
"@nomiclabs/hardhat-waffle": "^2.0.0",
100100
"@openzeppelin/contracts": "3.1.0",
101-
"@tenderly/hardhat-tenderly": "^1.1.0-beta.4",
101+
"@tenderly/hardhat-tenderly": "1.1.0-beta.5",
102102
"@typechain/ethers-v4": "1.0.0",
103103
"@typechain/ethers-v5": "^2.0.0",
104104
"@typechain/truffle-v4": "2.0.2",

tasks/misc/set-bre.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import { task } from 'hardhat/config';
22
import { DRE, setDRE } from '../../helpers/misc-utils';
3-
import { EthereumNetworkNames } from '../../helpers/types';
4-
import { usingTenderly } from '../../helpers/tenderly-utils';
53
import { HardhatRuntimeEnvironment } from 'hardhat/types';
6-
import { formatEther } from 'ethers/lib/utils';
7-
import { fork } from 'child_process';
8-
import { env } from 'process';
94

105
task(`set-DRE`, `Inits the DRE, to have access to all the plugins' objects`).setAction(
116
async (_, _DRE) => {
@@ -17,19 +12,21 @@ task(`set-DRE`, `Inits the DRE, to have access to all the plugins' objects`).set
1712
process.env.TENDERLY === 'true'
1813
) {
1914
console.log('- Setting up Tenderly provider');
15+
const net = _DRE.tenderly.network();
16+
2017
if (process.env.TENDERLY_FORK_ID && process.env.TENDERLY_HEAD_ID) {
2118
console.log('- Connecting to a Tenderly Fork');
22-
(_DRE as any).tenderlyRPC.setFork(process.env.TENDERLY_FORK_ID);
23-
(_DRE as any).tenderlyRPC.setHead(process.env.TENDERLY_HEAD_ID);
19+
await net.setFork(process.env.TENDERLY_FORK_ID);
20+
await net.setHead(process.env.TENDERLY_HEAD_ID);
2421
} else {
2522
console.log('- Creating a new Tenderly Fork');
26-
await (_DRE as any).tenderlyRPC.initializeFork();
23+
await net.initializeFork();
2724
}
28-
const provider = new _DRE.ethers.providers.Web3Provider((_DRE as any).tenderlyRPC);
25+
const provider = new _DRE.ethers.providers.Web3Provider(net);
2926
_DRE.ethers.provider = provider;
3027
console.log('- Initialized Tenderly fork:');
31-
console.log(' - Fork: ', (_DRE as any).tenderlyRPC.getFork());
32-
console.log(' - Head: ', (_DRE as any).tenderlyRPC.getHead());
28+
console.log(' - Fork: ', net.getFork());
29+
console.log(' - Head: ', net.getHead());
3330
}
3431

3532
console.log('- Enviroment');
@@ -44,6 +41,7 @@ task(`set-DRE`, `Inits the DRE, to have access to all the plugins' objects`).set
4441
}
4542
}
4643
console.log(' - Network :', _DRE.network.name);
44+
4745
setDRE(_DRE);
4846
return _DRE;
4947
}

0 commit comments

Comments
 (0)