I get an error when trying to push the newRound struct to storage. How can it be fixed?
Error:
UnimplementedFeatureError: Copying of type struct Lottery.Ticket memory[] memory to storage not yet supported.
pragma solidity >=0.4.25 <0.6.0;
contract Lottery {
struct Round {
uint deployBlock;
uint endBlock;
uint drawBlock;
Ticket[] tickets;
uint checkpot;
address winner;
}
struct Ticket{
address owner;
uint luckyNumber;
}
Round[] rounds;
uint public roundIndex;
function drawWinner() public returns (address _winner){
Ticket[] memory newTickets;
// How to push this new struct to storage?
Round memory newRound = Round({
deployBlock: block.number,
endBlock: block.number + ROUND_DURATION,
drawBlock: block.number + ROUND_DURATION + 5,
tickets: newTickets,
checkpot: 0,
winner:address(0)
});
rounds.push(newRound);
roundIndex++;
return rounds[roundIndex].tickets[0].owner;
}
}