I've got some code that's ultimately destined to run on a private network. I'm testing it with the lovely pyethereum, doing things like:
from ethereum import tester as t
class testMyContract(TestCase):
def setUp(self):
self.s = t.state()
code = open('../mycontract.sol').read()
self.mycontract = self.s.abi_contract(code, language='solidity', sender=t.k0)
def testExpensiveThing(self):
mydata = [1000, 3000, 2000, 8000]
self.mycontract.doExpensiveThing(mydata)
This blows up with
File "/usr/local/lib/python2.7/dist-packages/ethereum/tester.py", line 201, in _send
raise TransactionFailed()
TransactionFailed
It doesn't blow up when I pass it less data, and the contract looks quite expensive, so I'm assuming it's breaking because it's running out of gas. Is there a way to pass pyethereum some settings that will allow the transaction to use more gas?