-
Notifications
You must be signed in to change notification settings - Fork 242
Add convenience URL /transactions/{txnid}/blockchainevents #446
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
Conversation
90e5f7d to
ce65ae5
Compare
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
ce65ae5 to
468b59e
Compare
Codecov Report
@@ Coverage Diff @@
## main #446 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 278 279 +1
Lines 14981 14995 +14
=========================================
+ Hits 14981 14995 +14
Continue to review full report at Codecov.
|
peterbroadhurst
left a comment
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.
One trivial suggestion, with approval.
| FilterFactory: nil, | ||
| Description: i18n.MsgTBD, | ||
| JSONInputValue: nil, | ||
| JSONOutputValue: func() interface{} { return &[]*fftypes.BlockchainEvent{} }, |
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.
Shouldn't need the & here I think as arrays are a reference type, although it doesn't really matter.
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 copy-pasted this, but your comment prompted me to do a quick investigation... it actually looks like the Swagger generation for the output schema is only correct if you do include the &. So for this route it correctly indicates that it will return an array of BlockchainEvent. But for other routes that don't return a pointer, it's a bit broken - such as for /transactions, which returns []*fftypes.Transaction, the Swagger indicates it will return a single Transaction object.
I take this to mean we should add the & everywhere on array returns, or investigate why the Swagger generation behaves this way.
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.
Thanks for digging! Will merge based on this and raise an issue
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.
Thanks, I see #449
No description provided.