Apply suggestions from code review #1542

Co-Authored-By: MacLane Wilkison <maclane@nucypher.com>
pull/1542/head
vzotova 2019-12-21 22:40:33 +03:00
parent e66058530e
commit 7b089dac11
1 changed files with 6 additions and 6 deletions

View File

@ -82,7 +82,7 @@ contract StakingEscrow is Issuer {
*/
uint16 confirmedPeriod1;
uint16 confirmedPeriod2;
bool disableReStake;
bool reStakeDisabled;
uint16 lockReStakeUntilPeriod;
address worker;
// period when worker was set
@ -468,10 +468,10 @@ contract StakingEscrow is Issuer {
function setReStake(bool _reStake) public isInitialized {
require(!isReStakeLocked(msg.sender));
StakerInfo storage info = stakerInfo[msg.sender];
if (info.disableReStake == !_reStake) {
if (info.reStakeDisabled == !_reStake) {
return;
}
info.disableReStake = !_reStake;
info.reStakeDisabled = !_reStake;
emit ReStakeSet(msg.sender, _reStake);
}
@ -837,7 +837,7 @@ contract StakingEscrow is Issuer {
lockedPerPeriod[mintingPeriod],
lastPeriod.sub16(mintingPeriod));
reward += subStakeReward;
if (!_info.disableReStake) {
if (!_info.reStakeDisabled) {
subStake.lockedValue += subStakeReward;
}
}
@ -848,7 +848,7 @@ contract StakingEscrow is Issuer {
} else {
_info.confirmedPeriod2 = EMPTY_CONFIRMED_PERIOD;
}
if (_info.disableReStake) {
if (_info.reStakeDisabled) {
return reward;
}
if (_confirmedPeriodNumber == 1 &&
@ -1239,7 +1239,7 @@ contract StakingEscrow is Issuer {
require(infoToCheck.value == info.value &&
infoToCheck.confirmedPeriod1 == info.confirmedPeriod1 &&
infoToCheck.confirmedPeriod2 == info.confirmedPeriod2 &&
infoToCheck.disableReStake == info.disableReStake &&
infoToCheck.reStakeDisabled == info.reStakeDisabled &&
infoToCheck.lockReStakeUntilPeriod == info.lockReStakeUntilPeriod &&
infoToCheck.lastActivePeriod == info.lastActivePeriod &&
infoToCheck.measureWork == info.measureWork &&