1

I'm not sure why this doesn't work. I have the exact same pattern for addresses and it does fine.

bytes32[] public someStorage;

function addToStorage(bytes32 someData) {
  someStorage.push(someData);
}

Then using web3:

instance.addToStorage("Some Data", {from: web3.eth.accounts[0], gas:1000000})

I get a tx address but in testrpc console I see a matching Runtime Error: Invalid Opcode and it always consumes the max gas that I set.

1

Looks like this is a result of truffle not updating the contract artifacts in the build folder.

I've had a couple gotcha's like this and found that compiling with truffle migrate --reset can help

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.