diff --git a/core/chaincode/exectransaction_test.go b/core/chaincode/exectransaction_test.go index ed86392a143..0bca0bc93f7 100644 --- a/core/chaincode/exectransaction_test.go +++ b/core/chaincode/exectransaction_test.go @@ -882,13 +882,11 @@ func chaincodeInvokeChaincode(t *testing.T, user string) (err error) { return } - t.Logf("deployed chaincode_example04 got cID2:% s,\n chaincodeID2:% s", cID2, chaincodeID2) - time.Sleep(time.Second) // Invoke second chaincode, which will inturn invoke the first chaincode f = "invoke" - args = util.ToChaincodeArgs(f, "e", "1", chaincodeID1) + args = util.ToChaincodeArgs(f, "e", "1") spec2 = &pb.ChaincodeSpec{Type: 1, ChaincodeID: cID2, CtorMsg: &pb.ChaincodeInput{Args: args}, SecureContext: user} // Invoke chaincode diff --git a/examples/chaincode/go/chaincode_example04/chaincode_example04.go b/examples/chaincode/go/chaincode_example04/chaincode_example04.go index a6b295d0e05..7a2d5bca589 100644 --- a/examples/chaincode/go/chaincode_example04/chaincode_example04.go +++ b/examples/chaincode/go/chaincode_example04/chaincode_example04.go @@ -70,8 +70,8 @@ func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function stri var eventVal int // State of event var err error - if len(args) != 3 { - return nil, errors.New("Incorrect number of arguments. Expecting 3") + if len(args) != 2 { + return nil, errors.New("Incorrect number of arguments. Expecting 2") } event = args[0] @@ -86,7 +86,7 @@ func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function stri } // Get the chaincode to call from the ledger - chainCodeToCall := args[2] //t.GetChaincodeToCall() + chainCodeToCall := t.GetChaincodeToCall() f := "invoke" invokeArgs := util.ToChaincodeArgs(f, "a", "b", "10") diff --git a/examples/chaincode/go/chaincode_example04/chaincode_example04_test.go b/examples/chaincode/go/chaincode_example04/chaincode_example04_test.go index 1ccef5575e0..b2658b2047c 100644 --- a/examples/chaincode/go/chaincode_example04/chaincode_example04_test.go +++ b/examples/chaincode/go/chaincode_example04/chaincode_example04_test.go @@ -104,13 +104,13 @@ func TestExample04_Invoke(t *testing.T) { checkInit(t, stub, []string{"Event", "1"}) // Invoke A->B for 10 via Example04's chaincode - checkInvoke(t, stub, []string{"Event", "1", scc.GetChaincodeToCall()}) + checkInvoke(t, stub, []string{"Event", "1"}) checkQuery(t, stub, "Event", eventResponse) checkQuery(t, stubEx2, "a", "101") checkQuery(t, stubEx2, "b", "232") // Invoke A->B for 10 via Example04's chaincode - checkInvoke(t, stub, []string{"Event", "1", scc.GetChaincodeToCall()}) + checkInvoke(t, stub, []string{"Event", "1"}) checkQuery(t, stub, "Event", eventResponse) checkQuery(t, stubEx2, "a", "91") checkQuery(t, stubEx2, "b", "242")