Skip to content

Commit

Permalink
Merge "[FAB-5287] NodeSDK - fix sample"
Browse files Browse the repository at this point in the history
  • Loading branch information
christo4ferris authored and Gerrit Code Review committed Jul 17, 2017
2 parents 0611471 + e0db341 commit d9e2d5c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion balance-transfer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ curl -s -X POST \
"peers": ["localhost:7051"],
"chaincodeName":"mycc",
"chaincodeVersion":"v0",
"functionName":"init",
"fcn":"init",
"args":["a","100","b","200"]
}'
```
Expand Down
10 changes: 5 additions & 5 deletions balance-transfer/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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\''));
Expand All @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion balance-transfer/testAPIs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ curl -s -X POST \
-d '{
"chaincodeName":"mycc",
"chaincodeVersion":"v0",
"functionName":"init",
"fcn":"init",
"args":["a","100","b","200"]
}'
echo
Expand Down

0 comments on commit d9e2d5c

Please sign in to comment.