Skip to content
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

Merged
merged 4 commits into from
Sep 2, 2021

Conversation

jimthematrix
Copy link
Contributor

Note: remaining issue #40 to be addressed separately

Signed-off-by: Jim Zhang <jim.zhang@kaleido.io>
@codecov-commenter
Copy link

codecov-commenter commented Aug 26, 2021

Codecov Report

Merging #41 (45c35ac) into main (685ebb2) will increase coverage by 24.61%.
The diff coverage is 0.00%.

❗ Current head 45c35ac differs from pull request most recent head 549008e. Consider uploading reports for the commit 549008e to get more accurate results
Impacted file tree graph

@@             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               
Impacted Files Coverage Δ
internal/events/api/event.go 0.00% <0.00%> (ø)
internal/events/api/timesorted.go 100.00% <ø> (ø)
internal/rest/async/asyncdispatcher.go 26.53% <0.00%> (-0.56%) ⬇️
internal/events/websockets.go
internal/events/webhooks.go

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 685ebb2...549008e. Read the comment docs.

Signed-off-by: Jim Zhang <jim.zhang@kaleido.io>
Signed-off-by: Jim Zhang <jim.zhang@kaleido.io>
Signed-off-by: Jim Zhang <jim.zhang@kaleido.io>
@@ -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) {
Copy link
Contributor

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.

Copy link
Contributor Author

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

@jimthematrix jimthematrix merged commit 4c6c064 into hyperledger:main Sep 2, 2021
@jimthematrix jimthematrix deleted the event-data branch September 2, 2021 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Event filtering Event payload unmarshaling
3 participants