Transpile 7bce2b72

This commit is contained in:
github-actions
2022-01-13 23:13:57 +00:00
commit 37c366503e
465 changed files with 80758 additions and 0 deletions

20
hardhat/env-artifacts.js Normal file
View File

@ -0,0 +1,20 @@
const { HardhatError } = require('hardhat/internal/core/errors');
extendEnvironment(env => {
const artifactsRequire = env.artifacts.require;
env.artifacts.require = (name) => {
for (const suffix of ['UpgradeableWithInit', 'Upgradeable', '']) {
try {
return artifactsRequire(name + suffix);
} catch (e) {
if (HardhatError.isHardhatError(e) && e.number === 700 && suffix !== '') {
continue;
} else {
throw e;
}
}
}
throw new Error('Unreachable');
};
});

10
hardhat/env-contract.js Normal file
View File

@ -0,0 +1,10 @@
extendEnvironment(env => {
const { contract } = env;
env.contract = function (name, body) {
// remove the default account from the accounts list used in tests, in order
// to protect tests against accidentally passing due to the contract
// deployer being used subsequently as function caller
contract(name, accounts => body(accounts.slice(1)));
};
});

View File

@ -0,0 +1,10 @@
// adds storageLayout to solc outputSelection, necessary for storage gaps
const { internalTask } = require('hardhat/config');
const { TASK_COMPILE_SOLIDITY_GET_COMPILER_INPUT } = require('hardhat/builtin-tasks/task-names');
internalTask(TASK_COMPILE_SOLIDITY_GET_COMPILER_INPUT, async (args, bre, runSuper) => {
const input = await runSuper();
input.settings.outputSelection['*']['*'].push('storageLayout');
return input;
});

View File

@ -0,0 +1,19 @@
// ignores the proxy tests
const { internalTask } = require('hardhat/config');
const { TASK_TEST_GET_TEST_FILES } = require('hardhat/builtin-tasks/task-names');
const glob = require('glob');
const path = require('path');
const { promisify } = require('util');
internalTask(TASK_TEST_GET_TEST_FILES)
.setAction(async ({ testFiles }, { config }) => {
if (testFiles.length !== 0) {
return testFiles;
}
return await promisify(glob)(
path.join(config.paths.tests, '**/*.js'),
{ ignore: [path.join(config.paths.tests, 'proxy/**/*')] },
);
});