From e0db341af9981eedeb66e6a35cc8fca174fc880d Mon Sep 17 00:00:00 2001 From: Bret Harrison Date: Thu, 13 Jul 2017 16:09:51 -0400 Subject: [PATCH] [FAB-5287] NodeSDK - fix sample Sample should use 'fcn' not 'functionName' in the sample curl calls and sample app. Change-Id: I4be92a0394fdf579195e9566d049aac0862d5888 Signed-off-by: Bret Harrison --- balance-transfer/README.md | 2 +- balance-transfer/app.js | 10 +++++----- balance-transfer/testAPIs.sh | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/balance-transfer/README.md b/balance-transfer/README.md index 6fcf23ab6d..05fe0c2887 100644 --- a/balance-transfer/README.md +++ b/balance-transfer/README.md @@ -146,7 +146,7 @@ curl -s -X POST \ "peers": ["localhost:7051"], "chaincodeName":"mycc", "chaincodeVersion":"v0", - "functionName":"init", + "fcn":"init", "args":["a","100","b","200"] }' ``` diff --git a/balance-transfer/app.js b/balance-transfer/app.js index 52224f7499..a214eab6ea 100644 --- a/balance-transfer/app.js +++ b/balance-transfer/app.js @@ -216,12 +216,12 @@ app.post('/channels/:channelName/chaincodes', function(req, res) { var chaincodeName = req.body.chaincodeName; var chaincodeVersion = req.body.chaincodeVersion; var channelName = req.params.channelName; - var functionName = req.body.functionName; + var fcn = req.body.fcn; var args = req.body.args; logger.debug('channelName : ' + channelName); logger.debug('chaincodeName : ' + chaincodeName); logger.debug('chaincodeVersion : ' + chaincodeVersion); - logger.debug('functionName : ' + functionName); + logger.debug('fcn : ' + fcn); logger.debug('args : ' + args); if (!chaincodeName) { res.json(getErrorMessage('\'chaincodeName\'')); @@ -235,15 +235,15 @@ app.post('/channels/:channelName/chaincodes', function(req, res) { res.json(getErrorMessage('\'channelName\'')); return; } - if (!functionName) { - res.json(getErrorMessage('\'functionName\'')); + if (!fcn) { + res.json(getErrorMessage('\'fcn\'')); return; } if (!args) { res.json(getErrorMessage('\'args\'')); return; } - instantiate.instantiateChaincode(channelName, chaincodeName, chaincodeVersion, functionName, args, req.username, req.orgname) + instantiate.instantiateChaincode(channelName, chaincodeName, chaincodeVersion, fcn, args, req.username, req.orgname) .then(function(message) { res.send(message); }); diff --git a/balance-transfer/testAPIs.sh b/balance-transfer/testAPIs.sh index 737238f0f9..918c6e4482 100755 --- a/balance-transfer/testAPIs.sh +++ b/balance-transfer/testAPIs.sh @@ -113,7 +113,7 @@ curl -s -X POST \ -d '{ "chaincodeName":"mycc", "chaincodeVersion":"v0", - "functionName":"init", + "fcn":"init", "args":["a","100","b","200"] }' echo