Remove deprecated Truffle code (#4868)
This commit is contained in:
@ -10,23 +10,6 @@ function isExpectedError(e, suffix) {
|
|||||||
extendEnvironment(hre => {
|
extendEnvironment(hre => {
|
||||||
const suffixes = ['UpgradeableWithInit', 'Upgradeable', ''];
|
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
|
// Ethers
|
||||||
const originalReadArtifact = hre.artifacts.readArtifact;
|
const originalReadArtifact = hre.artifacts.readArtifact;
|
||||||
hre.artifacts.readArtifact = async function (name) {
|
hre.artifacts.readArtifact = async function (name) {
|
||||||
|
|||||||
Reference in New Issue
Block a user