0

I have a sol contract X.sol and a sol test file TestX.sol. X.sol is large: ~4m Gas after optimisation

TextX.sol compiles, migrates and executes tests fine when just executing a single test - testY, however.. when I add a testZ function and add even 1 line of (basic) solidity.. I get the following error:

1) TestX "before all" hook: prepare suite: Error: while migrating TestX: Returned error: VM Exception while processing transaction: out of gas

However if I leave the body of testZ empty, it migrates fine.

Basically, I just want to know if there is a way to get visibility on the size of the compiled test file? Or a way to optimise gas usage?

networks: {
  development: {
    host: 'localhost',
    port: 8545,
    gas: 6130000,
    network_id: '*'
  }
},
solc: {
  optimizer: {
    enabled: true,
    runs: 200
  }
}
2

Use this for Truffle:

development: {
    host:       'localhost',
    port:       8545,
    network_id: '*',
    gasPrice:   0x1,
    gas:        0x1fffffffffffff
}

And this for Ganache:

--port=8545
--gasPrice=0x1
--gasLimit=0x1fffffffffffff
  • Cheers, manually changing gas limit for Ganache was sufficient – alsco77 Dec 18 '18 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.