@@ -159,39 +159,21 @@ func TestCreateSignedTx(t *testing.T) {
159
159
})
160
160
prop .Header = headerBytes
161
161
162
- nonMatchingTests := []struct {
163
- responses []* pb.ProposalResponse
164
- expectedError string
165
- }{
166
- // good responses, but different payloads
167
- {
168
- []* pb.ProposalResponse {
169
- {Payload : []byte ("payload" ), Response : & pb.Response {Status : int32 (200 )}},
170
- {Payload : []byte ("payload2" ), Response : & pb.Response {Status : int32 (200 )}},
171
- },
172
- "ProposalResponsePayloads do not match" ,
173
- },
174
- // good response followed by bad response
175
- {
176
- []* pb.ProposalResponse {
177
- {Payload : []byte ("payload" ), Response : & pb.Response {Status : int32 (200 )}},
178
- {Payload : []byte {}, Response : & pb.Response {Status : int32 (500 ), Message : "failed to endorse" }},
179
- },
180
- "proposal response was not successful, error code 500, msg failed to endorse" ,
162
+ // non-matching responses
163
+ responses = []* pb.ProposalResponse {{
164
+ Payload : []byte ("payload" ),
165
+ Response : & pb.Response {
166
+ Status : int32 (200 ),
181
167
},
182
- // bad response followed by good response
183
- {
184
- []* pb.ProposalResponse {
185
- {Payload : []byte {}, Response : & pb.Response {Status : int32 (500 ), Message : "failed to endorse" }},
186
- {Payload : []byte ("payload" ), Response : & pb.Response {Status : int32 (200 )}},
187
- },
188
- "proposal response was not successful, error code 500, msg failed to endorse" ,
168
+ }}
169
+ responses = append (responses , & pb.ProposalResponse {
170
+ Payload : []byte ("payload2" ),
171
+ Response : & pb.Response {
172
+ Status : int32 (200 ),
189
173
},
190
- }
191
- for i , nonMatchingTest := range nonMatchingTests {
192
- _ , err = protoutil .CreateSignedTx (prop , signID , nonMatchingTest .responses ... )
193
- assert .EqualErrorf (t , err , nonMatchingTest .expectedError , "Expected non-matching response error '%v' for test %d" , nonMatchingTest .expectedError , i )
194
- }
174
+ })
175
+ _ , err = protoutil .CreateSignedTx (prop , signID , responses ... )
176
+ assert .Error (t , err , "Expected error with non-matching responses" )
195
177
196
178
// no endorsement
197
179
responses = []* pb.ProposalResponse {{
0 commit comments