Skip to content
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

Add getters to validator manager #655

Merged
merged 8 commits into from
Dec 4, 2024
Merged

Conversation

geoff-vball
Copy link
Contributor

@geoff-vball geoff-vball commented Nov 22, 2024

Why this should be merged

Closes #645

Makes storage getters internal. This isn't the best coding practice, but contract code-size limits made this the most practical option. Child contracts should probably never write to their parent's storage.

How is this documented

N/A

@geoff-vball geoff-vball force-pushed the getters-validator-manager branch from 3337c61 to e7103d2 Compare November 27, 2024 15:58
@geoff-vball geoff-vball force-pushed the getters-validator-manager branch from 4abacde to bf2ffcc Compare November 29, 2024 20:51
Comment on lines -472 to -479
/**
* @notice Returns the validator's weight. This weight is not guaranteed to be known by the P-Chain
* @return Weight of the validator. If the validation ID does not exist, the weight will be 0.
*/
function getWeight(bytes32 validationID) external view returns (uint64) {
return getValidator(validationID).weight;
}

Copy link
Contributor Author

@geoff-vball geoff-vball Nov 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant, we have an external getter for the Validator object

@geoff-vball geoff-vball force-pushed the getters-validator-manager branch from a407a7f to d46a4da Compare November 29, 2024 21:03
@geoff-vball geoff-vball marked this pull request as ready for review November 29, 2024 21:32
@geoff-vball geoff-vball requested a review from a team as a code owner November 29, 2024 21:32
@geoff-vball geoff-vball merged commit daf22de into main Dec 4, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add more getters to the ValidatorManager contract
3 participants