I am trying to push a bytes32 to an array, but it stays empty.
This is (part of) my code:
contract Voting {
bytes32[] public encryptedVotes;
bytes32[] public candidateList;
address[] public pollingStationList;
address public owner;
function Voting(bytes32[] _candidateList, address[] _pollingStationList) public {
candidateList = _candidateList;
pollingStationList = _pollingStationList;
owner = msg.sender;
}
function vote(bytes32 encryptedVote) public {
encryptedVotes.push(encryptedVote);
}
function getEncryptedVotes() view public returns (bytes32[]) {
return encryptedVotes;
}
}
Don't mind the "encrypted" part of the code, it's part of more logic.
The problem lies in the "vote" function. When I call it it with web3, "contractInstance.vote.call("a value")", it returns [] but doesn't change the state. Calling getEncryptedVotes returns [].
Is there some logic surrounding bytes32 I am failing to see? Thanks in advance!