Merge pull request #209 from harmony-one/fix_shard_for_bls

[utility] Allow 0x in input for shard-for-bls
pull/211/head
Daniel Van Der Maden 5 years ago committed by GitHub
commit 125920416f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      cmd/subcommands/utility.go

@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"math/big"
"strings"
"github.com/harmony-one/bls/ffi/go/bls"
"github.com/harmony-one/go-sdk/pkg/address"
@ -105,8 +106,9 @@ func init() {
Args: cobra.ExactArgs(1),
Short: "which shard this BLS key would be assigned to",
RunE: func(cmd *cobra.Command, args []string) error {
inputKey := strings.TrimPrefix(args[0], "0x")
key := bls.PublicKey{}
if err := key.DeserializeHexStr(args[0]); err != nil {
if err := key.DeserializeHexStr(inputKey); err != nil {
return err
}
reply, err := rpc.Request(rpc.Method.GetShardingStructure, node, []interface{}{})

Loading…
Cancel
Save