Skip to content

Commit

Permalink
[FAB-3614] Add chaincode name checking
Browse files Browse the repository at this point in the history
Add chaincode name checking in chaincodeInstall, with existing path and
version checking.

Currently, the checking is statically written in hard-code.

Futhermore, we may need more checking with other params in future.

Change-Id: I4372dd6e05aafecb96bffcf06894d0fc039163cc
Signed-off-by: Baohua Yang <[email protected]>
  • Loading branch information
yeasy committed May 3, 2017
1 parent d6fbfcf commit fe4ef55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions peer/chaincode/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ func chaincodeInstall(cmd *cobra.Command, ccpackfile string, cf *ChaincodeCmdFac

var ccpackmsg proto.Message
if ccpackfile == "" {
if chaincodePath == common.UndefinedParamValue || chaincodeVersion == common.UndefinedParamValue {
return fmt.Errorf("Must supply value for %s path and version parameters.", chainFuncName)
if chaincodePath == common.UndefinedParamValue || chaincodeVersion == common.UndefinedParamValue || chaincodeName == common.UndefinedParamValue {
return fmt.Errorf("Must supply value for %s name, path and version parameters.", chainFuncName)
}
//generate a raw ChaincodeDeploymentSpec
ccpackmsg, err = generateChaincode(cmd, chaincodeName, chaincodeVersion)
Expand Down

0 comments on commit fe4ef55

Please sign in to comment.