I have a public array of structs. Each struct has a fixed-length array inside of it. How do I go about accessing a specific struct's array member via web3? The contract is compiling, but when I use the public array's getter function, it leaves the array member out.
Solidity:
pragma solidity ^0.4.21;
contract Foo {
struct Bar {
bytes32 a;
uint8[9] b;
}
Bar[] public bars;
function add(bytes32 _a, uint8[9] _b) public {
bars.push(Bar(_a, _b));
}
}
web3:
let foo = await Foo.new();
await foo.add("banana", [1, 1, 2, 3, 5]);
let bar = await foo.bars(0);
assert.equal(foo[0], "banana");
assert.equal(foo[1], [1, 1, 2, 3, 5]); // fails, returns undefined