Skip to content

Commit

Permalink
rename systemRewardRatio to initSystemRewardRatio in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanBSC committed May 22, 2024
1 parent 03c6d3c commit 643e917
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions test/SlashIndicator.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ contract SlashIndicatorTest is Deployer {

uint256 public burnRatio;
uint256 public burnRatioScale;
uint256 public systemRewardRatio;
uint256 public initSystemRewardRatio;
uint256 public systemRewardRatioScale;

address public coinbase;
Expand All @@ -19,8 +19,8 @@ contract SlashIndicatorTest is Deployer {
bscValidatorSet.isSystemRewardIncluded() ? bscValidatorSet.burnRatio() : bscValidatorSet.INIT_BURN_RATIO();
burnRatioScale = bscValidatorSet.BLOCK_FEES_RATIO_SCALE();

systemRewardRatio = bscValidatorSet.isSystemRewardIncluded()
? bscValidatorSet.systemRewardRatio()
initSystemRewardRatio = bscValidatorSet.isSystemRewardIncluded()
? bscValidatorSet.initSystemRewardRatio()
: bscValidatorSet.INIT_SYSTEM_REWARD_RATIO();
systemRewardRatioScale = bscValidatorSet.BLOCK_FEES_RATIO_SCALE();

Expand Down Expand Up @@ -356,7 +356,7 @@ contract SlashIndicatorTest is Deployer {
}

function _calcIncoming(uint256 value) internal view returns (uint256 incoming) {
uint256 toSystemReward = (value * systemRewardRatio) / systemRewardRatioScale;
uint256 toSystemReward = (value * initSystemRewardRatio) / systemRewardRatioScale;
uint256 toBurn = (value * burnRatio) / burnRatioScale;
incoming = value - toSystemReward - toBurn;
}
Expand Down
8 changes: 4 additions & 4 deletions test/ValidatorSet.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ contract ValidatorSetTest is Deployer {
uint256 public burnRatioScale;
uint256 public maxNumOfWorkingCandidates;
uint256 public numOfCabinets;
uint256 public systemRewardRatio;
uint256 public initSystemRewardRatio;
uint256 public systemRewardRatioScale;

address public coinbase;
Expand All @@ -42,8 +42,8 @@ contract ValidatorSetTest is Deployer {
burnRatio =
bscValidatorSet.isSystemRewardIncluded() ? bscValidatorSet.burnRatio() : bscValidatorSet.INIT_BURN_RATIO();
burnRatioScale = bscValidatorSet.BLOCK_FEES_RATIO_SCALE();
systemRewardRatio = bscValidatorSet.isSystemRewardIncluded()
? bscValidatorSet.systemRewardRatio()
initSystemRewardRatio = bscValidatorSet.isSystemRewardIncluded()
? bscValidatorSet.initSystemRewardRatio()
: bscValidatorSet.INIT_SYSTEM_REWARD_RATIO();
systemRewardRatioScale = bscValidatorSet.BLOCK_FEES_RATIO_SCALE();
totalInComing = bscValidatorSet.totalInComing();
Expand Down Expand Up @@ -615,7 +615,7 @@ contract ValidatorSetTest is Deployer {
}

function _calcIncoming(uint256 value) internal view returns (uint256 incoming) {
uint256 toSystemReward = (value * systemRewardRatio) / systemRewardRatioScale;
uint256 toSystemReward = (value * initSystemRewardRatio) / systemRewardRatioScale;
uint256 toBurn = (value * burnRatio) / burnRatioScale;
incoming = value - toSystemReward - toBurn;
}
Expand Down
2 changes: 1 addition & 1 deletion test/utils/interface/IBSCValidatorSet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ interface BSCValidatorSet {
function handleFailAckPackage(uint8 channelId, bytes memory msgBytes) external;
function handleSynPackage(uint8, bytes memory msgBytes) external returns (bytes memory responsePayload);
function init() external;
function initSystemRewardRatio() external view returns (uint256);
function isCurrentValidator(address validator) external view returns (bool);
function isMonitoredForMaliciousVote(bytes memory voteAddr) external view returns (bool);
function isSystemRewardIncluded() external view returns (bool);
Expand All @@ -124,7 +125,6 @@ interface BSCValidatorSet {
function previousHeight() external view returns (uint256);
function previousVoteAddrFullSet(uint256) external view returns (bytes memory);
function removeTmpMigratedValidator(address validator) external;
function systemRewardRatio() external view returns (uint256);
function totalInComing() external view returns (uint256);
function updateParam(string memory key, bytes memory value) external;
function updateValidatorSetV2(
Expand Down

0 comments on commit 643e917

Please sign in to comment.