Bytes array in contract - HELP!

NickMNickM Member Posts: 1
edited January 2016 in Solidity
Hi all,
what I'm trying to do is to store an array of bytes (bytes[], basically an array of arrays) in a contract.
I'm probably missing something here because it compiles but simply doesn't do anything.
Here's my code:
contract test { bytes[] public values; function valuesLength() constant returns (uint) { return values.length; } function getValue(uint valueIndex) constant returns (bytes) { return values[valueIndex]; } function addValue(bytes value) { values[0] = new bytes(value.length); for(uint i = 0; i < value.length; i++) { values[0].push(value[i]); } } }

Whatever I do with addValue, valuesLength() always returns zero, and nothing get stored in values;
What am I doing wrong here?
Sign In or Register to comment.