Skip to content

Commit

Permalink
Merge pull request #99 from lidofinance/fix/solidity-warnings
Browse files Browse the repository at this point in the history
Solidity warnings fixes
  • Loading branch information
rkolpakov authored Aug 20, 2024
2 parents 022d9d1 + 781a48d commit 48f8438
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
3 changes: 1 addition & 2 deletions test/scenario/escrow.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ contract EscrowHappyPath is ScenarioTestBlueprint {
}

function test_check_finalization() public {
uint256 totalAmountLocked = 2 ether;
uint256[] memory amounts = new uint256[](2);
for (uint256 i = 0; i < 2; ++i) {
amounts[i] = 1 ether;
Expand Down Expand Up @@ -345,7 +344,7 @@ contract EscrowHappyPath is ScenarioTestBlueprint {
// unstETH holders claim their withdrawal requests
// ---
{
uint256[] memory hints =
hints =
_lido.withdrawalQueue.findCheckpointHints(unstETHIds, 1, _lido.withdrawalQueue.getLastCheckpointIndex());
escrow.claimUnstETH(unstETHIds, hints);

Expand Down
2 changes: 1 addition & 1 deletion test/scenario/happy-path-plan-b.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ contract PlanBSetup is ScenarioTestBlueprint {

assertFalse(_timelock.isEmergencyModeActive());

EmergencyProtection.Context memory emergencyState = _timelock.getEmergencyProtectionContext();
emergencyState = _timelock.getEmergencyProtectionContext();
assertEq(emergencyState.emergencyActivationCommittee, address(_emergencyActivationCommittee));
assertEq(emergencyState.emergencyExecutionCommittee, address(_emergencyExecutionCommittee));
assertEq(emergencyState.emergencyModeDuration, Durations.from(30 days));
Expand Down
2 changes: 1 addition & 1 deletion test/scenario/proposal-deployment-modes.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ contract ProposalDeploymentModesTest is ScenarioTestBlueprint {
function test_protected_deployment_mode_deactivation_in_emergency_mode() external {
_deployDualGovernanceSetup(true);

(uint256 proposalId, ExternalCall[] memory regularStaffCalls) = _createAndAssertProposal();
(uint256 proposalId,) = _createAndAssertProposal();

_wait(_timelock.getAfterSubmitDelay().dividedBy(2));

Expand Down
15 changes: 4 additions & 11 deletions test/utils/scenario-test-blueprint.sol
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,6 @@ contract ScenarioTestBlueprint is TestingAssertEqExtender, SetupDeployment {
_lido.submitWstETH(account, _lido.calcSharesToDepositFromPercentageOfTVL(tvlPercentage));
}

function _submitStETH(
address account,
uint256 amountToMint
) internal returns (uint256 sharesMinted, uint256 amountMinted) {
_lido.submitStETH(account, amountToMint);
}

function _getBalances(address vetoer) internal view returns (Balances memory balances) {
uint256 stETHAmount = _lido.stETH.balanceOf(vetoer);
uint256 wstETHShares = _lido.wstETH.balanceOf(vetoer);
Expand Down Expand Up @@ -469,7 +462,7 @@ contract ScenarioTestBlueprint is TestingAssertEqExtender, SetupDeployment {
// ---
// Logging and Debugging
// ---
function _logVetoSignallingState() internal {
function _logVetoSignallingState() internal view {
/* solhint-disable no-console */
(bool isActive, uint256 duration, uint256 activatedAt, uint256 enteredAt) = _getVetoSignallingState();

Expand All @@ -494,7 +487,7 @@ contract ScenarioTestBlueprint is TestingAssertEqExtender, SetupDeployment {
/* solhint-enable no-console */
}

function _logVetoSignallingDeactivationState() internal {
function _logVetoSignallingDeactivationState() internal view {
/* solhint-disable no-console */
(bool isActive, uint256 duration, uint256 enteredAt) = _getVetoSignallingDeactivationState();

Expand Down Expand Up @@ -525,7 +518,7 @@ contract ScenarioTestBlueprint is TestingAssertEqExtender, SetupDeployment {
// Utils Methods
// ---

function _step(string memory text) internal {
function _step(string memory text) internal view {
// solhint-disable-next-line
console.log(string.concat(">>> ", text, " <<<"));
}
Expand Down Expand Up @@ -576,7 +569,7 @@ contract ScenarioTestBlueprint is TestingAssertEqExtender, SetupDeployment {
uint256 _seconds;
}

function _toDuration(uint256 timestamp) internal view returns (DurationStruct memory duration) {
function _toDuration(uint256 timestamp) internal pure returns (DurationStruct memory duration) {
duration._days = timestamp / 1 days;
duration._hours = (timestamp - 1 days * duration._days) / 1 hours;
duration._minutes = (timestamp - 1 days * duration._days - 1 hours * duration._hours) / 1 minutes;
Expand Down

0 comments on commit 48f8438

Please sign in to comment.