Skip to content

Commit

Permalink
Merge "[FAB-7236] peer chaincode list installed requires chid"
Browse files Browse the repository at this point in the history
  • Loading branch information
yacovm authored and Gerrit Code Review committed Dec 11, 2017
2 parents b693731 + 59b86b7 commit 179f158
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion peer/chaincode/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func listCmd(cf *ChaincodeCmdFactory) *cobra.Command {
}

func getChaincodes(cmd *cobra.Command, cf *ChaincodeCmdFactory) error {
if channelID == "" {
if getInstantiatedChaincodes && channelID == "" {
return errors.New("The required parameter 'channelID' is empty. Rerun the command with -C flag")
}
var err error
Expand Down
5 changes: 0 additions & 5 deletions peer/chaincode/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ func TestChaincodeListCmd(t *testing.T) {

args := []string{"--installed"}
installedChaincodesCmd.SetArgs(args)
err = installedChaincodesCmd.Execute()
assert.Error(t, err, "Run chaincode list cmd to get installed chaincodes should fail if invoked without -C flag")

args = []string{"--installed", "-C", "mychannel"}
installedChaincodesCmd.SetArgs(args)
if err := installedChaincodesCmd.Execute(); err != nil {
t.Errorf("Run chaincode list cmd to get installed chaincodes error:%v", err)
}
Expand Down

0 comments on commit 179f158

Please sign in to comment.