Skip to content

Commit

Permalink
[FAB-17379] Fix print format for querycommitted
Browse files Browse the repository at this point in the history
This patch fixes the print format for `querycommitted` command
to improve the readability.

Signed-off-by: Tatsuya Sato <Tatsuya.Sato@hal.hitachi.com>
  • Loading branch information
satota2 authored and denyeart committed Jan 15, 2020
1 parent 3a66888 commit af66ef8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions internal/peer/lifecycle/chaincode/querycommitted.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ func (c *CommittedQuerier) printResponse(proposalResponse *pb.ProposalResponse)
for _, cd := range result.ChaincodeDefinitions {
fmt.Fprintf(c.Writer, "Name: %s, ", cd.Name)
c.printSingleChaincodeDefinition(cd)
fmt.Fprintf(c.Writer, "\n")
}
return nil
}
Expand Down
6 changes: 3 additions & 3 deletions internal/peer/lifecycle/chaincode/querycommitted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ var _ = Describe("QueryCommitted", func() {
It("queries committed chaincodes and writes the output as human readable plain-text", func() {
err := committedQuerier.Query()
Expect(err).NotTo(HaveOccurred())
Eventually(committedQuerier.Writer).Should(gbytes.Say("Committed chaincode definitions on channel 'test-channel'"))
Eventually(committedQuerier.Writer).Should(gbytes.Say("Name: woohoo, Version: a-version, Sequence: 93, Endorsement Plugin: e-plugin, Validation Plugin: v-plugin"))
Eventually(committedQuerier.Writer).Should(gbytes.Say("Name: yahoo, Version: another-version, Sequence: 20, Endorsement Plugin: e-plugin, Validation Plugin: v-plugin"))
Eventually(committedQuerier.Writer).Should(gbytes.Say("Committed chaincode definitions on channel 'test-channel':\n"))
Eventually(committedQuerier.Writer).Should(gbytes.Say("Name: woohoo, Version: a-version, Sequence: 93, Endorsement Plugin: e-plugin, Validation Plugin: v-plugin\n"))
Eventually(committedQuerier.Writer).Should(gbytes.Say("Name: yahoo, Version: another-version, Sequence: 20, Endorsement Plugin: e-plugin, Validation Plugin: v-plugin\n"))
})

Context("when JSON-formatted output is requested", func() {
Expand Down

0 comments on commit af66ef8

Please sign in to comment.