Commit 85b71f03 authored by Yacov Manevich's avatar Yacov Manevich Committed by Gerrit Code Review
Browse files

Merge "[FAB-10212] Fix version info for idemixgen"

parents 737d60bc 703dead8
......@@ -24,9 +24,9 @@ import (
"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric/common/tools/idemixgen/idemixca"
"github.com/hyperledger/fabric/common/tools/idemixgen/metadata"
"github.com/hyperledger/fabric/idemix"
"github.com/hyperledger/fabric/msp"
"github.com/hyperledger/fabric/orderer/common/metadata"
"github.com/pkg/errors"
"gopkg.in/alecthomas/kingpin.v2"
)
......
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package metadata
import (
"fmt"
"runtime"
)
// Package version
var Version string
// Program name
const ProgramName = "idemixgen"
func GetVersionInfo() string {
if Version == "" {
Version = "1.2.0-dev"
}
return fmt.Sprintf("%s:\n Version: %s\n Go version: %s\n OS/Arch: %s",
ProgramName, Version, runtime.Version(),
fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH))
}
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package metadata_test
import (
"fmt"
"runtime"
"testing"
"github.com/hyperledger/fabric/common/tools/idemixgen/metadata"
"github.com/stretchr/testify/assert"
)
func TestGetVersionInfo(t *testing.T) {
testVersion := "TestVersion"
metadata.Version = testVersion
expected := fmt.Sprintf("%s:\n Version: %s\n Go version: %s\n OS/Arch: %s",
metadata.ProgramName, testVersion, runtime.Version(),
fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH))
assert.Equal(t, expected, metadata.GetVersionInfo())
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment