diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 02664e85c8c..8bb32dcc30c 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -26,6 +26,7 @@ jobs: runs-on: ubuntu-latest env: FORCE_COLOR: 1 + NODE_OPTIONS: --max_old_space_size=4096 GAS: true steps: - uses: actions/checkout@v3 diff --git a/test/helpers/governance.js b/test/helpers/governance.js index ae88e151aae..1ffa086cbd8 100644 --- a/test/helpers/governance.js +++ b/test/helpers/governance.js @@ -115,19 +115,22 @@ class GovernorHelper { : this.governor.castVote(...concatOpts([proposal.id, vote.support], opts)); } - waitForSnapshot(offset = 0) { + async waitForSnapshot(offset = 0) { const proposal = this.currentProposal; - return this.governor.proposalSnapshot(proposal.id).then(timepoint => forward[this.mode](timepoint.addn(offset))); + const timepoint = await this.governor.proposalSnapshot(proposal.id); + return forward[this.mode](timepoint.addn(offset)); } - waitForDeadline(offset = 0) { + async waitForDeadline(offset = 0) { const proposal = this.currentProposal; - return this.governor.proposalDeadline(proposal.id).then(timepoint => forward[this.mode](timepoint.addn(offset))); + const timepoint = await this.governor.proposalDeadline(proposal.id); + return forward[this.mode](timepoint.addn(offset)); } - waitForEta(offset = 0) { + async waitForEta(offset = 0) { const proposal = this.currentProposal; - return this.governor.proposalEta(proposal.id).then(timestamp => forward.timestamp(timestamp.addn(offset))); + const timestamp = await this.governor.proposalEta(proposal.id); + return forward.timestamp(timestamp.addn(offset)); } /** diff --git a/test/helpers/time.js b/test/helpers/time.js index 2e5f6d85a90..30df8dc32ea 100644 --- a/test/helpers/time.js +++ b/test/helpers/time.js @@ -1,16 +1,17 @@ -const { time } = require('@openzeppelin/test-helpers'); +const ozHelpers = require('@openzeppelin/test-helpers'); +const helpers = require('@nomicfoundation/hardhat-network-helpers'); module.exports = { clock: { - blocknumber: () => web3.eth.getBlock('latest').then(block => block.number), - timestamp: () => web3.eth.getBlock('latest').then(block => block.timestamp), + blocknumber: () => helpers.time.latestBlock(), + timestamp: () => helpers.time.latest(), }, clockFromReceipt: { blocknumber: receipt => Promise.resolve(receipt.blockNumber), timestamp: receipt => web3.eth.getBlock(receipt.blockNumber).then(block => block.timestamp), }, forward: { - blocknumber: time.advanceBlockTo, - timestamp: time.increaseTo, + blocknumber: ozHelpers.time.advanceBlockTo, + timestamp: helpers.time.increaseTo, }, };