Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/tests-fix' into feature/…
Browse files Browse the repository at this point in the history
…post-zhejiang-fixes
  • Loading branch information
TheDZhon committed Feb 13, 2023
2 parents 0cf616c + db01adc commit 710f536
Show file tree
Hide file tree
Showing 18 changed files with 694 additions and 359 deletions.
37 changes: 0 additions & 37 deletions contracts/0.4.24/test_helpers/LidoMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,41 +70,4 @@ contract LidoMock is Lido {
function burnShares(address _account, uint256 _amount) external {
_burnShares(_account, _amount);
}

function handleOracleReportDirect(
// Oracle timings
uint256 _reportTimestamp,
uint256 _timeElapsed,
// CL values
uint256 _clValidators,
uint256 _clBalance,
// EL values
uint256 _withdrawalVaultBalance,
uint256 _elRewardsVaultBalance,
// Decision about withdrawals processing
uint256 _lastFinalizableRequestId,
uint256 _simulatedShareRate
) external returns (
uint256 totalPooledEther,
uint256 totalShares,
uint256 withdrawals,
uint256 elRewards
) {

OracleReportContracts memory protocolContracts = _loadOracleReportContracts();

return _handleOracleReport(
OracleReportedData(
_reportTimestamp,
_timeElapsed,
_clValidators,
_clBalance,
_withdrawalVaultBalance,
_elRewardsVaultBalance,
_lastFinalizableRequestId,
_simulatedShareRate
),
protocolContracts
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ contract OracleReportSanityChecker is AccessControlEnumerable {

uint256 churnLimit = (_limitsList.churnValidatorsPerDayLimit * _timeElapsed) / SECONDS_PER_DAY;

if (_appearedValidators > churnLimit) revert IncorrectAppearedValidators(churnLimit);
if (_appearedValidators > churnLimit) revert IncorrectAppearedValidators(_appearedValidators);
}

function _checkRequestIdToFinalizeUpTo(
Expand Down
19 changes: 17 additions & 2 deletions contracts/0.8.9/test_helpers/OracleReportSanityCheckerMocks.sol
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,31 @@ contract LidoLocatorStub is ILidoLocator {
}

contract OracleReportSanityCheckerStub {
error SelectorNotFound(bytes4 sig, uint256 value, bytes data);

fallback() external payable { revert SelectorNotFound(msg.sig, msg.value, msg.data); }

function checkAccountingOracleReport(
uint256 _timeElapsed,
uint256 _preCLBalance,
uint256 _postCLBalance,
uint256 _withdrawalVaultBalance
uint256 _withdrawalVaultBalance,
uint256 _elRewardsVaultBalance,
uint256 _preCLValidators,
uint256 _postCLValidators
) external view {}

function checkWithdrawalQueueOracleReport(
uint256 _lastFinalizableRequestId,
uint256 _simulatedShareRate,
uint256 _reportTimestamp
) external view {}
) external view {}

function checkSimulatedShareRate(
uint256 _noWithdrawalsPostTotalPooledEther,
uint256 _noWithdrawalsPostTotalShares,
uint256 _simulatedShareRate
) external view {}

function smoothenTokenRebase(
uint256,
Expand All @@ -109,4 +122,6 @@ contract OracleReportSanityCheckerStub {
elRewards = _elRewardsVaultBalance;
sharesToBurnLimit = _etherToLockForWithdrawals;
}

function checkAccountingExtraDataListItemsCount(uint256 _extraDataListItemsCount) external view {}
}
Loading

0 comments on commit 710f536

Please sign in to comment.