-
Notifications
You must be signed in to change notification settings - Fork 534
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
Expose ValidatorInfo
struct
#1162
Expose ValidatorInfo
struct
#1162
Conversation
@@ -14,6 +14,17 @@ import ( | |||
"github.com/umbracle/ethgo/contract" | |||
) | |||
|
|||
// ValidatorInfo is data transfer object which holds validator information, | |||
// provided by smart contract | |||
type ValidatorInfo struct { |
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.
Should it be merged with ValidatorMetadata
at some point?
Codecov Report
@@ Coverage Diff @@
## feature/v3-parity #1162 +/- ##
====================================================
Coverage ? 54.51%
====================================================
Files ? 173
Lines ? 23179
Branches ? 0
====================================================
Hits ? 12636
Misses ? 9545
Partials ? 998 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
What is the problem being solved here? |
What we want to achieve here is returning an object representation of validator info instead of map (https://github.com/0xPolygon/polygon-edge/pull/1162/files#diff-090d11924b8e0865632ddb3e8da73ceb5b944c6ee26ee8be367f8e626097480aR46), which is more error prone when extracting values and it has some repetitions in code. So far this was mostly used in e2e tests, so instead of remembering the keys for extracting values for map (https://github.com/0xPolygon/polygon-edge/pull/1162/files#diff-35f7a314332bee5e2f8472071db16a9916b25e85662af4cca846deb81b78800cL635-L636), we already have object representation which is more straight-forward to use. |
Description
This PR exposes and utilizes the
ValidatorInfo
struct. It represents a data transfer object, which is used to hold all validator data retrieved from the smart contract.Note: It is worth to consider merging it with the
ValidatorMetadata
object at some point.Changes include
Checklist
Testing