Change formatting

This commit is contained in:
Mubaris NK 2021-03-22 16:12:26 +05:30
parent 42b9ce5a83
commit 7b14e3d4ec
No known key found for this signature in database
GPG Key ID: 9AC09AD0F8D68561

View File

@ -350,16 +350,16 @@ contract Token {
} }
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal { function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {
uint32 blockNumber = safe32(block.number, "Tkn::_writeCheckpoint: block number exceeds 32 bits"); uint32 blockNumber = safe32(block.number, "Tkn::_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else { } else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1; numCheckpoints[delegatee] = nCheckpoints + 1;
} }
emit DelegateVotesChanged(delegatee, oldVotes, newVotes); emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
} }