Skip to content

Commit

Permalink
[FAB-7236] peer chaincode list installed requires chid
Browse files Browse the repository at this point in the history
This CR removes the requirement of supplying the channel parameter when
listing installed chaincodes via the peer CLI, which is not a
channel-scoped operation.

Change-Id: I038a5814d18c0f0b2b50a5f79e263d4298a7db5a
Signed-off-by: Will Lahti <[email protected]>
  • Loading branch information
wlahti committed Dec 11, 2017
1 parent 446bf75 commit 59b86b7
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 59b86b7

Please sign in to comment.