I can't figure out how to initial this data for the life of me. I have 2 structs which looks like so:
struct UserVotes {
address userAddress;
VoteOptionAmounts[] votes;
}
struct VoteInfo {
uint256[] totalVotes;
UserVotes[] userVotes;
VoteChoices[] voteChoices;
}
I'm trying to initialize User Votes for a paticular user:
Attempt 1:
UserVotes memory newVote = UserVotes(account, new VoteOptionAmounts[](0));
proposal.voteInfo.userVotes.push(newVote);
Attempt 2:
VoteOptionAmounts[] storage userOptionAmounts = new VoteOptionAmounts[](0);
proposal.voteInfo.userVotes.push(UserVotes(account, userOptionAmounts));
Attempt 3:
proposal.voteInfo.userVotes.push(UserVotes(account, [VoteOptionAmounts(voteOptions[i].supportOption, optionWeight)]));
Nothing seems to work everything returns:
Copying of type struct VoteOptionAmounts memory[] memory to storage not yet supported.