From 9131eae9c8b81ad292ab81ca9f4f89faf7062ac8 Mon Sep 17 00:00:00 2001 From: Bob Stasyszyn Date: Fri, 21 Aug 2020 17:28:27 -0400 Subject: [PATCH] chore: Save CC invoke response closes #97 Signed-off-by: Bob Stasyszyn --- bddtests/common_steps.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bddtests/common_steps.go b/bddtests/common_steps.go index 7259954..29a1b98 100644 --- a/bddtests/common_steps.go +++ b/bddtests/common_steps.go @@ -376,8 +376,7 @@ func (d *CommonSteps) invokeCCWithArgs(ccID, channelID, clientOrgID string, targ return channel.Response{}, fmt.Errorf("Failed to create new channel client: %s", err) } - retryOpts := retry.DefaultOpts - retryOpts.RetryableCodes = retry.ChannelClientRetryableCodes + retryOpts := retry.DefaultChannelOpts for _, code := range ccCodesForRetry { addRetryCode(retryOpts.RetryableCodes, status.ChaincodeStatus, status.Code(code)) @@ -396,6 +395,9 @@ func (d *CommonSteps) invokeCCWithArgs(ccID, channelID, clientOrgID string, targ if err != nil { return channel.Response{}, fmt.Errorf("InvokeChaincode return error: %s", err) } + + queryValue = string(response.Payload) + return response, nil } @@ -638,7 +640,7 @@ func (d *CommonSteps) QueryCCWithOpts(systemCC bool, ccID, channelID, clientOrgI return "", errors.Wrap(err, "Failed to create new channel client") } - retryOpts := retry.DefaultOpts + retryOpts := retry.DefaultChannelOpts retryOpts.RetryableCodes = retry.ChannelClientRetryableCodes for _, code := range ccCodesForRetry {