Skip to content

Commit

Permalink
Remove double decoding of event payload
Browse files Browse the repository at this point in the history
All events emitted from a subscription are processed based on a configurable
"payload type" (bytes, string, JSON). However, for events coming out of the
block decoder, they are always coerced to JSON upfront before even being
passed to the event decoder. This makes the behavior inconsistent for
subscriptions based on a particular chaincode vs. channel-wide subscriptions
based on the block decoder.

It seems cleaner to leave the payload as bytes in the block decoder, and to
only decode it into string or JSON in the event processor.

Signed-off-by: Andrew Richardson <[email protected]>
  • Loading branch information
awrichar committed Mar 8, 2023
1 parent fc749c3 commit 646d4a6
Show file tree
Hide file tree
Showing 5 changed files with 380 additions and 7 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8
github.com/golang/protobuf v1.5.2
github.com/golangci/golangci-lint v1.44.2 // indirect
github.com/google/certificate-transparency-go v1.1.1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.4.2
Expand Down
Loading

0 comments on commit 646d4a6

Please sign in to comment.