diff --git a/examples/chaincode/go/passthru/passthru.go b/examples/chaincode/go/passthru/passthru.go index 52750d79fd2..49d978bf428 100644 --- a/examples/chaincode/go/passthru/passthru.go +++ b/examples/chaincode/go/passthru/passthru.go @@ -20,7 +20,6 @@ import ( "fmt" "strings" - "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/chaincode/shim" pb "github.com/hyperledger/fabric/protos/peer" ) @@ -32,6 +31,14 @@ import ( type PassthruChaincode struct { } +func toChaincodeArgs(args ...string) [][]byte { + bargs := make([][]byte, len(args)) + for i, arg := range args { + bargs[i] = []byte(arg) + } + return bargs +} + //Init func will return error if function has string "error" anywhere func (p *PassthruChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { function, _ := stub.GetFunctionAndParameters() @@ -48,7 +55,7 @@ func (p *PassthruChaincode) iq(stub shim.ChaincodeStubInterface, function string } chaincodeID := function - return stub.InvokeChaincode(chaincodeID, util.ToChaincodeArgs(args...), "") + return stub.InvokeChaincode(chaincodeID, toChaincodeArgs(args...), "") } // Invoke passes through the invoke call