Skip to content

Contract code too large on GovernorStorageMock #229

@KitHat

Description

@KitHat

Steps to reproduce:

git clone [email protected]:OpenZeppelin/openzeppelin-contracts.git
git checkout v5.5.0
npm i --save-dev @parity/hardhat-polkadot

Update the hardhat config to the attached file
hardhat.config.js
Use these node and rpc to run the test
run the test:

npx hardhat test --grep "queue and execute by id"

Observed result:

  1) GovernorStorage
       using $ERC20Votes
         "before each" hook for "queue and execute by id":
     Error: Transaction reverted: trying to deploy a contract whose code is too large
    at $GovernorStorageMock.constructor (contracts-exposed/mocks/governance/GovernorStorageMock.sol:74)
    at EdrProviderWrapper.request (node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:359:41)
    at HardhatEthersSigner.sendTransaction (node_modules/@nomicfoundation/hardhat-ethers/src/signers.ts:181:18)
    at ContractFactory.deploy (node_modules/ethers/src.ts/contract/factory.ts:111:24)
    at fixture (test/governance/extensions/GovernorStorage.test.js:38:20)
    at loadFixture (node_modules/@nomicfoundation/hardhat-network-helpers/src/loadFixture.ts:59:18)
    at Context.<anonymous> (test/governance/extensions/GovernorStorage.test.js:68:29)
  

  2) GovernorStorage
       using $ERC20VotesTimestampMock
         "before each" hook for "queue and execute by id":
     Error: Transaction reverted: trying to deploy a contract whose code is too large
    at $GovernorStorageMock.constructor (contracts-exposed/mocks/governance/GovernorStorageMock.sol:74)
    at EdrProviderWrapper.request (node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:359:41)
    at HardhatEthersSigner.sendTransaction (node_modules/@nomicfoundation/hardhat-ethers/src/signers.ts:181:18)
    at ContractFactory.deploy (node_modules/ethers/src.ts/contract/factory.ts:111:24)
    at fixture (test/governance/extensions/GovernorStorage.test.js:38:20)
    at loadFixture (node_modules/@nomicfoundation/hardhat-network-helpers/src/loadFixture.ts:59:18)
    at Context.<anonymous> (test/governance/extensions/GovernorStorage.test.js:68:29)

Expected result -- test passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions