Skip to content

Commit fe4ef55

Browse files
committed
[FAB-3614] Add chaincode name checking
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]>
1 parent d6fbfcf commit fe4ef55

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

peer/chaincode/install.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ func chaincodeInstall(cmd *cobra.Command, ccpackfile string, cf *ChaincodeCmdFac
164164

165165
var ccpackmsg proto.Message
166166
if ccpackfile == "" {
167-
if chaincodePath == common.UndefinedParamValue || chaincodeVersion == common.UndefinedParamValue {
168-
return fmt.Errorf("Must supply value for %s path and version parameters.", chainFuncName)
167+
if chaincodePath == common.UndefinedParamValue || chaincodeVersion == common.UndefinedParamValue || chaincodeName == common.UndefinedParamValue {
168+
return fmt.Errorf("Must supply value for %s name, path and version parameters.", chainFuncName)
169169
}
170170
//generate a raw ChaincodeDeploymentSpec
171171
ccpackmsg, err = generateChaincode(cmd, chaincodeName, chaincodeVersion)

0 commit comments

Comments
 (0)