Skip to content

Commit 59b86b7

Browse files
committed
[FAB-7236] peer chaincode list installed requires chid
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 <wtlahti@us.ibm.com>
1 parent 446bf75 commit 59b86b7

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

Diff for: peer/chaincode/list.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func listCmd(cf *ChaincodeCmdFactory) *cobra.Command {
4848
}
4949

5050
func getChaincodes(cmd *cobra.Command, cf *ChaincodeCmdFactory) error {
51-
if channelID == "" {
51+
if getInstantiatedChaincodes && channelID == "" {
5252
return errors.New("The required parameter 'channelID' is empty. Rerun the command with -C flag")
5353
}
5454
var err error

Diff for: peer/chaincode/list_test.go

-5
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ func TestChaincodeListCmd(t *testing.T) {
5959

6060
args := []string{"--installed"}
6161
installedChaincodesCmd.SetArgs(args)
62-
err = installedChaincodesCmd.Execute()
63-
assert.Error(t, err, "Run chaincode list cmd to get installed chaincodes should fail if invoked without -C flag")
64-
65-
args = []string{"--installed", "-C", "mychannel"}
66-
installedChaincodesCmd.SetArgs(args)
6762
if err := installedChaincodesCmd.Execute(); err != nil {
6863
t.Errorf("Run chaincode list cmd to get installed chaincodes error:%v", err)
6964
}

0 commit comments

Comments
 (0)