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

Implement chaincode event replay for Fabric Gateway #2896

Merged
merged 2 commits into from Sep 7, 2021

Conversation

bestbeforetoday
Copy link
Member

@bestbeforetoday bestbeforetoday commented Sep 6, 2021

Resolves #2792

@bestbeforetoday bestbeforetoday force-pushed the issue2792-2 branch 2 times, most recently from d1507f6 to fbfec62 Compare September 7, 2021 08:39
@bestbeforetoday bestbeforetoday changed the title Implement chaincode event replay for Fabric Gateway WIP: Implement chaincode event replay for Fabric Gateway Sep 7, 2021
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
@bestbeforetoday bestbeforetoday changed the title WIP: Implement chaincode event replay for Fabric Gateway Implement chaincode event replay for Fabric Gateway Sep 7, 2021
@bestbeforetoday bestbeforetoday marked this pull request as ready for review September 7, 2021 09:52
@bestbeforetoday bestbeforetoday requested a review from a team as a code owner September 7, 2021 09:52
if err != nil {
return status.Error(codes.Unavailable, err.Error())
var startBlock uint64
switch seek := request.StartPosition.Type.(type) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If StartPosition hasn't been specified in the request proto, then this will barf. Should we default to NextCommit in this case?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like you've done in the unit test :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I tried this and the protobuf unmarshalling failed because a oneof field wasn't defined in the message

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having said that... the Golang protobuf docs have an example of switching on a oneof with nil as a possible value, so let me try that again

https://developers.google.com/protocol-buffers/docs/reference/go-generated#oneof

Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
@andrew-coleman andrew-coleman merged commit beb8f5d into hyperledger:main Sep 7, 2021
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.

Contract event listening - replay
2 participants