Merge pull request #160 from harmony-one/add_version_support_in_wallet

Add version support in wallet
pull/164/head
Leo Chen 6 years ago committed by GitHub
commit 89d5eabfa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      client/wallet/main.go
  2. 1
      go_executable_build.sh

@ -27,10 +27,23 @@ import (
"io" "io"
"io/ioutil" "io/ioutil"
"os" "os"
"path"
"strconv" "strconv"
"time" "time"
) )
var (
version string
builtBy string
builtAt string
commit string
)
func printVersion(me string) {
fmt.Fprintf(os.Stderr, "Harmony (C) 2018. %v, version %v-%v (%v %v)\n", path.Base(me), version, commit, builtBy, builtAt)
os.Exit(0)
}
// AccountState includes the state of an account // AccountState includes the state of an account
type AccountState struct { type AccountState struct {
balance *big.Int balance *big.Int
@ -81,6 +94,8 @@ func main() {
// Switch on the subcommand // Switch on the subcommand
switch os.Args[1] { switch os.Args[1] {
case "-version":
printVersion(os.Args[0])
case "new": case "new":
randomBytes := [32]byte{} randomBytes := [32]byte{}
_, err := io.ReadFull(rand.Reader, randomBytes[:]) _, err := io.ReadFull(rand.Reader, randomBytes[:])

@ -3,6 +3,7 @@ declare -A SRC
SRC[benchmark]=benchmark.go SRC[benchmark]=benchmark.go
SRC[txgen]=client/txgen/main.go SRC[txgen]=client/txgen/main.go
SRC[beacon]=beaconchain/main/main.go SRC[beacon]=beaconchain/main/main.go
SRC[wallet]=client/wallet/main.go
BINDIR=bin BINDIR=bin
BUCKET=unique-bucket-bin BUCKET=unique-bucket-bin

Loading…
Cancel
Save