-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from lidofinance/fix/broken-tests
Fix broken tests. Refactor test base classes.
- Loading branch information
Showing
49 changed files
with
2,727 additions
and
2,558 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.26; | ||
|
||
import {ExternalCall} from "../libraries/ExternalCalls.sol"; | ||
|
||
interface IGovernance { | ||
function submitProposal(ExternalCall[] calldata calls) external returns (uint256 proposalId); | ||
function scheduleProposal(uint256 proposalId) external; | ||
function cancelAllPendingProposals() external; | ||
|
||
function canScheduleProposal(uint256 proposalId) external view returns (bool); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.26; | ||
|
||
type PercentD16 is uint256; | ||
|
||
uint256 constant HUNDRED_PERCENTS_UINT256 = 100 * 10 ** 16; | ||
|
||
error Overflow(); | ||
|
||
using {lt as <, gte as >=, gt as >, minus as -, plus as +} for PercentD16 global; | ||
|
||
function lt(PercentD16 a, PercentD16 b) pure returns (bool) { | ||
return PercentD16.unwrap(a) < PercentD16.unwrap(b); | ||
} | ||
|
||
function gt(PercentD16 a, PercentD16 b) pure returns (bool) { | ||
return PercentD16.unwrap(a) > PercentD16.unwrap(b); | ||
} | ||
|
||
function gte(PercentD16 a, PercentD16 b) pure returns (bool) { | ||
return PercentD16.unwrap(a) >= PercentD16.unwrap(b); | ||
} | ||
|
||
function minus(PercentD16 a, PercentD16 b) pure returns (PercentD16) { | ||
if (b > a) { | ||
revert Overflow(); | ||
} | ||
return PercentD16.wrap(PercentD16.unwrap(a) - PercentD16.unwrap(b)); | ||
} | ||
|
||
function plus(PercentD16 a, PercentD16 b) pure returns (PercentD16) { | ||
return PercentD16.wrap(PercentD16.unwrap(a) + PercentD16.unwrap(b)); | ||
} | ||
|
||
library PercentsD16 { | ||
function fromBasisPoints(uint256 bpValue) internal pure returns (PercentD16) { | ||
return PercentD16.wrap(HUNDRED_PERCENTS_UINT256 * bpValue / 100_00); | ||
} | ||
|
||
function fromFraction(uint256 numerator, uint256 denominator) internal pure returns (PercentD16) { | ||
return PercentD16.wrap(HUNDRED_PERCENTS_UINT256 * numerator / denominator); | ||
} | ||
} |
Oops, something went wrong.