-
Notifications
You must be signed in to change notification settings - Fork 226
feat: add integration tests for ao extra data from scripts repo #1021
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
695c3c9
feat: add integration tests for ao extra data from scripts repo
arwer13 be5e5f0
Merge branch 'feat/vaults' into feat/tests-oracle-extra
arwer13 f93adbc
Apply suggestions from code review
arwer13 9a826a7
refactor: merge nor and sdvt utils and reuse in extra data tests
arwer13 36756a5
Merge branch 'feat/vaults' into feat/tests-oracle-extra
arwer13 916e2be
Merge 'feat/vaults' into 'feat/tests-oracle-extra'
arwer13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,97 @@ | ||
// SPDX-FileCopyrightText: 2024 Lido <[email protected]> | ||
// SPDX-License-Identifier: GPL-3.0 | ||
// For full version see: https://github.com/lidofinance/community-staking-module/blob/develop/src/interfaces/ICSModule.sol | ||
import { IStakingModule } from "../../0.8.9/interfaces/IStakingModule.sol"; | ||
|
||
pragma solidity 0.8.9; | ||
|
||
|
||
struct NodeOperator { | ||
// All the counters below are used together e.g. in the _updateDepositableValidatorsCount | ||
/* 1 */ uint32 totalAddedKeys; // @dev increased and decreased when removed | ||
/* 1 */ uint32 totalWithdrawnKeys; // @dev only increased | ||
/* 1 */ uint32 totalDepositedKeys; // @dev only increased | ||
/* 1 */ uint32 totalVettedKeys; // @dev both increased and decreased | ||
/* 1 */ uint32 stuckValidatorsCount; // @dev both increased and decreased | ||
/* 1 */ uint32 depositableValidatorsCount; // @dev any value | ||
/* 1 */ uint32 targetLimit; | ||
/* 1 */ uint8 targetLimitMode; | ||
/* 2 */ uint32 totalExitedKeys; // @dev only increased except for the unsafe updates | ||
/* 2 */ uint32 enqueuedCount; // Tracks how many places are occupied by the node operator's keys in the queue. | ||
/* 2 */ address managerAddress; | ||
/* 3 */ address proposedManagerAddress; | ||
/* 4 */ address rewardAddress; | ||
/* 5 */ address proposedRewardAddress; | ||
/* 5 */ bool extendedManagerPermissions; | ||
} | ||
|
||
struct NodeOperatorManagementProperties { | ||
address managerAddress; | ||
address rewardAddress; | ||
bool extendedManagerPermissions; | ||
} | ||
|
||
/// @title Lido's Community Staking Module interface | ||
interface ICSModule is IStakingModule | ||
{ | ||
error NodeOperatorDoesNotExist(); | ||
error ZeroRewardAddress(); | ||
|
||
/// @notice Gets node operator non-withdrawn keys | ||
/// @param nodeOperatorId ID of the node operator | ||
/// @return Non-withdrawn keys count | ||
function getNodeOperatorNonWithdrawnKeys( | ||
uint256 nodeOperatorId | ||
) external view returns (uint256); | ||
|
||
/// @notice Returns the node operator by id | ||
/// @param nodeOperatorId Node Operator id | ||
function getNodeOperator( | ||
uint256 nodeOperatorId | ||
) external view returns (NodeOperator memory); | ||
|
||
/// @notice Gets node operator signing keys | ||
/// @param nodeOperatorId ID of the node operator | ||
/// @param startIndex Index of the first key | ||
/// @param keysCount Count of keys to get | ||
/// @return Signing keys | ||
function getSigningKeys( | ||
uint256 nodeOperatorId, | ||
uint256 startIndex, | ||
uint256 keysCount | ||
) external view returns (bytes memory); | ||
|
||
/// @notice Gets node operator signing keys with signatures | ||
/// @param nodeOperatorId ID of the node operator | ||
/// @param startIndex Index of the first key | ||
/// @param keysCount Count of keys to get | ||
/// @return keys Signing keys | ||
/// @return signatures Signatures of (deposit_message, domain) tuples | ||
function getSigningKeysWithSignatures( | ||
uint256 nodeOperatorId, | ||
uint256 startIndex, | ||
uint256 keysCount | ||
) external view returns (bytes memory keys, bytes memory signatures); | ||
|
||
/// @notice Report node operator's key as slashed and apply initial slashing penalty. | ||
/// @param nodeOperatorId Operator ID in the module. | ||
/// @param keyIndex Index of the slashed key in the node operator's keys. | ||
function submitInitialSlashing( | ||
uint256 nodeOperatorId, | ||
uint256 keyIndex | ||
) external; | ||
|
||
/// @notice Report node operator's key as withdrawn and settle withdrawn amount. | ||
/// @param nodeOperatorId Operator ID in the module. | ||
/// @param keyIndex Index of the withdrawn key in the node operator's keys. | ||
/// @param amount Amount of withdrawn ETH in wei. | ||
/// @param isSlashed Validator is slashed or not | ||
function submitWithdrawal( | ||
uint256 nodeOperatorId, | ||
uint256 keyIndex, | ||
uint256 amount, | ||
bool isSlashed | ||
) external; | ||
|
||
function depositETH(uint256 nodeOperatorId) external payable; | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.