mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
fix: Fix @tenderly/hardhat-tenderly to 1.1.0-beta.5
This commit is contained in:
parent
7da7c1a9ce
commit
bf5762776a
|
@ -100,7 +100,7 @@
|
||||||
"@nomiclabs/hardhat-ethers": "^2.0.0",
|
"@nomiclabs/hardhat-ethers": "^2.0.0",
|
||||||
"@nomiclabs/hardhat-waffle": "^2.0.0",
|
"@nomiclabs/hardhat-waffle": "^2.0.0",
|
||||||
"@openzeppelin/contracts": "3.1.0",
|
"@openzeppelin/contracts": "3.1.0",
|
||||||
"@tenderly/hardhat-tenderly": "^1.1.0-beta.4",
|
"@tenderly/hardhat-tenderly": "1.1.0-beta.5",
|
||||||
"@typechain/ethers-v4": "1.0.0",
|
"@typechain/ethers-v4": "1.0.0",
|
||||||
"@typechain/ethers-v5": "^2.0.0",
|
"@typechain/ethers-v5": "^2.0.0",
|
||||||
"@typechain/truffle-v4": "2.0.2",
|
"@typechain/truffle-v4": "2.0.2",
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
import { task } from 'hardhat/config';
|
import { task } from 'hardhat/config';
|
||||||
import { DRE, setDRE } from '../../helpers/misc-utils';
|
import { DRE, setDRE } from '../../helpers/misc-utils';
|
||||||
import { EthereumNetworkNames } from '../../helpers/types';
|
|
||||||
import { usingTenderly } from '../../helpers/tenderly-utils';
|
|
||||||
import { HardhatRuntimeEnvironment } from 'hardhat/types';
|
import { HardhatRuntimeEnvironment } from 'hardhat/types';
|
||||||
import { getFirstSigner } from '../../helpers/contracts-getters';
|
|
||||||
import { formatEther } from 'ethers/lib/utils';
|
|
||||||
import { fork } from 'child_process';
|
|
||||||
import { env } from 'process';
|
|
||||||
|
|
||||||
task(`set-DRE`, `Inits the DRE, to have access to all the plugins' objects`).setAction(
|
task(`set-DRE`, `Inits the DRE, to have access to all the plugins' objects`).setAction(
|
||||||
async (_, _DRE) => {
|
async (_, _DRE) => {
|
||||||
|
@ -18,24 +12,21 @@ task(`set-DRE`, `Inits the DRE, to have access to all the plugins' objects`).set
|
||||||
process.env.TENDERLY === 'true'
|
process.env.TENDERLY === 'true'
|
||||||
) {
|
) {
|
||||||
console.log('- Setting up Tenderly provider');
|
console.log('- Setting up Tenderly provider');
|
||||||
|
const net = _DRE.tenderly.network();
|
||||||
|
|
||||||
if (process.env.TENDERLY_FORK_ID && process.env.TENDERLY_HEAD_ID) {
|
if (process.env.TENDERLY_FORK_ID && process.env.TENDERLY_HEAD_ID) {
|
||||||
console.log('- Connecting to a Tenderly Fork');
|
console.log('- Connecting to a Tenderly Fork');
|
||||||
_DRE.tenderlyRPC.setFork(process.env.TENDERLY_FORK_ID);
|
await net.setFork(process.env.TENDERLY_FORK_ID);
|
||||||
_DRE.tenderlyRPC.setHead(process.env.TENDERLY_HEAD_ID);
|
await net.setHead(process.env.TENDERLY_HEAD_ID);
|
||||||
} else {
|
} else {
|
||||||
console.log('- Creating a new Tenderly Fork');
|
console.log('- Creating a new Tenderly Fork');
|
||||||
await _DRE.tenderlyRPC.initializeFork();
|
await net.initializeFork();
|
||||||
}
|
}
|
||||||
const provider = new _DRE.ethers.providers.Web3Provider(_DRE.tenderlyRPC as any);
|
const provider = new _DRE.ethers.providers.Web3Provider(net);
|
||||||
_DRE.ethers.provider = provider;
|
_DRE.ethers.provider = provider;
|
||||||
console.log('- Initialized Tenderly fork:');
|
console.log('- Initialized Tenderly fork:');
|
||||||
console.log(' - Fork: ', _DRE.tenderlyRPC.getFork());
|
console.log(' - Fork: ', net.getFork());
|
||||||
console.log(' - Head: ', _DRE.tenderlyRPC.getHead());
|
console.log(' - Head: ', net.getHead());
|
||||||
console.log(' - First account:', await (await _DRE.ethers.getSigners())[0].getAddress());
|
|
||||||
console.log(
|
|
||||||
' - Balance:',
|
|
||||||
formatEther(await (await _DRE.ethers.getSigners())[0].getBalance())
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('- Enviroment');
|
console.log('- Enviroment');
|
||||||
|
@ -50,6 +41,7 @@ task(`set-DRE`, `Inits the DRE, to have access to all the plugins' objects`).set
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(' - Network :', _DRE.network.name);
|
console.log(' - Network :', _DRE.network.name);
|
||||||
|
|
||||||
setDRE(_DRE);
|
setDRE(_DRE);
|
||||||
return _DRE;
|
return _DRE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user