mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add push() for dynamic storage arrays
This commit is contained in:
@@ -70,7 +70,8 @@ contract schellingDB is safeMath, schellingVars {
|
||||
else { return (true, rounds[_id].totalAboveWeight, rounds[_id].totalBelowWeight, rounds[_id].reward, rounds[_id].blockHeight, rounds[_id].voted); }
|
||||
}
|
||||
function pushRound(uint256 _totalAboveWeight, uint256 _totalBelowWeight, uint256 _reward, uint256 _blockHeight, bool _voted) isOwner external returns(bool, uint256) {
|
||||
return (true, rounds.push(_rounds(_totalAboveWeight, _totalBelowWeight, _reward, _blockHeight, _voted)));
|
||||
rounds.push(_rounds(_totalAboveWeight, _totalBelowWeight, _reward, _blockHeight, _voted));
|
||||
return (true, rounds.length);
|
||||
}
|
||||
function setRound(uint256 _id, uint256 _totalAboveWeight, uint256 _totalBelowWeight, uint256 _reward, uint256 _blockHeight, bool _voted) isOwner external returns(bool) {
|
||||
rounds[_id] = _rounds(_totalAboveWeight, _totalBelowWeight, _reward, _blockHeight, _voted);
|
||||
|
||||
Reference in New Issue
Block a user