-
Notifications
You must be signed in to change notification settings - Fork 86
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 BlockHeight to TransactionResult #308
Add BlockHeight to TransactionResult #308
Conversation
LGTM |
Codecov Report
@@ Coverage Diff @@
## master #308 +/- ##
==========================================
+ Coverage 65.98% 66.01% +0.03%
==========================================
Files 21 21
Lines 1952 1954 +2
==========================================
+ Hits 1288 1290 +2
Misses 543 543
Partials 121 121
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
probably want to add to access/http as well?
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.
Good catch @rrrkren.
@emilic You'll also want to update this function to include BlockHeight
:
flow-go-sdk/access/http/convert.go
Lines 356 to 373 in 900f9f9
func toTransactionResult(txr *models.TransactionResult, options []cadenceJSON.Option) (*flow.TransactionResult, error) { | |
events, err := toEvents(txr.Events, options) | |
if err != nil { | |
return nil, err | |
} | |
var txErr error | |
if txr.ErrorMessage != "" { | |
txErr = fmt.Errorf(txr.ErrorMessage) | |
} | |
return &flow.TransactionResult{ | |
Status: toTransactionStatus(txr.Status), | |
Error: txErr, | |
Events: events, | |
BlockID: flow.HexToID(txr.BlockId), | |
}, nil | |
} |
I believe that will require a change to the TransactionResult
JSON model here:
type TransactionResult struct { |
I mentioned that this is generated from an openapi schema in another project. I made this PR: onflow/flow#1025 to add the block_height to the schema so we can generate it with the Makefile |
I'll need to make a PR to the |
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.
This looks good to me.
Thanks for clarifying @emilic. I think it's OK to merge this as-is given that the HTTP doesn't yet support the block height field.
Closes: #307
Description
Add missing BlockHeight to the TransactionResult. Note that this update is only for the GRPC API call and does not update the HTTP endpoint. Comments in issue refer requiring openapi schema needing updates so new models can be generated, out of scope for this PR.
For contributor use:
master
branchFiles changed
in the Github PR explorer