-
Notifications
You must be signed in to change notification settings - Fork 506
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
Get proposal response payload from chaincode action #206
Conversation
Codecov Report
@@ Coverage Diff @@
## main #206 +/- ##
==========================================
+ Coverage 76.09% 76.11% +0.02%
==========================================
Files 193 193
Lines 14064 14078 +14
==========================================
+ Hits 10702 10716 +14
Misses 2393 2393
Partials 969 969
Continue to review full report at Codecov.
|
69d6d81
to
d452299
Compare
requestContext.Response.Payload = transactionProposalResponses[0].ProposalResponse.GetResponse().Payload | ||
responsePayload, err := getResultFromProposalResponse(transactionProposalResponses[0].ProposalResponse) | ||
if err != nil { | ||
requestContext.Error = err |
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.
Is just returning the error OK or does it need to be wrapped as an SDK status error? Errors really should never happen here as it would require the peer to send back a suitably malformed protobuf message
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.
@troyronda Can you confirm the desired behaviour (see comment above)?
@@ -63,7 +64,13 @@ func (e *EndorsementHandler) Handle(requestContext *RequestContext, clientContex | |||
|
|||
requestContext.Response.Responses = transactionProposalResponses | |||
if len(transactionProposalResponses) > 0 { | |||
requestContext.Response.Payload = transactionProposalResponses[0].ProposalResponse.GetResponse().Payload | |||
responsePayload, err := getResultFromProposalResponse(transactionProposalResponses[0].ProposalResponse) |
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.
Does this need to fallback to transactionProposalResponses[0].ProposalResponse.GetResponse().Payload
to deal with transaction error responses, or is that handled somewhere else? Passing all the tests so seems this is OK?
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.
@troyronda Can you confirm the desired behaviour (see comment above)?
6310b4e
to
6b522b1
Compare
This is the correct chaincode transaction response payload location. The response payload field is intended to contain metadata but the peer currently copies the transaction response payload here for convenience. This causes failures due to gRPC message size limits for large response payloads and so may be removed in the future. Also changed a few build scripts to honour the GO_CMD environment variable. Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
6b522b1
to
1c61898
Compare
This is the correct chaincode transaction response payload location. The response payload field is intended to contain metadata but the peer currently copies the transaction response payload here for convenience. This causes failures due to gRPC message size limits for large response payloads and so may be removed in the future.
Also changed a few build scripts to honour the GO_CMD environment variable.