Remove deprecated Truffle code (#4868)

pull/4830/head
Hadrien Croubois 1 year ago committed by GitHub
parent 7eba10dd1e
commit cc431f53e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 17
      hardhat/env-artifacts.js

@ -10,23 +10,6 @@ function isExpectedError(e, suffix) {
extendEnvironment(hre => {
const suffixes = ['UpgradeableWithInit', 'Upgradeable', ''];
// Truffe (deprecated)
const originalRequire = hre.artifacts.require;
hre.artifacts.require = function (name) {
for (const suffix of suffixes) {
try {
return originalRequire.call(this, name + suffix);
} catch (e) {
if (isExpectedError(e, suffix)) {
continue;
} else {
throw e;
}
}
}
throw new Error('Unreachable');
};
// Ethers
const originalReadArtifact = hre.artifacts.readArtifact;
hre.artifacts.readArtifact = async function (name) {

Loading…
Cancel
Save