From f5278157ac412ba006d7fc2a9cc995ad7189cb00 Mon Sep 17 00:00:00 2001 From: David Enyeart Date: Tue, 9 Apr 2019 05:42:08 -0400 Subject: [PATCH] [FAB-15119] Fix BYFN with Java chaincode The issue is that BYFN passes "Init" function while the sample Java chaincode checks for "init" function. Within the init function, there is no need to check the function argument that is passed in. The sample Go chaincode and Node.js chaincode do not check the function argument. This change makes sample Java chaincode behave the same way. Change-Id: I802978e1276e92a3d420b3f4a391ff66a352d321 Signed-off-by: David Enyeart --- .../src/main/java/org/hyperledger/fabric-samples/ABstore.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/chaincode/abstore/java/src/main/java/org/hyperledger/fabric-samples/ABstore.java b/chaincode/abstore/java/src/main/java/org/hyperledger/fabric-samples/ABstore.java index e7cfd3d135..39ae6db4cc 100644 --- a/chaincode/abstore/java/src/main/java/org/hyperledger/fabric-samples/ABstore.java +++ b/chaincode/abstore/java/src/main/java/org/hyperledger/fabric-samples/ABstore.java @@ -24,10 +24,6 @@ public class ABstore extends ChaincodeBase { public Response init(ChaincodeStub stub) { try { _logger.info("Init java simple chaincode"); - String func = stub.getFunction(); - if (!func.equals("init")) { - return newErrorResponse("function other than init is not supported"); - } List args = stub.getParameters(); if (args.size() != 4) { newErrorResponse("Incorrect number of arguments. Expecting 4");