-
Notifications
You must be signed in to change notification settings - Fork 212
feat: added permissions for new actions and unit tests #1020
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
Conversation
# Conflicts: # test/0.8.25/vaults/dashboard/dashboard.test.ts # test/0.8.25/vaults/staking-vault/stakingVault.test.ts
Hardhat Unit Tests Coverage Summary
Diff against master
Results for commit: e9288d6 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 17 out of 28 changed files in this pull request and generated no comments.
Files not reviewed (11)
- contracts/0.8.25/vaults/Dashboard.sol: Language not supported
- contracts/0.8.25/vaults/Permissions.sol: Language not supported
- contracts/0.8.25/vaults/VaultFactory.sol: Language not supported
- contracts/0.8.25/vaults/interfaces/IStakingVault.sol: Language not supported
- test/0.4.24/contracts/LidoExecutionLayerRewardsVault__MockForLidoAccounting.sol: Language not supported
- test/0.4.24/contracts/WithdrawalVault__MockForLidoAccounting.sol: Language not supported
- test/0.8.25/vaults/contracts/StakingVault__HarnessForTestUpgrade.sol: Language not supported
- test/0.8.25/vaults/dashboard/contracts/PredepositGuarantee__MockForDashboard.sol: Language not supported
- test/0.8.25/vaults/permissions/contracts/Permissions__Harness.sol: Language not supported
- test/0.8.25/vaults/permissions/contracts/PredepositGuarantee__MockPermissions.sol: Language not supported
- test/0.8.25/vaults/permissions/contracts/VaultFactory__MockPermissions.sol: Language not supported
Comments suppressed due to low confidence (3)
test/0.8.25/vaults/permissions/permissions.test.ts:110
- Using getRandomSigners to obtain signers can introduce non-determinism in tests; consider using fixed or pre-configured signers to ensure predictable outcomes.
] = await getRandomSigners(20);
lib/protocol/helpers/index.ts:17
- The removal of the getRandomSigners export from this module requires a corresponding documentation update to inform consumers of its new location in lib/account.ts.
export { getRandomSigners } from "./get-random-signers";
lib/protocol/helpers/get-random-signers.ts:1
- Ensure that no modules or tests retain stale import paths for getRandomSigners that referenced this file; all such references should now point to lib/account.ts.
Entire file removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 22 out of 36 changed files in this pull request and generated no comments.
Files not reviewed (14)
- contracts/0.8.25/vaults/Dashboard.sol: Language not supported
- contracts/0.8.25/vaults/Permissions.sol: Language not supported
- contracts/0.8.25/vaults/StakingVault.sol: Language not supported
- contracts/0.8.25/vaults/VaultFactory.sol: Language not supported
- contracts/0.8.25/vaults/VaultHub.sol: Language not supported
- contracts/0.8.25/vaults/interfaces/IStakingVault.sol: Language not supported
- contracts/0.8.25/vaults/lib/PinnedBeaconUtils.sol: Language not supported
- test/0.4.24/contracts/LidoExecutionLayerRewardsVault__MockForLidoAccounting.sol: Language not supported
- test/0.4.24/contracts/WithdrawalVault__MockForLidoAccounting.sol: Language not supported
- test/0.8.25/vaults/contracts/StakingVault__HarnessForTestUpgrade.sol: Language not supported
- test/0.8.25/vaults/dashboard/contracts/ERC721__MockForDashboard.sol: Language not supported
- test/0.8.25/vaults/dashboard/contracts/PredepositGuarantee__MockForDashboard.sol: Language not supported
- test/0.8.25/vaults/dashboard/contracts/VaultFactory__MockForDashboard.sol: Language not supported
- test/0.8.25/vaults/dashboard/contracts/VaultHub__MockForDashboard.sol: Language not supported
Comments suppressed due to low confidence (2)
lib/protocol/helpers/vaults.ts:68
- Increasing the number of signers from 13 to 20 may cause unintended side effects if downstream logic expects a smaller set. Please verify that all parts of the system using these roles are compatible with the new count.
const defaultRoles = await getRandomSigners(20);
test/0.4.24/lido/lido.accounting.test.ts:153
- The helper function 'args' is used to spread parameters for collectRewardsAndProcessWithdrawals, but its definition isn’t visible in the diff. Please ensure 'args' is defined and returns the expected parameters for all test scenarios.
await expect(lido.collectRewardsAndProcessWithdrawals(...args({ elRewardsToWithdraw })))
Waiting for #1011 to be merged in? 🤔 |
# Conflicts: # contracts/0.8.25/vaults/Dashboard.sol # contracts/0.8.25/vaults/Permissions.sol # contracts/0.8.25/vaults/VaultFactory.sol # contracts/0.8.25/vaults/interfaces/IStakingVault.sol # lib/protocol/helpers/index.ts # lib/protocol/helpers/vaults.ts # test/0.8.25/vaults/delegation/delegation.test.ts # test/0.8.25/vaults/staking-vault/stakingVault.test.ts # test/0.8.25/vaults/vaultFactory.test.ts # test/0.8.25/vaults/vaulthub/vaulthub.detach.test.ts # test/0.8.9/accounting.handleOracleReport.test.ts # test/integration/vaults/happy-path.integration.ts # test/integration/vaults/roles.integration.ts
*/ | ||
bytes32 public constant ASSET_RECOVERY_ROLE = keccak256("vaults.Permissions.AssetRecovery"); | ||
bytes32 public constant LIDO_VAULTHUB_AUTHORIZATION_ROLE = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bytes32 public constant LIDO_VAULTHUB_AUTHORIZATION_ROLE = | |
bytes32 public constant LIDO_VAULTHUB_AUTHORIZE_ROLE = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even AUTHORIZE_LIDO_VAULTHUB_ROLE
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request includes several changes across multiple files to enhance the vault system's functionality and permissions management. The most important changes include adding new roles and permissions, updating functions for managing the staking vault, and refactoring existing code for clarity and consistency.
Enhancements to Permissions and Roles:
contracts/0.8.25/vaults/Permissions.sol
: Added new roles includingLIDO_VAULTHUB_AUTHORIZATION_ROLE
,OSSIFY_ROLE
,SET_DEPOSITOR_ROLE
, andRESET_LOCKED_ROLE
to manage various staking vault operations.Updates to Staking Vault Management:
contracts/0.8.25/vaults/Dashboard.sol
: Introduced functions likeauthorizeLidoVaultHub
,ossifyStakingVault
,setDepositor
, andresetLocked
to manage the staking vault's state and permissions.contracts/0.8.25/vaults/StakingVault.sol
: Refactored functions to use the termossified
instead ofisOssified
for consistency and added new events and checks.Code Refactoring and Consistency:
contracts/0.8.25/vaults/lib/PinnedBeaconUtils.sol
: Updated function names fromisOssified
toossified
for consistency across the codebase.contracts/0.8.25/vaults/VaultFactory.sol
: Added new role assignments forpdgWithdrawers
,lidoVaultHubAuthorizers
,ossifiers
,depositorSetters
, andlockedResetters
.Utility Functions and Helper Methods:
lib/account.ts
: Added a new functiongetRandomSigners
to generate random signers with a specified balance for testing purposes.lib/protocol/helpers/vaults.ts
: Integrated thegetRandomSigners
function and expanded theVaultRoles
type to include new roles.These changes collectively enhance the functionality, security, and maintainability of the vault system by introducing new roles, improving permission management, and ensuring consistency across the codebase.