-
Notifications
You must be signed in to change notification settings - Fork 27
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
Staking manager unit tests #476
Conversation
|
||
contract NativeTokenStakingManager is StakingManager, INativeTokenStakingManager { | ||
using Address for address payable; | ||
|
||
constructor(StakingManagerSettings memory settings) { |
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.
we should avoid pasing through constructor since the contract is meant to be upgradeable
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.
I'll wait to merge this PR until after #477, and update all the constructor/initialize calls then.
registrationTimestamp: 1000, | ||
completionTimestamp: 2000 | ||
}); | ||
bytes memory setValidatorWeightPayload = |
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.
can add a using
statement for the IDs
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.
Are you suggesting adding using
for validationID
so we can call certain packing methods directly on the validationID
? My hesitation there is that not all of the methods take validationID's, and I'd prefer consistent notation.
* @param uptime The uptime of the validator. | ||
* @return The packed message. | ||
*/ | ||
function packValidationUptimeMessage( |
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.
does abi.encodePacked
work for these packs? ref: #482
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, happy to get this in the WIP draft first before too many changes to that branch
Why this should be merged
Adds unit tests for the happy path for validator regestration and delisting.
Adds unit tests for StakingMessages packing/unpacking functions
Adds methods to StakingMessages to achieve full packing/unpacking parity
NativeTokenStakingManager initializes StakingManager
Early return from churn check if max rate is set to 0
Identifies a number of additional test cases that will be implemented later
How this was tested
forge test
How is this documented
N/A