Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Tech debt in ReleaseGold and Election #3940

Merged
merged 6 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/protocol/contracts/governance/Election.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,6 @@ contract Election is
}
}
require(info.remainingValue == 0, "Failure to decrement all votes.");
return value.sub(info.remainingValue);
return value;
}
}
7 changes: 4 additions & 3 deletions packages/protocol/contracts/governance/ReleaseGold.sol
Original file line number Diff line number Diff line change
Expand Up @@ -426,15 +426,16 @@ contract ReleaseGold is UsingRegistry, ReentrancyGuard, IReleaseGold, Initializa
/**
* @notice Calculates remaining locked gold balance in the release schedule instance.
* The returned amount also includes pending withdrawals to maintain consistent releases.
* Return 0 if address of caller is not an account.
* @return The remaining locked gold of the release schedule instance.
* @dev The returned amount may vary over time due to locked gold rewards.
*/
function getRemainingLockedBalance() public view returns (uint256) {
uint256 pendingWithdrawalSum = 0;
if (getAccounts().isAccount(address(this))) {
pendingWithdrawalSum = getLockedGold().getTotalPendingWithdrawals(address(this));
uint256 pendingWithdrawalSum = getLockedGold().getTotalPendingWithdrawals(address(this));
return getLockedGold().getAccountTotalLockedGold(address(this)).add(pendingWithdrawalSum);
}
return getLockedGold().getAccountTotalLockedGold(address(this)).add(pendingWithdrawalSum);
return 0;
}

/**
Expand Down