diff --git a/examples/chaincode/go/chaincode_example02/chaincode_example02.go b/examples/chaincode/go/chaincode_example02/chaincode_example02.go index 7dc64d0e5c0..8006de6a4bd 100644 --- a/examples/chaincode/go/chaincode_example02/chaincode_example02.go +++ b/examples/chaincode/go/chaincode_example02/chaincode_example02.go @@ -111,6 +111,9 @@ func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function stri // Perform the execution X, err = strconv.Atoi(args[2]) + if err != nil { + return nil, errors.New("Invalid transaction amount, expecting a integer value") + } Aval = Aval - X Bval = Bval + X fmt.Printf("Aval = %d, Bval = %d\n", Aval, Bval) diff --git a/examples/chaincode/go/chaincode_example04/chaincode_example04.go b/examples/chaincode/go/chaincode_example04/chaincode_example04.go index 3cc08510ea1..7a2d5bca589 100644 --- a/examples/chaincode/go/chaincode_example04/chaincode_example04.go +++ b/examples/chaincode/go/chaincode_example04/chaincode_example04.go @@ -34,7 +34,7 @@ type SimpleChaincode struct { func (t *SimpleChaincode) GetChaincodeToCall() string { //This is the hashcode for github.com/hyperledger/fabric/core/example/chaincode/chaincode_example02 //if the example is modifed this hashcode will change!! - chainCodeToCall := "980d4bb7f69578592e5775a6da86d81a221887817d7164d3e9d4d4df1c981440abf9a61417eaf8ad6f7fc79893da36de2cf4709131e9af39bca6ebc2e5a1cd9d" + chainCodeToCall := "ee5b24a1f17c356dd5f6e37307922e39ddba12e5d2e203ed93401d7d05eb0dd194fb9070549c5dc31eb63f4e654dbd5a1d86cbb30c48e3ab1812590cd0f78539" return chainCodeToCall }