Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed Ledger Binary To Ledgerutil #2746

Merged
merged 1 commit into from
Jul 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# - idemixgen - builds a native idemixgen binary
# - integration-test-prereqs - setup prerequisites for integration tests
# - integration-test - runs the integration tests
# - ledger - builds a native fabric ledger troubleshooting binary
# - ledgerutil - builds a native ledgerutil binary
# - license - checks go source files for Apache license header
# - linter - runs all code checks
# - native - ensures all native binaries are available
Expand Down Expand Up @@ -85,14 +85,14 @@ GO_TAGS ?=
RELEASE_EXES = orderer $(TOOLS_EXES)
RELEASE_IMAGES = baseos ccenv orderer peer tools
RELEASE_PLATFORMS = darwin-amd64 linux-amd64 windows-amd64
TOOLS_EXES = configtxgen configtxlator cryptogen discover idemixgen ledger osnadmin peer
TOOLS_EXES = configtxgen configtxlator cryptogen discover idemixgen ledgerutil osnadmin peer

pkgmap.configtxgen := $(PKGNAME)/cmd/configtxgen
pkgmap.configtxlator := $(PKGNAME)/cmd/configtxlator
pkgmap.cryptogen := $(PKGNAME)/cmd/cryptogen
pkgmap.discover := $(PKGNAME)/cmd/discover
pkgmap.idemixgen := $(PKGNAME)/cmd/idemixgen
pkgmap.ledger := $(PKGNAME)/cmd/ledger
pkgmap.ledgerutil := $(PKGNAME)/cmd/ledgerutil
pkgmap.orderer := $(PKGNAME)/cmd/orderer
pkgmap.osnadmin := $(PKGNAME)/cmd/osnadmin
pkgmap.peer := $(PKGNAME)/cmd/peer
Expand Down
6 changes: 3 additions & 3 deletions cmd/ledger/main.go → cmd/ledgerutil/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"os"
"path/filepath"

"github.com/hyperledger/fabric/internal/ledger"
"github.com/hyperledger/fabric/internal/ledgerutil"
"gopkg.in/alecthomas/kingpin.v2"
)

Expand All @@ -20,7 +20,7 @@ const (
)

var (
app = kingpin.New("ledger", "Ledger Utility Tool")
app = kingpin.New("ledgerutil", "Ledger Utility Tool")

compare = app.Command("compare", "Compare two ledgers via their snapshots.")
snapshotPath1 = compare.Arg("snapshotPath1", "First ledger snapshot directory.").Required().String()
Expand Down Expand Up @@ -59,7 +59,7 @@ func main() {

case compare.FullCommand():

count, err := ledger.Compare(*snapshotPath1, *snapshotPath2, resultFilepath)
count, err := ledgerutil.Compare(*snapshotPath1, *snapshotPath2, resultFilepath)
if err != nil {
fmt.Println(err)
return
Expand Down
4 changes: 2 additions & 2 deletions cmd/ledger/main_test.go → cmd/ledgerutil/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ func TestArguments(t *testing.T) {

// Build ledger binary
gt := gomega.NewWithT(t)
ledger, err := gexec.Build("github.com/hyperledger/fabric/cmd/ledger")
ledgerutil, err := gexec.Build("github.com/hyperledger/fabric/cmd/ledgerutil")
gt.Expect(err).NotTo(gomega.HaveOccurred())
defer gexec.CleanupBuildArtifacts()

for testName, testCase := range testCases {
t.Run(testName, func(t *testing.T) {
cmd := exec.Command(ledger, testCase.args...)
cmd := exec.Command(ledgerutil, testCase.args...)
session, err := gexec.Start(cmd, nil, nil)
gt.Expect(err).NotTo(gomega.HaveOccurred())
gt.Eventually(session, 5*time.Second).Should(gexec.Exit(testCase.exitCode))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package ledger
package ledgerutil

import (
"bufio"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package ledger
package ledgerutil

import (
"bytes"
Expand Down