-
Notifications
You must be signed in to change notification settings - Fork 29
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
Event data and filtering enhancements #41
Conversation
Signed-off-by: Jim Zhang <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #41 +/- ##
===========================================
+ Coverage 28.53% 53.14% +24.61%
===========================================
Files 18 13 -5
Lines 1749 939 -810
===========================================
Hits 499 499
+ Misses 1238 428 -810
Partials 12 12
Continue to review full report at Codecov.
|
Signed-off-by: Jim Zhang <[email protected]>
Signed-off-by: Jim Zhang <[email protected]>
Signed-off-by: Jim Zhang <[email protected]>
@@ -249,10 +250,10 @@ func (w *rpcWrapper) QueryChainInfo(channelId, signer string) (*fab.BlockchainIn | |||
} | |||
|
|||
// The returned registration must be closed when done | |||
func (w *rpcWrapper) SubscribeEvent(channelId, signer string, since uint64) (fab.Registration, <-chan *fab.BlockEvent, *event.Client, error) { | |||
client, err := w.getChannelClient(channelId, signer) | |||
func (w *rpcWrapper) SubscribeEvent(subInfo *eventsapi.SubscriptionInfo, since uint64) (fab.Registration, <-chan *fab.BlockEvent, <-chan *fab.CCEvent, *event.Client, error) { |
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 is a lot of return values. To avoid accidentally getting the order of them mixed up, should we return a struct here with named fields? Maybe my suggestion is too "object oriented" but just a thought.
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.
it's a fair question and something that came across my mind as well, decided to go with this given that each value is of a different type so apart from the cosmetics there's no danger with returning the values out of order by accident
Note: remaining issue #40 to be addressed separately