-
Notifications
You must be signed in to change notification settings - Fork 474
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
Algod: rename some API operations for clarity #4376
Algod: rename some API operations for clarity #4376
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4376 +/- ##
==========================================
+ Coverage 55.56% 55.60% +0.03%
==========================================
Files 403 403
Lines 50776 50780 +4
==========================================
+ Hits 28216 28237 +21
+ Misses 20163 20151 -12
+ Partials 2397 2392 -5
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
StateProof: protocol.Encode(&tx.StateProof), | ||
} | ||
|
||
response.Message.BlockHeadersCommitment = tx.Message.BlockHeadersCommitment | ||
response.Message.VotersCommitment = tx.Message.VotersCommitment | ||
response.Message.LnProvenWeight = tx.Message.LnProvenWeight | ||
response.Message.FirstAttestedRound = tx.Message.FirstAttestedRound | ||
response.Message.LastAttestedRound = tx.Message.LastAttestedRound |
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.
nit: initialize all at once
StateProof: protocol.Encode(&tx.StateProof), | |
} | |
response.Message.BlockHeadersCommitment = tx.Message.BlockHeadersCommitment | |
response.Message.VotersCommitment = tx.Message.VotersCommitment | |
response.Message.LnProvenWeight = tx.Message.LnProvenWeight | |
response.Message.FirstAttestedRound = tx.Message.FirstAttestedRound | |
response.Message.LastAttestedRound = tx.Message.LastAttestedRound | |
StateProof: protocol.Encode(&tx.StateProof), | |
Message: generated.StateProof.Message { | |
BlockHeadersCommitment: tx.Message.BlockHeadersCommitment, | |
VotersCommitment: tx.Message.VotersCommitment, | |
LnProvenWeight: tx.Message.LnProvenWeight, | |
FirstAttestedRound: tx.Message.FirstAttestedRound, | |
LastAttestedRound: tx.Message.LastAttestedRound, | |
} | |
} |
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.
the message is defined as an embedded struct so this code will not work as is.
the idea was to avoid exposing a public structure named message
since it is not very informative by itself. Rather have it embedded into the state proof response
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.
You can still do these sorts of things with embedded structs: https://go.dev/play/p/prtHNzb7xPl
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.
But this - does not https://go.dev/play/p/FquXrvHyzeM
Message is generated as embedded:
type StateProof struct {
// Represents the message that the state proofs are attesting to.
Message struct {
// The vector commitment root on all light block headers within a state proof interval.
BlockHeadersCommitment []byte `json:"BlockHeadersCommitment"`
"format": "byte", | ||
"pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", | ||
"type": "string" | ||
"description": "Represents the message that the state proofs are attesting to.", |
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.
Looks like a little more than a rename, were these fields just missing before?
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.
the state proof message could be retrieved only in its msgpack version. I think it would be great to have all fields parsed.
No description provided.