Update docs

This commit is contained in:
github-actions
2023-10-05 01:42:23 +00:00
parent 645e2a6c4a
commit 9efe429a18
25 changed files with 4256 additions and 1204 deletions

View File

@ -2,9 +2,24 @@ 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)));
const { takeSnapshot } = require('@nomicfoundation/hardhat-network-helpers');
contract(name, accounts => {
// reset the state of the chain in between contract test suites
let snapshot;
before(async function () {
snapshot = await takeSnapshot();
});
after(async function () {
await snapshot.restore();
});
// 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
body(accounts.slice(1));
});
};
});