@@ -28,7 +28,6 @@ import (
2828
2929 "path/filepath"
3030
31- "github.com/hyperledger/fabric/core/chaincode/shim"
3231 "github.com/hyperledger/fabric/core/container"
3332 "github.com/hyperledger/fabric/core/container/ccintf"
3433 "github.com/hyperledger/fabric/core/crypto"
@@ -339,7 +338,7 @@ func executeDeployTransaction(t *testing.T, url string) {
339338 var ctxt = context .Background ()
340339
341340 f := "init"
342- args := shim .ToChaincodeArgs (f , "a" , "100" , "b" , "200" )
341+ args := util .ToChaincodeArgs (f , "a" , "100" , "b" , "200" )
343342 spec := & pb.ChaincodeSpec {Type : 1 , ChaincodeID : & pb.ChaincodeID {Path : url }, CtorMsg : & pb.ChaincodeInput {Args : args }}
344343 _ , err = deploy (ctxt , spec )
345344 chaincodeID := spec .ChaincodeID .Name
@@ -426,7 +425,7 @@ func checkFinalState(uuid string, chaincodeID string) error {
426425func invokeExample02Transaction (ctxt context.Context , cID * pb.ChaincodeID , args []string , destroyImage bool ) error {
427426
428427 f := "init"
429- argsDeploy := shim .ToChaincodeArgs (f , "a" , "100" , "b" , "200" )
428+ argsDeploy := util .ToChaincodeArgs (f , "a" , "100" , "b" , "200" )
430429 spec := & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID , CtorMsg : & pb.ChaincodeInput {Args : argsDeploy }}
431430 _ , err := deploy (ctxt , spec )
432431 chaincodeID := spec .ChaincodeID .Name
@@ -449,7 +448,7 @@ func invokeExample02Transaction(ctxt context.Context, cID *pb.ChaincodeID, args
449448
450449 f = "invoke"
451450 invokeArgs := append ([]string {f }, args ... )
452- spec = & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID , CtorMsg : & pb.ChaincodeInput {Args : shim .ToChaincodeArgs (invokeArgs ... )}}
451+ spec = & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID , CtorMsg : & pb.ChaincodeInput {Args : util .ToChaincodeArgs (invokeArgs ... )}}
453452 _ , uuid , _ , err := invoke (ctxt , spec , pb .Transaction_CHAINCODE_INVOKE )
454453 if err != nil {
455454 return fmt .Errorf ("Error invoking <%s>: %s" , chaincodeID , err )
@@ -462,7 +461,7 @@ func invokeExample02Transaction(ctxt context.Context, cID *pb.ChaincodeID, args
462461
463462 // Test for delete state
464463 f = "delete"
465- delArgs := shim .ToChaincodeArgs (f , "a" )
464+ delArgs := util .ToChaincodeArgs (f , "a" )
466465 spec = & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID , CtorMsg : & pb.ChaincodeInput {Args : delArgs }}
467466 _ , uuid , _ , err = invoke (ctxt , spec , pb .Transaction_CHAINCODE_INVOKE )
468467 if err != nil {
@@ -542,12 +541,12 @@ func exec(ctxt context.Context, chaincodeID string, numTrans int, numQueries int
542541 var spec * pb.ChaincodeSpec
543542 if typ == pb .Transaction_CHAINCODE_INVOKE {
544543 f := "invoke"
545- args := shim .ToChaincodeArgs (f , "a" , "b" , "10" )
544+ args := util .ToChaincodeArgs (f , "a" , "b" , "10" )
546545
547546 spec = & pb.ChaincodeSpec {Type : 1 , ChaincodeID : & pb.ChaincodeID {Name : chaincodeID }, CtorMsg : & pb.ChaincodeInput {Args : args }}
548547 } else {
549548 f := "query"
550- args := shim .ToChaincodeArgs (f , "a" )
549+ args := util .ToChaincodeArgs (f , "a" )
551550
552551 spec = & pb.ChaincodeSpec {Type : 1 , ChaincodeID : & pb.ChaincodeID {Name : chaincodeID }, CtorMsg : & pb.ChaincodeInput {Args : args }}
553552 }
@@ -617,7 +616,7 @@ func TestExecuteQuery(t *testing.T) {
617616
618617 cID := & pb.ChaincodeID {Path : url }
619618 f := "init"
620- args := shim .ToChaincodeArgs (f , "a" , "100" , "b" , "200" )
619+ args := util .ToChaincodeArgs (f , "a" , "100" , "b" , "200" )
621620
622621 spec := & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID , CtorMsg : & pb.ChaincodeInput {Args : args }}
623622
@@ -763,7 +762,7 @@ func TestExecuteInvalidQuery(t *testing.T) {
763762
764763 cID := & pb.ChaincodeID {Path : url }
765764 f := "init"
766- args := shim .ToChaincodeArgs (f , "a" , "100" )
765+ args := util .ToChaincodeArgs (f , "a" , "100" )
767766
768767 spec := & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID , CtorMsg : & pb.ChaincodeInput {Args : args }}
769768
@@ -780,7 +779,7 @@ func TestExecuteInvalidQuery(t *testing.T) {
780779 time .Sleep (time .Second )
781780
782781 f = "query"
783- args = shim .ToChaincodeArgs (f , "b" , "200" )
782+ args = util .ToChaincodeArgs (f , "b" , "200" )
784783
785784 spec = & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID , CtorMsg : & pb.ChaincodeInput {Args : args }}
786785 // This query should fail as it attempts to put state
@@ -837,7 +836,7 @@ func TestChaincodeInvokeChaincode(t *testing.T) {
837836
838837 cID1 := & pb.ChaincodeID {Path : url1 }
839838 f := "init"
840- args := shim .ToChaincodeArgs (f , "a" , "100" , "b" , "200" )
839+ args := util .ToChaincodeArgs (f , "a" , "100" , "b" , "200" )
841840
842841 spec1 := & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID1 , CtorMsg : & pb.ChaincodeInput {Args : args }}
843842
@@ -860,7 +859,7 @@ func TestChaincodeInvokeChaincode(t *testing.T) {
860859
861860 cID2 := & pb.ChaincodeID {Path : url2 }
862861 f = "init"
863- args = shim .ToChaincodeArgs (f , "e" , "0" )
862+ args = util .ToChaincodeArgs (f , "e" , "0" )
864863
865864 spec2 := & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID2 , CtorMsg : & pb.ChaincodeInput {Args : args }}
866865
@@ -879,7 +878,7 @@ func TestChaincodeInvokeChaincode(t *testing.T) {
879878
880879 // Invoke second chaincode, which will inturn invoke the first chaincode
881880 f = "invoke"
882- args = shim .ToChaincodeArgs (f , "e" , "1" )
881+ args = util .ToChaincodeArgs (f , "e" , "1" )
883882
884883 spec2 = & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID2 , CtorMsg : & pb.ChaincodeInput {Args : args }}
885884 // Invoke chaincode
@@ -953,7 +952,7 @@ func TestChaincodeInvokeChaincodeErrorCase(t *testing.T) {
953952
954953 cID1 := & pb.ChaincodeID {Path : url1 }
955954 f := "init"
956- args := shim .ToChaincodeArgs (f , "a" , "100" , "b" , "200" )
955+ args := util .ToChaincodeArgs (f , "a" , "100" , "b" , "200" )
957956
958957 spec1 := & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID1 , CtorMsg : & pb.ChaincodeInput {Args : args }}
959958
@@ -974,7 +973,7 @@ func TestChaincodeInvokeChaincodeErrorCase(t *testing.T) {
974973
975974 cID2 := & pb.ChaincodeID {Path : url2 }
976975 f = "init"
977- args = shim .ToChaincodeArgs (f )
976+ args = util .ToChaincodeArgs (f )
978977
979978 spec2 := & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID2 , CtorMsg : & pb.ChaincodeInput {Args : args }}
980979
@@ -993,7 +992,7 @@ func TestChaincodeInvokeChaincodeErrorCase(t *testing.T) {
993992
994993 // Invoke second chaincode, which will inturn invoke the first chaincode but pass bad params
995994 f = chaincodeID1
996- args = shim .ToChaincodeArgs (f , "invoke" , "a" )
995+ args = util .ToChaincodeArgs (f , "invoke" , "a" )
997996
998997 spec2 = & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID2 , CtorMsg : & pb.ChaincodeInput {Args : args }}
999998 // Invoke chaincode
@@ -1030,7 +1029,7 @@ func chaincodeQueryChaincode(user string) error {
10301029
10311030 cID1 := & pb.ChaincodeID {Path : url1 }
10321031 f := "init"
1033- args := shim .ToChaincodeArgs (f , "a" , "100" , "b" , "200" )
1032+ args := util .ToChaincodeArgs (f , "a" , "100" , "b" , "200" )
10341033
10351034 spec1 := & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID1 , CtorMsg : & pb.ChaincodeInput {Args : args }, SecureContext : user }
10361035
@@ -1048,7 +1047,7 @@ func chaincodeQueryChaincode(user string) error {
10481047
10491048 cID2 := & pb.ChaincodeID {Path : url2 }
10501049 f = "init"
1051- args = shim .ToChaincodeArgs (f , "sum" , "0" )
1050+ args = util .ToChaincodeArgs (f , "sum" , "0" )
10521051
10531052 spec2 := & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID2 , CtorMsg : & pb.ChaincodeInput {Args : args }, SecureContext : user }
10541053
@@ -1064,7 +1063,7 @@ func chaincodeQueryChaincode(user string) error {
10641063
10651064 // Invoke second chaincode, which will inturn query the first chaincode
10661065 f = "invoke"
1067- args = shim .ToChaincodeArgs (f , chaincodeID1 , "sum" )
1066+ args = util .ToChaincodeArgs (f , chaincodeID1 , "sum" )
10681067
10691068 spec2 = & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID2 , CtorMsg : & pb.ChaincodeInput {Args : args }, SecureContext : user }
10701069 // Invoke chaincode
@@ -1087,7 +1086,7 @@ func chaincodeQueryChaincode(user string) error {
10871086
10881087 // Query second chaincode, which will inturn query the first chaincode
10891088 f = "query"
1090- args = shim .ToChaincodeArgs (f , chaincodeID1 , "sum" )
1089+ args = util .ToChaincodeArgs (f , chaincodeID1 , "sum" )
10911090
10921091 spec2 = & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID2 , CtorMsg : & pb.ChaincodeInput {Args : args }, SecureContext : user }
10931092 // Invoke chaincode
@@ -1176,7 +1175,7 @@ func TestChaincodeQueryChaincodeErrorCase(t *testing.T) {
11761175
11771176 cID1 := & pb.ChaincodeID {Path : url1 }
11781177 f := "init"
1179- args := shim .ToChaincodeArgs (f , "a" , "100" , "b" , "200" )
1178+ args := util .ToChaincodeArgs (f , "a" , "100" , "b" , "200" )
11801179
11811180 spec1 := & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID1 , CtorMsg : & pb.ChaincodeInput {Args : args }}
11821181
@@ -1197,7 +1196,7 @@ func TestChaincodeQueryChaincodeErrorCase(t *testing.T) {
11971196
11981197 cID2 := & pb.ChaincodeID {Path : url2 }
11991198 f = "init"
1200- args = shim .ToChaincodeArgs (f )
1199+ args = util .ToChaincodeArgs (f )
12011200
12021201 spec2 := & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID2 , CtorMsg : & pb.ChaincodeInput {Args : args }}
12031202
@@ -1216,7 +1215,7 @@ func TestChaincodeQueryChaincodeErrorCase(t *testing.T) {
12161215
12171216 // Invoke second chaincode, which will inturn invoke the first chaincode but pass bad params
12181217 f = chaincodeID1
1219- args = shim .ToChaincodeArgs (f , "query" , "c" )
1218+ args = util .ToChaincodeArgs (f , "query" , "c" )
12201219
12211220 spec2 = & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID2 , CtorMsg : & pb.ChaincodeInput {Args : args }}
12221221 // Invoke chaincode
@@ -1340,7 +1339,7 @@ func TestRangeQuery(t *testing.T) {
13401339 cID := & pb.ChaincodeID {Path : url }
13411340
13421341 f := "init"
1343- args := shim .ToChaincodeArgs (f )
1342+ args := util .ToChaincodeArgs (f )
13441343
13451344 spec := & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID , CtorMsg : & pb.ChaincodeInput {Args : args }}
13461345
@@ -1356,7 +1355,7 @@ func TestRangeQuery(t *testing.T) {
13561355
13571356 // Invoke second chaincode, which will inturn invoke the first chaincode
13581357 f = "keys"
1359- args = shim .ToChaincodeArgs (f )
1358+ args = util .ToChaincodeArgs (f )
13601359
13611360 spec = & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID , CtorMsg : & pb.ChaincodeInput {Args : args }}
13621361 _ , _ , _ , err = invoke (ctxt , spec , pb .Transaction_CHAINCODE_QUERY )
@@ -1411,7 +1410,7 @@ func TestGetEvent(t *testing.T) {
14111410
14121411 cID := & pb.ChaincodeID {Path : url }
14131412 f := "init"
1414- spec := & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID , CtorMsg : & pb.ChaincodeInput {Args : shim .ToChaincodeArgs (f )}}
1413+ spec := & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID , CtorMsg : & pb.ChaincodeInput {Args : util .ToChaincodeArgs (f )}}
14151414
14161415 _ , err = deploy (ctxt , spec )
14171416 chaincodeID := spec .ChaincodeID .Name
@@ -1425,7 +1424,7 @@ func TestGetEvent(t *testing.T) {
14251424
14261425 time .Sleep (time .Second )
14271426
1428- args := shim .ToChaincodeArgs ("" , "i" , "am" , "satoshi" )
1427+ args := util .ToChaincodeArgs ("" , "i" , "am" , "satoshi" )
14291428
14301429 spec = & pb.ChaincodeSpec {Type : 1 , ChaincodeID : cID , CtorMsg : & pb.ChaincodeInput {Args : args }}
14311430
0 commit comments