Skip to content

Commit

Permalink
Return package ID without any prefix by default for calculatepackageid
Browse files Browse the repository at this point in the history
This patch removes the prefix from the output format of calculatepackageid.
With this patch, the command returns only the package ID by default.

Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
  • Loading branch information
satota2 authored and denyeart committed Nov 2, 2021
1 parent 843ff14 commit ee18f9d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/source/commands/peerlifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ peer lifecycle chaincode calculatepackageid mycc.tar.gz
A successful command will return the package ID for the packaged chaincode.

```
Package ID: myccv1:cc7bb5f50a53c207f68d37e9423c32f968083282e5ffac00d41ffc5768dc1873
myccv1:cc7bb5f50a53c207f68d37e9423c32f968083282e5ffac00d41ffc5768dc1873
```

### peer lifecycle chaincode approveformyorg example
Expand Down
2 changes: 1 addition & 1 deletion docs/wrappers/peer_lifecycle_chaincode_postscript.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ peer lifecycle chaincode calculatepackageid mycc.tar.gz
A successful command will return the package ID for the packaged chaincode.

```
Package ID: myccv1:cc7bb5f50a53c207f68d37e9423c32f968083282e5ffac00d41ffc5768dc1873
myccv1:cc7bb5f50a53c207f68d37e9423c32f968083282e5ffac00d41ffc5768dc1873
```

### peer lifecycle chaincode approveformyorg example
Expand Down
2 changes: 1 addition & 1 deletion integration/nwo/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func CheckPackageID(n *Network, packageFile string, packageID string, peer *Peer
ClientAuth: n.ClientAuthRequired,
})
Expect(err).NotTo(HaveOccurred())
Eventually(sess, n.EventuallyTimeout).Should(gbytes.Say(fmt.Sprintf(`\QPackage ID: %s\E`, packageID)))
Eventually(sess, n.EventuallyTimeout).Should(gbytes.Say(fmt.Sprintf(`\Q%s\E`, packageID)))
}

func InstallChaincode(n *Network, chaincode Chaincode, peers ...*Peer) {
Expand Down
2 changes: 1 addition & 1 deletion internal/peer/lifecycle/chaincode/calculatepackageid.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (p *PackageIDCalculator) PackageID() error {

packageID := persistence.PackageID(metadata.Label, pkgBytes)

fmt.Fprintf(p.Writer, "Package ID: %s\n", packageID)
fmt.Fprintf(p.Writer, "%s\n", packageID)
return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var _ = Describe("CalculatePackageID", func() {
It("calculates the package IDs for chaincodes", func() {
err := packageIDCalculator.PackageID()
Expect(err).NotTo(HaveOccurred())
Eventually(packageIDCalculator.Writer).Should(gbytes.Say("Package ID: Real-Label:fb3edf9621c5e3d864079d8c9764205f4db09d7021cfa4124aa79f4edcc2f64a\n"))
Eventually(packageIDCalculator.Writer).Should(gbytes.Say("Real-Label:fb3edf9621c5e3d864079d8c9764205f4db09d7021cfa4124aa79f4edcc2f64a\n"))
})

Context("when the chaincode install package is not provided", func() {
Expand Down

0 comments on commit ee18f9d

Please sign in to comment.