@@ -43,6 +43,11 @@ import (
43
43
"github.com/stretchr/testify/assert"
44
44
)
45
45
46
+ func signedByAnyMember (ids []string ) []byte {
47
+ p := cauthdsl .SignedByAnyMember (ids )
48
+ return utils .MarshalOrPanic (p )
49
+ }
50
+
46
51
func setupLedgerAndValidator (t * testing.T ) (ledger.PeerLedger , Validator ) {
47
52
viper .Set ("peer.fileSystemPath" , "/tmp/fabric/validatortest" )
48
53
ledgermgmt .InitializeTestEnv ()
@@ -193,7 +198,7 @@ func TestInvokeOK(t *testing.T) {
193
198
194
199
ccID := "mycc"
195
200
196
- putCCInfo (l , ccID , cauthdsl . SignedByAnyMember ([]string {"DEFAULT" }), t )
201
+ putCCInfo (l , ccID , signedByAnyMember ([]string {"DEFAULT" }), t )
197
202
198
203
tx := getEnv (ccID , createRWset (t , ccID ), t )
199
204
b := & common.Block {Data : & common.BlockData {Data : [][]byte {utils .MarshalOrPanic (tx )}}}
@@ -210,7 +215,7 @@ func TestInvokeOKSCC(t *testing.T) {
210
215
211
216
ccID := "lscc"
212
217
213
- putCCInfo (l , ccID , cauthdsl . SignedByAnyMember ([]string {"DEFAULT" }), t )
218
+ putCCInfo (l , ccID , signedByAnyMember ([]string {"DEFAULT" }), t )
214
219
215
220
tx := getEnv (ccID , createRWset (t , ccID ), t )
216
221
b := & common.Block {Data : & common.BlockData {Data : [][]byte {utils .MarshalOrPanic (tx )}}}
@@ -227,7 +232,7 @@ func TestInvokeNOKWritesToLSCC(t *testing.T) {
227
232
228
233
ccID := "mycc"
229
234
230
- putCCInfo (l , ccID , cauthdsl . SignedByAnyMember ([]string {"DEFAULT" }), t )
235
+ putCCInfo (l , ccID , signedByAnyMember ([]string {"DEFAULT" }), t )
231
236
232
237
tx := getEnv (ccID , createRWset (t , ccID , "lscc" ), t )
233
238
b := & common.Block {Data : & common.BlockData {Data : [][]byte {utils .MarshalOrPanic (tx )}}}
@@ -244,7 +249,7 @@ func TestInvokeNOKWritesToESCC(t *testing.T) {
244
249
245
250
ccID := "mycc"
246
251
247
- putCCInfo (l , ccID , cauthdsl . SignedByAnyMember ([]string {"DEFAULT" }), t )
252
+ putCCInfo (l , ccID , signedByAnyMember ([]string {"DEFAULT" }), t )
248
253
249
254
tx := getEnv (ccID , createRWset (t , ccID , "escc" ), t )
250
255
b := & common.Block {Data : & common.BlockData {Data : [][]byte {utils .MarshalOrPanic (tx )}}}
@@ -261,7 +266,7 @@ func TestInvokeNOKWritesToNotExt(t *testing.T) {
261
266
262
267
ccID := "mycc"
263
268
264
- putCCInfo (l , ccID , cauthdsl . SignedByAnyMember ([]string {"DEFAULT" }), t )
269
+ putCCInfo (l , ccID , signedByAnyMember ([]string {"DEFAULT" }), t )
265
270
266
271
tx := getEnv (ccID , createRWset (t , ccID , "notext" ), t )
267
272
b := & common.Block {Data : & common.BlockData {Data : [][]byte {utils .MarshalOrPanic (tx )}}}
@@ -278,7 +283,7 @@ func TestInvokeNOKInvokesNotExt(t *testing.T) {
278
283
279
284
ccID := "notext"
280
285
281
- putCCInfo (l , ccID , cauthdsl . SignedByAnyMember ([]string {"DEFAULT" }), t )
286
+ putCCInfo (l , ccID , signedByAnyMember ([]string {"DEFAULT" }), t )
282
287
283
288
tx := getEnv (ccID , createRWset (t , ccID ), t )
284
289
b := & common.Block {Data : & common.BlockData {Data : [][]byte {utils .MarshalOrPanic (tx )}}}
@@ -295,7 +300,7 @@ func TestInvokeNOKInvokesEmptyCCName(t *testing.T) {
295
300
296
301
ccID := ""
297
302
298
- putCCInfo (l , ccID , cauthdsl . SignedByAnyMember ([]string {"DEFAULT" }), t )
303
+ putCCInfo (l , ccID , signedByAnyMember ([]string {"DEFAULT" }), t )
299
304
300
305
tx := getEnv (ccID , createRWset (t , ccID ), t )
301
306
b := & common.Block {Data : & common.BlockData {Data : [][]byte {utils .MarshalOrPanic (tx )}}}
@@ -312,7 +317,7 @@ func TestInvokeNOKExpiredCC(t *testing.T) {
312
317
313
318
ccID := "mycc"
314
319
315
- putCCInfoWithVSCCAndVer (l , ccID , "vscc" , "badversion" , cauthdsl . SignedByAnyMember ([]string {"DEFAULT" }), t )
320
+ putCCInfoWithVSCCAndVer (l , ccID , "vscc" , "badversion" , signedByAnyMember ([]string {"DEFAULT" }), t )
316
321
317
322
tx := getEnv (ccID , createRWset (t , ccID ), t )
318
323
b := & common.Block {Data : & common.BlockData {Data : [][]byte {utils .MarshalOrPanic (tx )}}}
@@ -329,7 +334,7 @@ func TestInvokeNOKBogusActions(t *testing.T) {
329
334
330
335
ccID := "mycc"
331
336
332
- putCCInfo (l , ccID , cauthdsl . SignedByAnyMember ([]string {"DEFAULT" }), t )
337
+ putCCInfo (l , ccID , signedByAnyMember ([]string {"DEFAULT" }), t )
333
338
334
339
tx := getEnv (ccID , []byte ("barf" ), t )
335
340
b := & common.Block {Data : & common.BlockData {Data : [][]byte {utils .MarshalOrPanic (tx )}}}
@@ -361,7 +366,7 @@ func TestInvokeNOKVSCCUnspecified(t *testing.T) {
361
366
362
367
ccID := "mycc"
363
368
364
- putCCInfoWithVSCCAndVer (l , ccID , "" , ccVersion , cauthdsl . SignedByAnyMember ([]string {"DEFAULT" }), t )
369
+ putCCInfoWithVSCCAndVer (l , ccID , "" , ccVersion , signedByAnyMember ([]string {"DEFAULT" }), t )
365
370
366
371
tx := getEnv (ccID , createRWset (t , ccID ), t )
367
372
b := & common.Block {Data : & common.BlockData {Data : [][]byte {utils .MarshalOrPanic (tx )}}}
0 commit comments