2

I am using populus.

  • Platform darwin -- Python 2.7.12, pytest-3.0.2, py-1.4.31, pluggy-0.3.1
  • Plugins: populus-1.1.0
  • OS: Mac OS X

I do face with following error: for the following line on my test.py file.

my_contract       = unmigrated_chain.get_contract('Array');

In order to deploy my contract there is not enough gas.

    def test_token_contract_1(web3, accounts, unmigrated_chain):
>   my_contract       = unmigrated_chain.get_contract('Array');

    tests/test.py:7:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python2.7/site-packages/populus/chain.py:614: in get_contract
    kwargs=deploy_kwargs,
/usr/local/lib/python2.7/site-packages/web3/contract.py:194: in deploy
    txn_hash = cls.web3.eth.sendTransaction(deploy_transaction)
/usr/local/lib/python2.7/site-packages/web3/eth.py:216: in sendTransaction
    transaction=formatted_transaction,
/usr/local/lib/python2.7/site-packages/web3/utils/transactions.py:25: in get_buffered_gas_estimate
    gas_estimate = web3.eth.estimateGas(gas_estimate_transaction)
/usr/local/lib/python2.7/site-packages/web3/utils/functional.py:22: in inner
    value = fn(*args, **kwargs)
/usr/local/lib/python2.7/site-packages/web3/eth.py:247: in estimateGas
    return self.request_manager.request_blocking("eth_estimateGas", [transaction])

For example when I remove a line from my contract my code works perfectly fine. But when I add a new line that does some computation, which leads my contract to exceed the estimated gas and gives the error I mentioned.

[Q] Due to out of gas problem I can't deploy my contract inside Populus. How can I over come this problem?

Please note that I was not able to do import my library .sol file in my contract file so one library and additional three contract is embedded into the same Array.sol file.

Thank you for your valuable time and help.

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.