From a38ff5750833d1dc9de55356d3532ab7391b30ce Mon Sep 17 00:00:00 2001 From: Jim McDonald Date: Tue, 31 Mar 2020 11:31:54 +0100 Subject: [PATCH 1/3] Add remote access --- cmd/accountcreate.go | 3 +- cmd/accountimport.go | 3 +- cmd/accountinfo.go | 31 +++++++-- cmd/accountkey.go | 4 +- cmd/accountlock.go | 60 ++++++++++++++++++ cmd/accountunlock.go | 61 ++++++++++++++++++ cmd/chaininfo.go | 4 +- cmd/chainstatus.go | 4 +- cmd/constants.go | 4 +- cmd/root.go | 97 ++++++++++++++++++++++++---- cmd/signaturesign.go | 46 +++++++++++--- cmd/signatureverify.go | 29 +++++++-- cmd/validatorexit.go | 4 +- cmd/validatorinfo.go | 4 +- cmd/version.go | 2 +- cmd/walletaccounts.go | 50 +++++++++++---- cmd/walletcreate.go | 1 + cmd/walletexport.go | 3 +- cmd/walletimport.go | 3 +- cmd/walletinfo.go | 1 + cmd/walletlist.go | 18 ++++-- cmd/walletseed.go | 3 +- go.mod | 36 ++++++----- go.sum | 141 +++++++++++++++++++++++++---------------- 24 files changed, 470 insertions(+), 142 deletions(-) create mode 100644 cmd/accountlock.go create mode 100644 cmd/accountunlock.go diff --git a/cmd/accountcreate.go b/cmd/accountcreate.go index 891adce..6dd9eab 100644 --- a/cmd/accountcreate.go +++ b/cmd/accountcreate.go @@ -29,6 +29,7 @@ var accountCreateCmd = &cobra.Command{ In quiet mode this will return 0 if the account is created successfully, otherwise 1.`, Run: func(cmd *cobra.Command, args []string) { + assert(!remote, "account create not available with remote wallets") assert(rootAccount != "", "--account is required") assert(rootAccountPassphrase != "", "--passphrase is required") @@ -51,7 +52,7 @@ In quiet mode this will return 0 if the account is created successfully, otherwi errCheck(err, "Failed to create account") outputIf(verbose, fmt.Sprintf("0x%048x", account.PublicKey().Marshal())) - os.Exit(_exit_success) + os.Exit(_exitSuccess) }, } diff --git a/cmd/accountimport.go b/cmd/accountimport.go index 01dea6e..6da2f59 100644 --- a/cmd/accountimport.go +++ b/cmd/accountimport.go @@ -33,6 +33,7 @@ var accountImportCmd = &cobra.Command{ In quiet mode this will return 0 if the account is imported successfully, otherwise 1.`, Run: func(cmd *cobra.Command, args []string) { + assert(!remote, "account import not available with remote wallets") assert(rootAccount != "", "--account is required") assert(rootAccountPassphrase != "", "--passphrase is required") assert(accountImportKey != "", "--key is required") @@ -59,7 +60,7 @@ In quiet mode this will return 0 if the account is imported successfully, otherw errCheck(err, "Failed to create account") outputIf(verbose, fmt.Sprintf("0x%048x", account.PublicKey().Marshal())) - os.Exit(_exit_success) + os.Exit(_exitSuccess) }, } diff --git a/cmd/accountinfo.go b/cmd/accountinfo.go index 29127c8..2447b0e 100644 --- a/cmd/accountinfo.go +++ b/cmd/accountinfo.go @@ -1,4 +1,4 @@ -// Copyright © 2019 Weald Technology Trading +// Copyright © 2019, 2020 Weald Technology Trading // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -14,10 +14,12 @@ package cmd import ( + "context" "fmt" "os" "github.com/spf13/cobra" + pb "github.com/wealdtech/eth2-signer-api/pb/v1" ) var accountInfoCmd = &cobra.Command{ @@ -31,13 +33,28 @@ In quiet mode this will return 0 if the account exists, otherwise 1.`, Run: func(cmd *cobra.Command, args []string) { assert(rootAccount != "", "--account is required") - account, err := accountFromPath(rootAccount) - errCheck(err, "Failed to access wallet") + if remote { + listerClient := pb.NewListerClient(remoteGRPCConn) + listAccountsReq := &pb.ListAccountsRequest{ + Paths: []string{ + rootAccount, + }, + } + resp, err := listerClient.ListAccounts(context.Background(), listAccountsReq) + errCheck(err, "Failed to access account") + assert(resp.State == pb.ResponseState_SUCCEEDED, "No such account") + assert(len(resp.Accounts) == 1, "No such account") + fmt.Printf("Public key: %#048x\n", resp.Accounts[0].PublicKey) - outputIf(verbose, fmt.Sprintf("UUID: %v", account.ID())) - outputIf(!quiet, fmt.Sprintf("Public key: %#048x", account.PublicKey().Marshal())) - outputIf(verbose && account.Path() != "", fmt.Sprintf("Path: %s", account.Path())) - os.Exit(_exit_success) + } else { + account, err := accountFromPath(rootAccount) + errCheck(err, "Failed to access wallet") + outputIf(verbose, fmt.Sprintf("UUID: %v", account.ID())) + outputIf(!quiet, fmt.Sprintf("Public key: %#048x", account.PublicKey().Marshal())) + outputIf(verbose && account.Path() != "", fmt.Sprintf("Path: %s", account.Path())) + } + + os.Exit(_exitSuccess) }, } diff --git a/cmd/accountkey.go b/cmd/accountkey.go index 994428b..b71918a 100644 --- a/cmd/accountkey.go +++ b/cmd/accountkey.go @@ -31,7 +31,9 @@ var accountKeyCmd = &cobra.Command{ In quiet mode this will return 0 if the key can be obtained, otherwise 1.`, Run: func(cmd *cobra.Command, args []string) { + assert(!remote, "account keys not available with remote wallets") assert(rootAccount != "", "--account is required") + account, err := accountFromPath(rootAccount) errCheck(err, "Failed to access account") @@ -47,7 +49,7 @@ In quiet mode this will return 0 if the key can be obtained, otherwise 1.`, account.Lock() outputIf(!quiet, fmt.Sprintf("%#064x", privateKey.Marshal())) - os.Exit(_exit_success) + os.Exit(_exitSuccess) }, } diff --git a/cmd/accountlock.go b/cmd/accountlock.go new file mode 100644 index 0000000..7f7e99f --- /dev/null +++ b/cmd/accountlock.go @@ -0,0 +1,60 @@ +// Copyright © 2019, 2020 Weald Technology Trading +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package cmd + +import ( + "context" + "os" + + "github.com/spf13/cobra" + "github.com/spf13/viper" + pb "github.com/wealdtech/eth2-signer-api/pb/v1" +) + +var accountLockCmd = &cobra.Command{ + Use: "lock", + Short: "Lock a remote account", + Long: `Lock a remote account. For example: + + ethdo account lock --account="primary/my funds" + +In quiet mode this will return 0 if the account is locked, otherwise 1.`, + Run: func(cmd *cobra.Command, args []string) { + assert(remote, "account lock only works with remote wallets") + assert(rootAccount != "", "--account is required") + + client := pb.NewAccountManagerClient(remoteGRPCConn) + lockReq := &pb.LockAccountRequest{ + Account: rootAccount, + } + ctx, cancel := context.WithTimeout(context.Background(), viper.GetDuration("timeout")) + defer cancel() + resp, err := client.Lock(ctx, lockReq) + errCheck(err, "Failed in attempt to lock account") + switch resp.State { + case pb.ResponseState_DENIED: + die("Lock request denied") + case pb.ResponseState_FAILED: + die("Lock request failed") + case pb.ResponseState_SUCCEEDED: + outputIf(!quiet, "Lock request succeeded") + os.Exit(_exitSuccess) + } + }, +} + +func init() { + accountCmd.AddCommand(accountLockCmd) + accountFlags(accountLockCmd) +} diff --git a/cmd/accountunlock.go b/cmd/accountunlock.go new file mode 100644 index 0000000..bc91f50 --- /dev/null +++ b/cmd/accountunlock.go @@ -0,0 +1,61 @@ +// Copyright © 2019, 2020 Weald Technology Trading +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package cmd + +import ( + "context" + "os" + + "github.com/spf13/cobra" + "github.com/spf13/viper" + pb "github.com/wealdtech/eth2-signer-api/pb/v1" +) + +var accountUnlockCmd = &cobra.Command{ + Use: "unlock", + Short: "Unlock a remote account", + Long: `Unlock a remote account. For example: + + ethdo account unlock --account="primary/my funds" --passphrase="secret" + +In quiet mode this will return 0 if the account is unlocked, otherwise 1.`, + Run: func(cmd *cobra.Command, args []string) { + assert(remote, "account unlock only works with remote wallets") + assert(rootAccount != "", "--account is required") + + client := pb.NewAccountManagerClient(remoteGRPCConn) + unlockReq := &pb.UnlockAccountRequest{ + Account: rootAccount, + Passphrase: []byte(rootAccountPassphrase), + } + ctx, cancel := context.WithTimeout(context.Background(), viper.GetDuration("timeout")) + defer cancel() + resp, err := client.Unlock(ctx, unlockReq) + errCheck(err, "Failed in attempt to unlock account") + switch resp.State { + case pb.ResponseState_DENIED: + die("Unlock request denied") + case pb.ResponseState_FAILED: + die("Unlock request failed") + case pb.ResponseState_SUCCEEDED: + outputIf(!quiet, "Unlock request succeeded") + os.Exit(_exitSuccess) + } + }, +} + +func init() { + accountCmd.AddCommand(accountUnlockCmd) + accountFlags(accountUnlockCmd) +} diff --git a/cmd/chaininfo.go b/cmd/chaininfo.go index b0e9bf0..a6589a8 100644 --- a/cmd/chaininfo.go +++ b/cmd/chaininfo.go @@ -40,7 +40,7 @@ In quiet mode this will return 0 if the chain information can be obtained, other errCheck(err, "Failed to obtain genesis time") if quiet { - os.Exit(_exit_success) + os.Exit(_exitSuccess) } fmt.Printf("Genesis time:\t\t%s\n", genesisTime.Format(time.UnixDate)) @@ -52,7 +52,7 @@ In quiet mode this will return 0 if the chain information can be obtained, other outputIf(verbose, fmt.Sprintf("Seconds per slot:\t%v", config["SecondsPerSlot"].(uint64))) outputIf(verbose, fmt.Sprintf("Slots per epoch:\t%v", config["SlotsPerEpoch"].(uint64))) - os.Exit(_exit_success) + os.Exit(_exitSuccess) }, } diff --git a/cmd/chainstatus.go b/cmd/chainstatus.go index 8ba6c87..f66cc1e 100644 --- a/cmd/chainstatus.go +++ b/cmd/chainstatus.go @@ -45,7 +45,7 @@ In quiet mode this will return 0 if the chain status can be obtained, otherwise errCheck(err, "Failed to obtain chain info") if quiet { - os.Exit(_exit_success) + os.Exit(_exitSuccess) } slot := timestampToSlot(genesisTime.Unix(), time.Now().Unix(), config["SecondsPerSlot"].(uint64)) @@ -82,7 +82,7 @@ In quiet mode this will return 0 if the chain status can be obtained, otherwise outputIf(verbose, fmt.Sprintf("Prior justified epoch:\t%v (%d)", info.GetPreviousJustifiedSlot()/slotsPerEpoch, (slot-info.GetPreviousJustifiedSlot())/slotsPerEpoch)) } - os.Exit(_exit_success) + os.Exit(_exitSuccess) }, } diff --git a/cmd/constants.go b/cmd/constants.go index a7e4363..cbae727 100644 --- a/cmd/constants.go +++ b/cmd/constants.go @@ -14,6 +14,6 @@ package cmd const ( - _exit_success = 0 - _exit_failure = 1 + _exitSuccess = 0 + _exitFailure = 1 ) diff --git a/cmd/root.go b/cmd/root.go index 394fe4d..6f1bc66 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -15,8 +15,11 @@ package cmd import ( "context" + "crypto/tls" + "crypto/x509" "errors" "fmt" + "io/ioutil" "os" "regexp" "sort" @@ -28,6 +31,7 @@ import ( "github.com/spf13/viper" types "github.com/wealdtech/go-eth2-types" "google.golang.org/grpc" + "google.golang.org/grpc/credentials" wallet "github.com/wealdtech/go-eth2-wallet" wtypes "github.com/wealdtech/go-eth2-wallet-types" @@ -38,17 +42,26 @@ var quiet bool var verbose bool var debug bool -// For transaction commands +// For transaction commands. var wait bool var generate bool -// Root variables, present for all commands +// Root variables, present for all commands. var rootStore string var rootAccount string var rootStorePassphrase string var rootWalletPassphrase string var rootAccountPassphrase string +// Remote connection. +var remote bool +var remoteAddr string +var clientCert string +var clientKey string +var serverCACert string +var remoteGRPCConn *grpc.ClientConn + +// Prysm connection. var eth2GRPCConn *grpc.ClientConn // RootCmd represents the base command when called without any subcommands @@ -104,9 +117,14 @@ func persistentPreRun(cmd *cobra.Command, args []string) { die("Cannot supply both generate and wait flags") } - // Set up our wallet store - err := wallet.SetStore(rootStore, []byte(rootStorePassphrase)) - errCheck(err, "Failed to set up wallet store") + if viper.GetString("remote") == "" { + // Set up our wallet store + err := wallet.SetStore(rootStore, []byte(rootStorePassphrase)) + errCheck(err, "Failed to set up wallet store") + } else { + err := initRemote() + errCheck(err, "Failed to connect to remote wallet") + } } // Execute adds all child commands to the root command and sets flags appropriately. @@ -114,7 +132,7 @@ func persistentPreRun(cmd *cobra.Command, args []string) { func Execute() { if err := RootCmd.Execute(); err != nil { fmt.Println(err) - os.Exit(_exit_failure) + os.Exit(_exitFailure) } } @@ -166,6 +184,22 @@ func init() { if err := viper.BindPFlag("timeout", RootCmd.PersistentFlags().Lookup("timeout")); err != nil { panic(err) } + RootCmd.PersistentFlags().String("remote", "", "connection to a remote wallet daemon") + if err := viper.BindPFlag("remote", RootCmd.PersistentFlags().Lookup("remote")); err != nil { + panic(err) + } + RootCmd.PersistentFlags().String("client-cert", "", "location of a client certificate file when connecting to the remote wallet daemon") + if err := viper.BindPFlag("client-cert", RootCmd.PersistentFlags().Lookup("client-cert")); err != nil { + panic(err) + } + RootCmd.PersistentFlags().String("client-key", "", "location of a client key file when connecting to the remote wallet daemon") + if err := viper.BindPFlag("client-key", RootCmd.PersistentFlags().Lookup("client-key")); err != nil { + panic(err) + } + RootCmd.PersistentFlags().String("server-ca-cert", "", "location of the server certificate authority certificate when connecting to the remote wallet daemon") + if err := viper.BindPFlag("server-ca-cert", RootCmd.PersistentFlags().Lookup("server-ca-cert")); err != nil { + panic(err) + } } // initConfig reads in config file and ENV variables if set. @@ -176,10 +210,7 @@ func initConfig() { } else { // Find home directory. home, err := homedir.Dir() - if err != nil { - fmt.Println(err) - os.Exit(_exit_failure) - } + errCheck(err, "could not find home directory") // Search config in home directory with name ".ethdo" (without extension). viper.AddConfigPath(home) @@ -192,10 +223,7 @@ func initConfig() { // If a config file is found, read it in. if err := viper.ReadInConfig(); err != nil { // Don't report lack of config file... - if !strings.Contains(err.Error(), "Not Found") { - fmt.Println(err) - os.Exit(_exit_failure) - } + assert(strings.Contains(err.Error(), "Not Found"), "failed to read configuration") } } @@ -342,3 +370,44 @@ func connect() error { eth2GRPCConn, err = grpc.DialContext(ctx, connection, opts...) return err } + +func initRemote() error { + remote = true + remoteAddr = viper.GetString("remote") + clientCert = viper.GetString("client-cert") + clientKey = viper.GetString("client-key") + serverCACert = viper.GetString("server-ca-cert") + + // Load the client certificates. + clientPair, err := tls.LoadX509KeyPair(clientCert, clientKey) + if err != nil { + return err + } + + tlsCfg := &tls.Config{ + Certificates: []tls.Certificate{clientPair}, + } + if serverCACert != "" { + // Load the CA for the server certificate. + serverCA, err := ioutil.ReadFile(serverCACert) + if err != nil { + return err + } + cp := x509.NewCertPool() + if !cp.AppendCertsFromPEM(serverCA) { + return err + } + tlsCfg.RootCAs = cp + } + + clientCreds := credentials.NewTLS(tlsCfg) + + opts := []grpc.DialOption{ + // Require TLS. + grpc.WithTransportCredentials(clientCreds), + // Block until server responds. + grpc.WithBlock(), + } + remoteGRPCConn, err = grpc.Dial(remoteAddr, opts...) + return err +} diff --git a/cmd/signaturesign.go b/cmd/signaturesign.go index f90cb00..b929f9b 100644 --- a/cmd/signaturesign.go +++ b/cmd/signaturesign.go @@ -1,4 +1,4 @@ -// Copyright © 2017-2019 Weald Technology Trading +// Copyright © 2017-2020 Weald Technology Trading // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -14,10 +14,13 @@ package cmd import ( + "context" "fmt" "os" "github.com/spf13/cobra" + "github.com/spf13/viper" + pb "github.com/wealdtech/eth2-signer-api/pb/v1" "github.com/wealdtech/go-bytesutil" types "github.com/wealdtech/go-eth2-types" ) @@ -44,18 +47,41 @@ In quiet mode this will return 0 if the data can be signed, otherwise 1.`, } assert(rootAccount != "", "--account is required") - account, err := accountFromPath(rootAccount) - errCheck(err, "Failed to access account for signing") - err = account.Unlock([]byte(rootAccountPassphrase)) - errCheck(err, "Failed to unlock account for signing") - defer account.Lock() - - signature, err := account.Sign(data, domain) - errCheck(err, "Failed to sign data") + var signature types.Signature + if remote { + signClient := pb.NewSignerClient(remoteGRPCConn) + domainBytes := bytesutil.Bytes64(domain) + signReq := &pb.SignRequest{ + Id: &pb.SignRequest_Account{Account: rootAccount}, + Data: data, + Domain: domainBytes[:], + } + ctx, cancel := context.WithTimeout(context.Background(), viper.GetDuration("timeout")) + defer cancel() + resp, err := signClient.Sign(ctx, signReq) + errCheck(err, "Failed to sign") + switch resp.State { + case pb.ResponseState_DENIED: + die("Signing request denied") + case pb.ResponseState_FAILED: + die("Signing request failed") + case pb.ResponseState_SUCCEEDED: + signature, err = types.BLSSignatureFromBytes(resp.Signature) + errCheck(err, "Invalid signature") + } + } else { + account, err := accountFromPath(rootAccount) + errCheck(err, "Failed to access account for signing") + err = account.Unlock([]byte(rootAccountPassphrase)) + errCheck(err, "Failed to unlock account for signing") + defer account.Lock() + signature, err = account.Sign(data, domain) + errCheck(err, "Failed to sign data") + } outputIf(!quiet, fmt.Sprintf("0x%096x", signature.Marshal())) - os.Exit(_exit_success) + os.Exit(_exitSuccess) }, } diff --git a/cmd/signatureverify.go b/cmd/signatureverify.go index 259edeb..85263c8 100644 --- a/cmd/signatureverify.go +++ b/cmd/signatureverify.go @@ -1,4 +1,4 @@ -// Copyright © 2017-2019 Weald Technology Trading +// Copyright © 2017-2020 Weald Technology Trading // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -14,9 +14,11 @@ package cmd import ( + "context" "os" "github.com/spf13/cobra" + pb "github.com/wealdtech/eth2-signer-api/pb/v1" "github.com/wealdtech/go-bytesutil" types "github.com/wealdtech/go-eth2-types" ) @@ -54,9 +56,24 @@ In quiet mode this will return 0 if the data can be signed, otherwise 1.`, var pubKey types.PublicKey assert(signatureVerifyPubKey == "" || rootAccount == "", "Either --pubkey or --account should be supplied") if rootAccount != "" { - account, err := accountFromPath(rootAccount) - errCheck(err, "Unknown account") - pubKey = account.PublicKey() + if remote { + listerClient := pb.NewListerClient(remoteGRPCConn) + listAccountsReq := &pb.ListAccountsRequest{ + Paths: []string{ + rootAccount, + }, + } + resp, err := listerClient.ListAccounts(context.Background(), listAccountsReq) + errCheck(err, "Failed to access account") + assert(resp.State == pb.ResponseState_SUCCEEDED, "Failed to obtain account") + assert(len(resp.Accounts) == 1, "No such account") + pubKey, err = types.BLSPublicKeyFromBytes(resp.Accounts[0].PublicKey) + errCheck(err, "Invalid public key provided for account") + } else { + account, err := accountFromPath(rootAccount) + errCheck(err, "Unknown account") + pubKey = account.PublicKey() + } } else { pubKeyBytes, err := bytesutil.FromHexString(signatureVerifyPubKey) errCheck(err, "Invalid public key") @@ -66,10 +83,10 @@ In quiet mode this will return 0 if the data can be signed, otherwise 1.`, verified := signature.Verify(data, pubKey, domain) if !verified { outputIf(!quiet, "Not verified") - os.Exit(_exit_failure) + os.Exit(_exitFailure) } outputIf(!quiet, "Verified") - os.Exit(_exit_success) + os.Exit(_exitSuccess) }, } diff --git a/cmd/validatorexit.go b/cmd/validatorexit.go index fb55497..ea83254 100644 --- a/cmd/validatorexit.go +++ b/cmd/validatorexit.go @@ -20,7 +20,7 @@ import ( "time" ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" - "github.com/prysmaticlabs/go-ssz" + ssz "github.com/prysmaticlabs/go-ssz" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/wealdtech/ethdo/grpc" @@ -102,7 +102,7 @@ In quiet mode this will return 0 if the transaction has been sent, otherwise 1.` errCheck(err, "Failed to propose exit") outputIf(!quiet, "Validator exit transaction sent") - os.Exit(_exit_success) + os.Exit(_exitSuccess) }, } diff --git a/cmd/validatorinfo.go b/cmd/validatorinfo.go index d3b6b60..d15dd6c 100644 --- a/cmd/validatorinfo.go +++ b/cmd/validatorinfo.go @@ -67,7 +67,7 @@ In quiet mode this will return 0 if the validator information can be obtained, o assert(validatorInfo.Status != ethpb.ValidatorStatus_UNKNOWN_STATUS, "Not known as a validator") if quiet { - os.Exit(_exit_success) + os.Exit(_exitSuccess) } outputIf(verbose, fmt.Sprintf("Epoch of data:\t\t%v", validatorInfo.Epoch)) @@ -102,7 +102,7 @@ In quiet mode this will return 0 if the validator information can be obtained, o } } - os.Exit(_exit_success) + os.Exit(_exitSuccess) }, } diff --git a/cmd/version.go b/cmd/version.go index be6504e..462ae6c 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -44,7 +44,7 @@ var versionCmd = &cobra.Command{ } } } - os.Exit(_exit_success) + os.Exit(_exitSuccess) }, } diff --git a/cmd/walletaccounts.go b/cmd/walletaccounts.go index e31e7c1..f0470d0 100644 --- a/cmd/walletaccounts.go +++ b/cmd/walletaccounts.go @@ -14,10 +14,13 @@ package cmd import ( + "context" "fmt" "os" "github.com/spf13/cobra" + "github.com/spf13/viper" + pb "github.com/wealdtech/eth2-signer-api/pb/v1" ) var walletAccountsCmd = &cobra.Command{ @@ -31,24 +34,49 @@ In quiet mode this will return 0 if the wallet holds any addresses, otherwise 1. Run: func(cmd *cobra.Command, args []string) { assert(walletWallet != "", "wallet is required") - wallet, err := walletFromPath(walletWallet) - errCheck(err, "Failed to access wallet") - hasAccounts := false - for account := range wallet.Accounts() { - hasAccounts = true - if verbose { - fmt.Printf("%s\n\tUUID:\t\t%s\n\tPublic key:\t0x%048x\n", account.Name(), account.ID(), account.PublicKey().Marshal()) - } else if !quiet { - fmt.Printf("%s\n", account.Name()) + + if remote { + listerClient := pb.NewListerClient(remoteGRPCConn) + listAccountsReq := &pb.ListAccountsRequest{ + Paths: []string{ + walletWallet, + }, + } + ctx, cancel := context.WithTimeout(context.Background(), viper.GetDuration("timeout")) + defer cancel() + accountsResp, err := listerClient.ListAccounts(ctx, listAccountsReq) + errCheck(err, "Failed to access wallet") + assert(accountsResp.State == pb.ResponseState_SUCCEEDED, "Request to list wallet accounts failed") + walletPrefixLen := len(walletWallet) + 1 + for _, account := range accountsResp.Accounts { + hasAccounts = true + if verbose { + fmt.Printf("%s\n", account.Name[walletPrefixLen:]) + fmt.Printf("\tPublic key: %#048x\n", account.PublicKey) + } else if !quiet { + fmt.Printf("%s\n", account.Name[walletPrefixLen:]) + } + } + } else { + wallet, err := walletFromPath(walletWallet) + errCheck(err, "Failed to access wallet") + + for account := range wallet.Accounts() { + hasAccounts = true + if verbose { + fmt.Printf("%s\n\tUUID:\t\t%s\n\tPublic key:\t0x%048x\n", account.Name(), account.ID(), account.PublicKey().Marshal()) + } else if !quiet { + fmt.Printf("%s\n", account.Name()) + } } } if quiet { if hasAccounts { - os.Exit(_exit_success) + os.Exit(_exitSuccess) } - os.Exit(_exit_failure) + os.Exit(_exitFailure) } }, } diff --git a/cmd/walletcreate.go b/cmd/walletcreate.go index 64b96fd..0e89d6e 100644 --- a/cmd/walletcreate.go +++ b/cmd/walletcreate.go @@ -31,6 +31,7 @@ var walletCreateCmd = &cobra.Command{ In quiet mode this will return 0 if the wallet is created successfully, otherwise 1.`, Run: func(cmd *cobra.Command, args []string) { + assert(!remote, "wallet create not available with remote wallets") assert(walletWallet != "", "--wallet is required") assert(walletCreateType != "", "--type is required") diff --git a/cmd/walletexport.go b/cmd/walletexport.go index cb14373..e91a156 100644 --- a/cmd/walletexport.go +++ b/cmd/walletexport.go @@ -32,6 +32,7 @@ var walletExportCmd = &cobra.Command{ In quiet mode this will return 0 if the wallet is able to be exported, otherwise 1.`, Run: func(cmd *cobra.Command, args []string) { + assert(!remote, "wallet export not available with remote wallets") assert(walletWallet != "", "--wallet is required") assert(walletExportPassphrase != "", "--exportpassphrase is required") @@ -45,7 +46,7 @@ In quiet mode this will return 0 if the wallet is able to be exported, otherwise errCheck(err, "Failed to export wallet") outputIf(!quiet, fmt.Sprintf("0x%x", exportData)) - os.Exit(_exit_success) + os.Exit(_exitSuccess) }, } diff --git a/cmd/walletimport.go b/cmd/walletimport.go index d885113..9bdd429 100644 --- a/cmd/walletimport.go +++ b/cmd/walletimport.go @@ -36,6 +36,7 @@ var walletImportCmd = &cobra.Command{ In quiet mode this will return 0 if the wallet is imported successfully, otherwise 1.`, Run: func(cmd *cobra.Command, args []string) { + assert(!remote, "wallet import not available with remote wallets") assert(walletImportData != "", "--walletimportdata is required") assert(walletImportPassphrase != "", "--importpassphrase is required") @@ -53,7 +54,7 @@ In quiet mode this will return 0 if the wallet is imported successfully, otherwi _, err = wallet.ImportWallet(importData, []byte(walletImportPassphrase)) errCheck(err, "Failed to import wallet") - os.Exit(_exit_success) + os.Exit(_exitSuccess) }, } diff --git a/cmd/walletinfo.go b/cmd/walletinfo.go index 0d83c65..dc548b0 100644 --- a/cmd/walletinfo.go +++ b/cmd/walletinfo.go @@ -30,6 +30,7 @@ var walletInfoCmd = &cobra.Command{ In quiet mode this will return 0 if the wallet exists, otherwise 1.`, Run: func(cmd *cobra.Command, args []string) { + assert(!remote, "wallet info not available with remote wallets") assert(walletWallet != "", "Wallet is required") wallet, err := walletFromPath(walletWallet) diff --git a/cmd/walletlist.go b/cmd/walletlist.go index f9ab205..ed5e3ed 100644 --- a/cmd/walletlist.go +++ b/cmd/walletlist.go @@ -30,17 +30,23 @@ var walletListCmd = &cobra.Command{ In quiet mode this will return 0 if any wallets are found, otherwise 1.`, Run: func(cmd *cobra.Command, args []string) { + assert(!remote, "wallet list not available with remote wallets") + walletsFound := false - for w := range wallet.Wallets() { - walletsFound = true - outputIf(!quiet && !verbose, w.Name()) - outputIf(verbose, fmt.Sprintf("%s\n\tUUID:\t\t%s", w.Name(), w.ID().String())) + if remote { + die("Remote wallets cannot be listed") + } else { + for w := range wallet.Wallets() { + walletsFound = true + outputIf(!quiet && !verbose, w.Name()) + outputIf(verbose, fmt.Sprintf("%s\n\tUUID:\t\t%s", w.Name(), w.ID().String())) + } } if !walletsFound { - os.Exit(_exit_failure) + os.Exit(_exitFailure) } - os.Exit(_exit_success) + os.Exit(_exitSuccess) }, } diff --git a/cmd/walletseed.go b/cmd/walletseed.go index 41d5b13..8f01695 100644 --- a/cmd/walletseed.go +++ b/cmd/walletseed.go @@ -31,6 +31,7 @@ var walletSeedCmd = &cobra.Command{ In quiet mode this will return 0 if the wallet is a hierarchical deterministic wallet, otherwise 1.`, Run: func(cmd *cobra.Command, args []string) { + assert(!remote, "wallet seed not available with remote wallets") assert(walletWallet != "", "--wallet is required") assert(rootWalletPassphrase != "", "--walletpassphrase is required") @@ -48,7 +49,7 @@ In quiet mode this will return 0 if the wallet is a hierarchical deterministic w errCheck(err, "Failed to generate seed mnemonic") outputIf(!quiet, seedStr) - os.Exit(_exit_success) + os.Exit(_exitSuccess) }, } diff --git a/go.mod b/go.mod index 3cfeb4b..664b999 100644 --- a/go.mod +++ b/go.mod @@ -5,39 +5,43 @@ go 1.13 require ( github.com/FactomProject/go-bip39 v0.3.5 github.com/OneOfOne/xxhash v1.2.5 // indirect - github.com/aws/aws-sdk-go v1.29.2 // indirect - github.com/dgraph-io/ristretto v0.0.1 // indirect - github.com/golang/protobuf v1.3.3 - github.com/google/go-cmp v0.3.1 // indirect + github.com/aws/aws-sdk-go v1.30.0 // indirect + github.com/dgraph-io/ristretto v0.0.2 // indirect + github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/golang/protobuf v1.4.0-rc.4 github.com/google/uuid v1.1.1 - github.com/grpc-ecosystem/grpc-gateway v1.13.0 // indirect + github.com/grpc-ecosystem/grpc-gateway v1.14.3 // indirect + github.com/herumi/bls-eth-go-binary v0.0.0-20200326062426-f58f8b8bd66f // indirect github.com/minio/highwayhash v1.0.0 // indirect github.com/minio/sha256-simd v0.1.1 // indirect github.com/mitchellh/go-homedir v1.1.0 + github.com/mitchellh/mapstructure v1.2.2 // indirect github.com/pelletier/go-toml v1.6.0 // indirect github.com/pkg/errors v0.9.1 github.com/protolambda/zssz v0.1.4 // indirect - github.com/prysmaticlabs/ethereumapis v0.0.0-20200213224628-b7452dde4ca3 - github.com/prysmaticlabs/go-bitfield v0.0.0-20191017011753-53b773adde52 // indirect + github.com/prysmaticlabs/ethereumapis v0.0.0-20200319212951-62fd1d2ec119 + github.com/prysmaticlabs/go-bitfield v0.0.0-20200322041314-62c2aee71669 // indirect github.com/prysmaticlabs/go-ssz v0.0.0-20200101200214-e24db4d9e963 github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.2.2 // indirect github.com/spf13/cast v1.3.1 // indirect - github.com/spf13/cobra v0.0.5 + github.com/spf13/cobra v0.0.7 github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.6.2 - github.com/wealdtech/go-bytesutil v1.1.0 + github.com/wealdtech/eth2-signer-api v1.2.0 + github.com/wealdtech/go-bytesutil v1.1.1 github.com/wealdtech/go-eth2-types v1.0.0 - github.com/wealdtech/go-eth2-util v1.1.0 - github.com/wealdtech/go-eth2-wallet v1.9.1 + github.com/wealdtech/go-eth2-util v1.1.2 + github.com/wealdtech/go-eth2-wallet v1.9.2 github.com/wealdtech/go-eth2-wallet-types v1.10.0 github.com/wealdtech/go-string2eth v1.1.0 - golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6 // indirect - golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4 // indirect + golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 // indirect + golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // indirect + golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775 // indirect golang.org/x/text v0.3.2 // indirect - google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce // indirect - google.golang.org/grpc v1.27.1 - gopkg.in/ini.v1 v1.52.0 // indirect + google.golang.org/genproto v0.0.0-20200330113809-af700f360a68 // indirect + google.golang.org/grpc v1.28.0 + gopkg.in/ini.v1 v1.55.0 // indirect gopkg.in/yaml.v2 v2.2.8 // indirect ) diff --git a/go.sum b/go.sum index 041c992..6daeba9 100644 --- a/go.sum +++ b/go.sum @@ -11,12 +11,9 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/aws/aws-sdk-go v1.28.0 h1:NkmnHFVEMTRYTleRLm5xUaL1mHKKkYQl4rCd+jzD58c= -github.com/aws/aws-sdk-go v1.28.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.28.13 h1:JyCQQ86yil3hg7MtWdNH8Pbcgx92qlUV2v22Km63Mf4= -github.com/aws/aws-sdk-go v1.28.13/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.29.2 h1:muUfu006FBFvEaDzt4Wq6Ng9E7ufedf8zrB4hmY65QA= -github.com/aws/aws-sdk-go v1.29.2/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg= +github.com/aws/aws-sdk-go v1.29.14/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg= +github.com/aws/aws-sdk-go v1.30.0 h1:7NDwnnQrI1Ivk0bXLzMmuX5ozzOwteHOsAs4druW7gI= +github.com/aws/aws-sdk-go v1.30.0/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8= @@ -24,27 +21,31 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgraph-io/ristretto v0.0.1 h1:cJwdnj42uV8Jg4+KLrYovLiCgIfz9wtWm6E6KA+1tLs= -github.com/dgraph-io/ristretto v0.0.1/go.mod h1:T40EBc7CJke8TkpiYfGGKAeFjSaxuFXhuXRyumBd6RE= +github.com/dgraph-io/ristretto v0.0.2 h1:a5WaUrDa0qm0YrAAS1tUykT5El3kt62KNZZeMxQn3po= +github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dlespiau/covertool v0.0.0-20180314162135-b0c4c6d0583a/go.mod h1:/eQMcW3eA1bzKx23ZYI2H3tXPdJB5JWYTHzoUPBvQY4= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= @@ -64,11 +65,19 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4 h1:+EOh4OY6tjM6ZueeUKinl1f0U2820HzQOuf1iqMnsks= +github.com/golang/protobuf v1.4.0-rc.4/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/pprof v0.0.0-20190309163659-77426154d546/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -79,15 +88,21 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmg github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0 h1:bM6ZAFZmc/wPFaRDi0d5L7hGEZEx/2u+Tmr2evNHDiI= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.13.0 h1:sBDQoHXrOlfPobnKw69FIKa1wg9qsLLvvQ/Y19WtFgI= -github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= +github.com/grpc-ecosystem/grpc-gateway v1.14.3 h1:OCJlWkOUoTnl0neNGlf4fUm3TmbEtguw7vR+nGtnDjY= +github.com/grpc-ecosystem/grpc-gateway v1.14.3/go.mod h1:6CwZWGDSPRJidgKAtJVvND6soZe6fT7iteq8wDPdhb0= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/herumi/bls-eth-go-binary v0.0.0-20200206020841-d19cc489b1d4 h1:9NJ0bT04hJDHLGO5LjhBFkwKMAze3WZYA/V2MtKCAhE= +github.com/herumi/bls-eth-go-binary v0.0.0-20200206020841-d19cc489b1d4/go.mod h1:WKIQeicfSedn/NDDV6IiaxUcthn5gp3w6RbIG/GOLAg= +github.com/herumi/bls-eth-go-binary v0.0.0-20200326062426-f58f8b8bd66f h1:fTtKw31DtXHqxb3D9Oqt+CDVXEbyLs7yqa+RNKYw+3I= +github.com/herumi/bls-eth-go-binary v0.0.0-20200326062426-f58f8b8bd66f/go.mod h1:luAnRm3OsMQeokhGzpYmc0ZKwawY7o87PUEP11Z7r7U= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= +github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -115,6 +130,8 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.2.2 h1:dxe5oCinTXiTIcfgmZecdCzPmAJKd46KsCWc35r0TV4= +github.com/mitchellh/mapstructure v1.2.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mmcloughlin/avo v0.0.0-20190318053554-7a0eb66183da/go.mod h1:lf5GMZxA5kz8dnCweJuER5Rmbx6dDu6qvw0fO3uYKK8= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -123,8 +140,6 @@ github.com/pelletier/go-toml v1.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzI github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= github.com/phoreproject/bls v0.0.0-20190821133044-da95d4798b09 h1:f0WZnMl5hMHNpfUPR+klp00ZaIL1dLPZigpJUWupreI= github.com/phoreproject/bls v0.0.0-20190821133044-da95d4798b09/go.mod h1:7pK0Ldy91shCmI47LLTn3i3rfTQcHiJJvPqGqzvN5nE= -github.com/phoreproject/bls v0.0.0-20191113194321-fef763a1a842 h1:SFS72hX189sQC+kZzAcNv7ENTLJHddmokEM39RsLA24= -github.com/phoreproject/bls v0.0.0-20191113194321-fef763a1a842/go.mod h1:xHJKf2TLXUA39Dhv8k5QmQOxLsbrb1KeTS/3ERfLeqc= github.com/phoreproject/bls v0.0.0-20191211001008-9d5f85bf4a9b h1:tE/F54uL3jp0ZGSKNMPGCTF003pSmtD/sQojpKADAxY= github.com/phoreproject/bls v0.0.0-20191211001008-9d5f85bf4a9b/go.mod h1:xHJKf2TLXUA39Dhv8k5QmQOxLsbrb1KeTS/3ERfLeqc= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -146,17 +161,18 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/protolambda/zssz v0.1.4 h1:4jkt8sqwhOVR8B1JebREU/gVX0Ply4GypsV8+RWrDuw= github.com/protolambda/zssz v0.1.4/go.mod h1:a4iwOX5FE7/JkKA+J/PH0Mjo9oXftN6P8NZyL28gpag= -github.com/prysmaticlabs/ethereumapis v0.0.0-20200213224628-b7452dde4ca3 h1:vhqBgbKg17cwGZbiOjuUqLsvkN11T+eEli5sQBbpgz4= -github.com/prysmaticlabs/ethereumapis v0.0.0-20200213224628-b7452dde4ca3/go.mod h1:5OkRN6UmvgtP+kIewitcEKC7S5KOzLOGtya/Tz+HBns= -github.com/prysmaticlabs/go-bitfield v0.0.0-20191017011753-53b773adde52 h1:kxZ+xSWX0qbxoiDXQBLztKeEmEQg6TgCYWAOa7gSGGU= -github.com/prysmaticlabs/go-bitfield v0.0.0-20191017011753-53b773adde52/go.mod h1:hCwmef+4qXWjv0jLDbQdWnL0Ol7cS7/lCSS26WR+u6s= +github.com/prysmaticlabs/ethereumapis v0.0.0-20200319212951-62fd1d2ec119 h1:JzX5iidEixf66H1Hwofcfx3S0SyoQrWGvspxo+fd1qg= +github.com/prysmaticlabs/ethereumapis v0.0.0-20200319212951-62fd1d2ec119/go.mod h1:5OkRN6UmvgtP+kIewitcEKC7S5KOzLOGtya/Tz+HBns= +github.com/prysmaticlabs/go-bitfield v0.0.0-20200322041314-62c2aee71669 h1:cX6YRZnZ9sgMqM5U14llxUiXVNJ3u07Res1IIjTOgtI= +github.com/prysmaticlabs/go-bitfield v0.0.0-20200322041314-62c2aee71669/go.mod h1:hCwmef+4qXWjv0jLDbQdWnL0Ol7cS7/lCSS26WR+u6s= github.com/prysmaticlabs/go-ssz v0.0.0-20200101200214-e24db4d9e963 h1:Th5ufPIaL5s/7i3gXHTgiTwfsUhWDP/PwFRiI6qV6v0= github.com/prysmaticlabs/go-ssz v0.0.0-20200101200214-e24db4d9e963/go.mod h1:VecIJZrewdAuhVckySLFt2wAAHRME934bSDurP8ftkc= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0 h1:Xuk8ma/ibJ1fOy4Ee11vHhUFHQNpHhrBneOCNHVXS5w= github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0/go.mod h1:7AwjWCpdPhkSmNAgUv5C7EJ4AbmjEB3r047r3DXWu3Y= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -174,8 +190,8 @@ github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/cobra v0.0.7 h1:FfTH+vuMXOas8jmfb5/M7dzEYx7LpcLb7a0LPe34uOU= +github.com/spf13/cobra v0.0.7/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= @@ -183,7 +199,7 @@ github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.6.2 h1:7aKfF+e8/k68gda3LOjo5RxiUqddoFxVq4BKBPrxk5E= github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -192,41 +208,50 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/wealdtech/eth2-signer-api v1.2.0 h1:AL4bRJDW6lyRc0ROPruVTEHt7Xs+EV2lRBPen2plOr8= +github.com/wealdtech/eth2-signer-api v1.2.0/go.mod h1:H8OpAoTBl6CaBvZEnhxWDjjWXNc3kwVFKWMAZd6sHlk= github.com/wealdtech/go-bytesutil v1.0.0/go.mod h1:jENeMqeTEU8FNZyDFRVc7KqBdRKSnJ9CCh26TcuNb9s= github.com/wealdtech/go-bytesutil v1.0.1 h1:6xzMM+VEHf5WNh1PsIFcRwScgcno+CP8Rw1rGvT6Cew= github.com/wealdtech/go-bytesutil v1.0.1/go.mod h1:jENeMqeTEU8FNZyDFRVc7KqBdRKSnJ9CCh26TcuNb9s= github.com/wealdtech/go-bytesutil v1.1.0 h1:6XrN7OIQhhBjQy/PZ1HZ3ySE8v8UDyxzERkOgmsIc1g= github.com/wealdtech/go-bytesutil v1.1.0/go.mod h1:jENeMqeTEU8FNZyDFRVc7KqBdRKSnJ9CCh26TcuNb9s= +github.com/wealdtech/go-bytesutil v1.1.1 h1:ocEg3Ke2GkZ4vQw5lp46rmO+pfqCCTgq35gqOy8JKVc= +github.com/wealdtech/go-bytesutil v1.1.1/go.mod h1:jENeMqeTEU8FNZyDFRVc7KqBdRKSnJ9CCh26TcuNb9s= github.com/wealdtech/go-ecodec v1.1.0 h1:yggrTSckcPJRaxxOxQF7FPm21kgE8WA6+f5jdq5Kr8o= github.com/wealdtech/go-ecodec v1.1.0/go.mod h1:PSdBFEB6cltdT7V4E1jbboufMZTZXcQOKG/2PeEjKK4= github.com/wealdtech/go-eth2-types v1.0.0 h1:ggrbQ5HeFcxVm20zxVWr8Sc3uCditaetzWB/Ax/4g0w= github.com/wealdtech/go-eth2-types v1.0.0/go.mod h1:fWUgtKQ7hiNVl6263bGeyjlydYuaxkxcUIPIopgz2CM= -github.com/wealdtech/go-eth2-util v1.1.0 h1:bDgNEtH5LoxI1JaBPUgHoPKmfPwtGuLw487U7AoMO6E= -github.com/wealdtech/go-eth2-util v1.1.0/go.mod h1:mX11133nOroRPHp3qXyAqT5iLmsZXQmpH2DZWWeFWP8= -github.com/wealdtech/go-eth2-wallet v1.9.1 h1:7UB3TaNz14oCb4Stwc+yAVxFzm/SXsz+d+SgsFWi1uU= -github.com/wealdtech/go-eth2-wallet v1.9.1/go.mod h1:VIuvk0JIQCl0JpbThUKy/ZR4ZXrcMEEimECAVs9n5nM= +github.com/wealdtech/go-eth2-types/v2 v2.0.2 h1:L1Eg55aArRpUR2H8dnpSevHlSGRDuRQbQwA4IyYh0Js= +github.com/wealdtech/go-eth2-types/v2 v2.0.2/go.mod h1:CXyZc4kcDaJ+s2SglGofkbHbSjXC6zFwKLJpEVYm5tw= +github.com/wealdtech/go-eth2-util v1.1.2 h1:m56HKJgWSuNy53Gt5GN7HcoFaGRCl1uE3OGWhIhWh1M= +github.com/wealdtech/go-eth2-util v1.1.2/go.mod h1:6Enc18JSH8FDy0sv/4ydEBbfoh3EOF++3HqLd66sO3M= +github.com/wealdtech/go-eth2-wallet v1.9.2 h1:H/T1n0SNd0jTsbf4rA4YxigsBPFWRUWgobsTOjzW4Hw= +github.com/wealdtech/go-eth2-wallet v1.9.2/go.mod h1:4BI4RrSDF2p41bqlen8Srydbh6dmru3/XExneRNB9sM= github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.0.0 h1:IcpS4VpXhYz+TVupB5n6C6IQzaKwG+Rc8nvgCa/da4c= github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.0.0/go.mod h1:X8WRO5hEwbjx8ZOqoRmtS1ngyflKs25GkP7qGv7yOqE= -github.com/wealdtech/go-eth2-wallet-hd v1.10.0 h1:rWpJRWXrnLGLadSOIhCqxAkSIOd93knxxUVxvScV/qw= -github.com/wealdtech/go-eth2-wallet-hd v1.10.0/go.mod h1:LiuHHIG7pU/u598yZBqsjWk0p5LmclxdPQeUSKJJwkg= -github.com/wealdtech/go-eth2-wallet-nd v1.8.0 h1:DD7QRS3mPS6GH0vNFn2DcJ3mHRgc+gtQ0Uq189pWZ00= -github.com/wealdtech/go-eth2-wallet-nd v1.8.0/go.mod h1:o0nR55vuaKZ4d+FuzzDhapu0LBQvk5CUER7ZCg1IYH8= -github.com/wealdtech/go-eth2-wallet-store-filesystem v1.7.0 h1:SJ1yx0K9bk/W7M7lSiOVIm2Trs0FTlQ3wkAfOIl82qk= -github.com/wealdtech/go-eth2-wallet-store-filesystem v1.7.0/go.mod h1:XM1bKpfV6dPdygA1HMO7vx1Vxlir8VMa649mcD2uudg= -github.com/wealdtech/go-eth2-wallet-store-s3 v1.6.0 h1:Xuq7JJ1DE8eGY6n3E/a+lgyySB7mvudAFaNbdEo+Srk= -github.com/wealdtech/go-eth2-wallet-store-s3 v1.6.0/go.mod h1:OjE3G9zCPgJs/W4EVpvIIg+d8X/I8uA1bR9ZVBwf22M= +github.com/wealdtech/go-eth2-wallet-hd/v2 v2.0.0 h1:oqE/+zFOKteklEemecMWGlyNmPv+5OBaHmAo1LKG6LE= +github.com/wealdtech/go-eth2-wallet-hd/v2 v2.0.0/go.mod h1:TSlcDpdQhmdrWoak8vrsSneemAGCh7UkaVfUbPO4jEc= +github.com/wealdtech/go-eth2-wallet-nd/v2 v2.0.0 h1:nWsbiaSVa1kwRdwPX5NfXsrowlRBjqoRpDv37i8ZecE= +github.com/wealdtech/go-eth2-wallet-nd/v2 v2.0.0/go.mod h1:uX7B88HXkMY/cVK2+hNz+sgbCMZE/DcDOLH86+2B8nA= +github.com/wealdtech/go-eth2-wallet-store-filesystem v1.7.1 h1:px7vV01opCUeeHjvdiBdkPbdnr60Ygq01Ddjy4dIbfg= +github.com/wealdtech/go-eth2-wallet-store-filesystem v1.7.1/go.mod h1:zNPP5si4rr4qZ8lwNt1+O7Boev8AgAJNnGrZNAxtwh4= +github.com/wealdtech/go-eth2-wallet-store-s3 v1.6.1 h1:f86TIVHqYkmDYc8VLsiIJ/KbGtNMeCGhkefqpXUVmYE= +github.com/wealdtech/go-eth2-wallet-store-s3 v1.6.1/go.mod h1:LZJyGLcwWVukaMfxPEsQebRhHNyw+PaVkDV8vFwe9BI= github.com/wealdtech/go-eth2-wallet-store-scratch v1.3.0 h1:iC0pZQY9zfh1onYHwnkiQa6V998LVK54U5ShUu7QTf8= github.com/wealdtech/go-eth2-wallet-store-scratch v1.3.0/go.mod h1:NaV/et5zTaqHhTpdpSveUYE2czCFAD8f07eABh/0pso= github.com/wealdtech/go-eth2-wallet-types v1.8.0 h1:6K/u5CTcUavgzoABeeuBAZ0jp1qEOdK/9U8gaMJUlVE= github.com/wealdtech/go-eth2-wallet-types v1.8.0/go.mod h1:5A83MUBhmLgxpg9X5eqvnDIOYfn329caf5DOcv7pcY0= github.com/wealdtech/go-eth2-wallet-types v1.10.0 h1:iQx3MxMQQwoEfyPDHy5vtKYVtrUjY4nzEODbUPcz2bg= github.com/wealdtech/go-eth2-wallet-types v1.10.0/go.mod h1:vwK05jlJM/ibZs/QCqJ4dOhsjjpNcIP4X7Vx6WYXLGI= +github.com/wealdtech/go-eth2-wallet-types/v2 v2.0.0 h1:EyTwHO7zXtYkf62h3MqSB3OWc8pv0dnFl41yykUJY3s= +github.com/wealdtech/go-eth2-wallet-types/v2 v2.0.0/go.mod h1:FWaLEUjjRHbJWJtzrWjj+66UAQgzGaLlgIsKZckMAGc= github.com/wealdtech/go-indexer v1.0.0 h1:/S4rfWQbSOnnYmwnvuTVatDibZ8o1s9bmTCHO16XINg= github.com/wealdtech/go-indexer v1.0.0/go.mod h1:u1cjsbsOXsm5jzJDyLmZY7GsrdX8KYXKBXkZcAmk3Zg= github.com/wealdtech/go-string2eth v1.1.0 h1:USJQmysUrBYYmZs7d45pMb90hRSyEwizP7lZaOZLDAw= @@ -240,19 +265,15 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045/go.mod h1:cYlCBUl1MsqxdiKgmc4uh7TxZfWSFLOGSRR090WDxt8= golang.org/x/arch v0.0.0-20190312162104-788fe5ffcd8c/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7 h1:0hQKqeLdqlt5iIwVOBErRisrHJAN57yOiPRQItI20fU= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191105034135-c7e5f84aec59 h1:PyXRxSVbvzDGuqYXjHndV7xDzJ7w2K8KD9Ef8GB7KOE= golang.org/x/crypto v0.0.0-20191105034135-c7e5f84aec59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c h1:/nJuwDLoL/zrqY6gf57vxC+Pi+pZ8bfhpPkicO5H7W4= -golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200208060501-ecb85df21340 h1:KOcEaR10tFr7gdJV2GCKw8Os5yED1u1aOqHjOAb6d2Y= -golang.org/x/crypto v0.0.0-20200208060501-ecb85df21340/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6 h1:Sy5bstxEqwwbYs6n0/pBuxKENqOeZUgD45Gp3Q3pqLg= -golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 h1:3zb4D3T4G8jdExgVU/95+vQXfpEPiMdCaZgmGVxjNHM= +golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -269,26 +290,27 @@ golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190322080309-f49334f85ddc/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e h1:N7DeIrjYszNmSW409R3frPPwglRwMkXSBzwVbkOjLLA= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4 h1:sfkvUWPNGwSV+8/fNqctR5lS2AqCSqYwXdrjCxp/dXo= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200301204400-5d559ad92b82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775 h1:TC0v2RSO1u2kn1ZugjrFXkRZAEaqMN/RW+OTZkBzmLE= +golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -302,23 +324,32 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190325223049-1d95b17f1b04/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce h1:1mbrb1tUU+Zmt5C94IGKADBTJZjZXAd+BubWi7r9EiI= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200330113809-af700f360a68 h1:ay2fio+sR6N1ccqZQgr/bUoo6pwgbxU8imlLkQc9Nlo= +google.golang.org/genproto v0.0.0-20200330113809-af700f360a68/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.21.0 h1:G+97AoqBnmZIT91cLG/EkCoK9NSelj64P8bOHHNmGn0= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.20.1 h1:ESRXHgpUBG5D2I5mmsQIyYxB/tQIZfSZ8wLyFDf/N/U= +google.golang.org/protobuf v1.20.1/go.mod h1:KqelGeouBkcbcuB3HCk4/YH2tmNLk6YSWA5LIWeI/lY= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -326,8 +357,8 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogR gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.52.0 h1:j+Lt/M1oPPejkniCg1TkWE2J3Eh1oZTsHSXzMTzUXn4= -gopkg.in/ini.v1 v1.52.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.55.0 h1:E8yzL5unfpW3M6fz/eB7Cb5MQAYSZ7GKo4Qth+N2sgQ= +gopkg.in/ini.v1 v1.55.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From afcbd177a3b6af89843a04142e2fe7f0f21ec0ac Mon Sep 17 00:00:00 2001 From: Jim McDonald Date: Wed, 8 Apr 2020 10:20:51 +0100 Subject: [PATCH 2/3] Tidy-ups --- cmd/accountimport.go | 2 +- cmd/accountkey.go | 2 +- cmd/root.go | 18 ++++++++++-------- cmd/signaturesign.go | 7 ++++--- cmd/signatureverify.go | 7 ++++--- cmd/validatordepositdata.go | 6 +++--- cmd/validatorexit.go | 8 ++++---- cmd/validatorinfo.go | 2 +- cmd/walletexport.go | 2 +- cmd/walletinfo.go | 2 +- cmd/walletseed.go | 2 +- go.mod | 2 ++ grpc/beaconchain.go | 2 +- grpc/beaconnode.go | 2 +- util/scratchaccount.go | 4 ++-- 15 files changed, 37 insertions(+), 31 deletions(-) diff --git a/cmd/accountimport.go b/cmd/accountimport.go index 6da2f59..3f279b0 100644 --- a/cmd/accountimport.go +++ b/cmd/accountimport.go @@ -19,7 +19,7 @@ import ( "github.com/spf13/cobra" "github.com/wealdtech/go-bytesutil" - types "github.com/wealdtech/go-eth2-wallet-types" + types "github.com/wealdtech/go-eth2-wallet-types/v2" ) var accountImportKey string diff --git a/cmd/accountkey.go b/cmd/accountkey.go index b71918a..1cbaed6 100644 --- a/cmd/accountkey.go +++ b/cmd/accountkey.go @@ -18,7 +18,7 @@ import ( "os" "github.com/spf13/cobra" - types "github.com/wealdtech/go-eth2-wallet-types" + types "github.com/wealdtech/go-eth2-wallet-types/v2" ) // accountKeyCmd represents the account key command diff --git a/cmd/root.go b/cmd/root.go index 6f1bc66..1d21d7b 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -17,7 +17,6 @@ import ( "context" "crypto/tls" "crypto/x509" - "errors" "fmt" "io/ioutil" "os" @@ -27,14 +26,15 @@ import ( "time" homedir "github.com/mitchellh/go-homedir" + "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" - types "github.com/wealdtech/go-eth2-types" + types "github.com/wealdtech/go-eth2-types/v2" "google.golang.org/grpc" "google.golang.org/grpc/credentials" wallet "github.com/wealdtech/go-eth2-wallet" - wtypes "github.com/wealdtech/go-eth2-wallet-types" + wtypes "github.com/wealdtech/go-eth2-wallet-types/v2" ) var cfgFile string @@ -336,12 +336,14 @@ func accountsFromPath(path string) ([]wtypes.Account, error) { } // sign signs data in a domain. -func sign(account wtypes.Account, data []byte, domain uint64) (types.Signature, error) { +func sign(account wtypes.Account, data []byte, domain []byte) (types.Signature, error) { if !account.IsUnlocked() { return nil, errors.New("account must be unlocked to sign") } - return account.Sign(data, domain) + // TODO combine data and domain for signing. + + return account.Sign(data) } // addTransactionFlags adds flags used in all transactions. @@ -381,7 +383,7 @@ func initRemote() error { // Load the client certificates. clientPair, err := tls.LoadX509KeyPair(clientCert, clientKey) if err != nil { - return err + return errors.Wrap(err, "failed to access client certificate/key") } tlsCfg := &tls.Config{ @@ -391,11 +393,11 @@ func initRemote() error { // Load the CA for the server certificate. serverCA, err := ioutil.ReadFile(serverCACert) if err != nil { - return err + return errors.Wrap(err, "failed to access CA certificate") } cp := x509.NewCertPool() if !cp.AppendCertsFromPEM(serverCA) { - return err + return errors.Wrap(err, "failed to add CA certificate") } tlsCfg.RootCAs = cp } diff --git a/cmd/signaturesign.go b/cmd/signaturesign.go index b929f9b..354bf81 100644 --- a/cmd/signaturesign.go +++ b/cmd/signaturesign.go @@ -22,7 +22,7 @@ import ( "github.com/spf13/viper" pb "github.com/wealdtech/eth2-signer-api/pb/v1" "github.com/wealdtech/go-bytesutil" - types "github.com/wealdtech/go-eth2-types" + types "github.com/wealdtech/go-eth2-types/v2" ) // signatureSignCmd represents the signature sign command @@ -55,7 +55,7 @@ In quiet mode this will return 0 if the data can be signed, otherwise 1.`, signReq := &pb.SignRequest{ Id: &pb.SignRequest_Account{Account: rootAccount}, Data: data, - Domain: domainBytes[:], + Domain: domainBytes, } ctx, cancel := context.WithTimeout(context.Background(), viper.GetDuration("timeout")) defer cancel() @@ -76,7 +76,8 @@ In quiet mode this will return 0 if the data can be signed, otherwise 1.`, err = account.Unlock([]byte(rootAccountPassphrase)) errCheck(err, "Failed to unlock account for signing") defer account.Lock() - signature, err = account.Sign(data, domain) + // TODO fix domain. + signature, err = sign(account, data, []byte{}) errCheck(err, "Failed to sign data") } diff --git a/cmd/signatureverify.go b/cmd/signatureverify.go index 85263c8..9f45fec 100644 --- a/cmd/signatureverify.go +++ b/cmd/signatureverify.go @@ -20,7 +20,7 @@ import ( "github.com/spf13/cobra" pb "github.com/wealdtech/eth2-signer-api/pb/v1" "github.com/wealdtech/go-bytesutil" - types "github.com/wealdtech/go-eth2-types" + types "github.com/wealdtech/go-eth2-types/v2" ) var signatureVerifySignature string @@ -46,7 +46,7 @@ In quiet mode this will return 0 if the data can be signed, otherwise 1.`, signature, err := types.BLSSignatureFromBytes(signatureBytes) errCheck(err, "Invalid signature") - domain := types.Domain([]byte{0, 0, 0, 0}, []byte{0, 0, 0, 0}) + // domain := types.Domain([]byte{0, 0, 0, 0}, []byte{0, 0, 0, 0}) if signatureDomain != "" { domainBytes, err := bytesutil.FromHexString(signatureDomain) errCheck(err, "Failed to parse domain") @@ -80,7 +80,8 @@ In quiet mode this will return 0 if the data can be signed, otherwise 1.`, pubKey, err = types.BLSPublicKeyFromBytes(pubKeyBytes) errCheck(err, "Invalid public key") } - verified := signature.Verify(data, pubKey, domain) + // TODO data + domain -> root + verified := signature.Verify(data, pubKey) if !verified { outputIf(!quiet, "Not verified") os.Exit(_exitFailure) diff --git a/cmd/validatordepositdata.go b/cmd/validatordepositdata.go index 55fcfe8..4897c8c 100644 --- a/cmd/validatordepositdata.go +++ b/cmd/validatordepositdata.go @@ -20,7 +20,6 @@ import ( "github.com/prysmaticlabs/go-ssz" "github.com/spf13/cobra" - types "github.com/wealdtech/go-eth2-types" util "github.com/wealdtech/go-eth2-util" string2eth "github.com/wealdtech/go-string2eth" ) @@ -88,10 +87,11 @@ In quiet mode this will return 0 if the the data can be generated correctly, oth signingRoot, err := ssz.HashTreeRoot(depositData) errCheck(err, "Failed to generate deposit data signing root") outputIf(debug, fmt.Sprintf("Signing root is %x", signingRoot)) - domain := types.Domain(types.DomainDeposit, []byte{0, 0, 0, 0}) + // domain := types.Domain(types.DomainDeposit, []byte{0, 0, 0, 0}) err = validatorAccount.Unlock([]byte(rootAccountPassphrase)) errCheck(err, "Failed to unlock validator account") - signature, err := validatorAccount.Sign(signingRoot[:], domain) + // TODO data + domain -> root + signature, err := validatorAccount.Sign(signingRoot[:]) validatorAccount.Lock() errCheck(err, "Failed to sign deposit data signing root") diff --git a/cmd/validatorexit.go b/cmd/validatorexit.go index ea83254..3e71d9b 100644 --- a/cmd/validatorexit.go +++ b/cmd/validatorexit.go @@ -24,7 +24,6 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/wealdtech/ethdo/grpc" - types "github.com/wealdtech/go-eth2-types" ) var validatorExitEpoch int64 @@ -82,12 +81,13 @@ In quiet mode this will return 0 if the transaction has been sent, otherwise 1.` root, err := ssz.HashTreeRoot(exit) errCheck(err, "Failed to generate exit proposal root") // TODO fetch current fork version from config (currently using genesis fork version) - currentForkVersion := config["GenesisForkVersion"].([]byte) - domain := types.Domain(types.DomainVoluntaryExit, currentForkVersion) + // currentForkVersion := config["GenesisForkVersion"].([]byte) + // domain := types.Domain(types.DomainVoluntaryExit, currentForkVersion) err = account.Unlock([]byte(rootAccountPassphrase)) errCheck(err, "Failed to unlock account; please confirm passphrase is correct") - signature, err := sign(account, root[:], domain) + // TODO supply domain + signature, err := sign(account, root[:], []byte{}) errCheck(err, "Failed to sign exit proposal") proposal := ðpb.SignedVoluntaryExit{ diff --git a/cmd/validatorinfo.go b/cmd/validatorinfo.go index d15dd6c..28a9aaf 100644 --- a/cmd/validatorinfo.go +++ b/cmd/validatorinfo.go @@ -24,7 +24,7 @@ import ( "github.com/spf13/cobra" "github.com/wealdtech/ethdo/grpc" "github.com/wealdtech/ethdo/util" - types "github.com/wealdtech/go-eth2-wallet-types" + types "github.com/wealdtech/go-eth2-wallet-types/v2" string2eth "github.com/wealdtech/go-string2eth" ) diff --git a/cmd/walletexport.go b/cmd/walletexport.go index e91a156..8aa6a55 100644 --- a/cmd/walletexport.go +++ b/cmd/walletexport.go @@ -18,7 +18,7 @@ import ( "os" "github.com/spf13/cobra" - types "github.com/wealdtech/go-eth2-wallet-types" + types "github.com/wealdtech/go-eth2-wallet-types/v2" ) var walletExportPassphrase string diff --git a/cmd/walletinfo.go b/cmd/walletinfo.go index dc548b0..fb89237 100644 --- a/cmd/walletinfo.go +++ b/cmd/walletinfo.go @@ -18,7 +18,7 @@ import ( "os" "github.com/spf13/cobra" - wtypes "github.com/wealdtech/go-eth2-wallet-types" + wtypes "github.com/wealdtech/go-eth2-wallet-types/v2" ) var walletInfoCmd = &cobra.Command{ diff --git a/cmd/walletseed.go b/cmd/walletseed.go index 8f01695..628dea0 100644 --- a/cmd/walletseed.go +++ b/cmd/walletseed.go @@ -19,7 +19,7 @@ import ( bip39 "github.com/FactomProject/go-bip39" "github.com/spf13/cobra" - types "github.com/wealdtech/go-eth2-wallet-types" + types "github.com/wealdtech/go-eth2-wallet-types/v2" ) var walletSeedCmd = &cobra.Command{ diff --git a/go.mod b/go.mod index 664b999..dfa4949 100644 --- a/go.mod +++ b/go.mod @@ -32,9 +32,11 @@ require ( github.com/wealdtech/eth2-signer-api v1.2.0 github.com/wealdtech/go-bytesutil v1.1.1 github.com/wealdtech/go-eth2-types v1.0.0 + github.com/wealdtech/go-eth2-types/v2 v2.0.2 github.com/wealdtech/go-eth2-util v1.1.2 github.com/wealdtech/go-eth2-wallet v1.9.2 github.com/wealdtech/go-eth2-wallet-types v1.10.0 + github.com/wealdtech/go-eth2-wallet-types/v2 v2.0.0 github.com/wealdtech/go-string2eth v1.1.0 golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 // indirect golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // indirect diff --git a/grpc/beaconchain.go b/grpc/beaconchain.go index 8a011c1..883af1c 100644 --- a/grpc/beaconchain.go +++ b/grpc/beaconchain.go @@ -24,7 +24,7 @@ import ( "github.com/golang/protobuf/ptypes/empty" ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" - wtypes "github.com/wealdtech/go-eth2-wallet-types" + wtypes "github.com/wealdtech/go-eth2-wallet-types/v2" ) // FetchChainConfig fetches the chain configuration from the beacon node. diff --git a/grpc/beaconnode.go b/grpc/beaconnode.go index 85a2bc5..ff19802 100644 --- a/grpc/beaconnode.go +++ b/grpc/beaconnode.go @@ -20,7 +20,7 @@ import ( "google.golang.org/grpc" ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" - wtypes "github.com/wealdtech/go-eth2-wallet-types" + wtypes "github.com/wealdtech/go-eth2-wallet-types/v2" ) // FetchValidatorIndex fetches the index of a validator. diff --git a/util/scratchaccount.go b/util/scratchaccount.go index 72bfe5f..a56f3c9 100644 --- a/util/scratchaccount.go +++ b/util/scratchaccount.go @@ -17,7 +17,7 @@ import ( "errors" "github.com/google/uuid" - types "github.com/wealdtech/go-eth2-types" + types "github.com/wealdtech/go-eth2-types/v2" ) // ScratchAccount is an account that exists temporarily. @@ -66,6 +66,6 @@ func (a *ScratchAccount) IsUnlocked() bool { return false } -func (a *ScratchAccount) Sign(data []byte, domain uint64) (types.Signature, error) { +func (a *ScratchAccount) Sign(data []byte) (types.Signature, error) { return nil, errors.New("Not implemented") } From be3fd8edd27fd08b01624c37564575224a9cbd2e Mon Sep 17 00:00:00 2001 From: Jim McDonald Date: Thu, 9 Apr 2020 21:03:10 +0100 Subject: [PATCH 3/3] Use 0.11 style domains --- cmd/root.go | 39 ++++++++++++++++++++++++++++++++----- cmd/signaturesign.go | 23 +++++++++++----------- cmd/signatureverify.go | 28 ++++++++++++++++---------- cmd/validatordepositdata.go | 13 +++++-------- cmd/validatorexit.go | 13 ++++++------- go.mod | 7 +++---- go.sum | 6 ++++-- 7 files changed, 82 insertions(+), 47 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 1d21d7b..546b6f5 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -27,9 +27,10 @@ import ( homedir "github.com/mitchellh/go-homedir" "github.com/pkg/errors" + "github.com/prysmaticlabs/go-ssz" "github.com/spf13/cobra" "github.com/spf13/viper" - types "github.com/wealdtech/go-eth2-types/v2" + e2types "github.com/wealdtech/go-eth2-types/v2" "google.golang.org/grpc" "google.golang.org/grpc/credentials" @@ -335,14 +336,42 @@ func accountsFromPath(path string) ([]wtypes.Account, error) { return accounts, nil } -// sign signs data in a domain. -func sign(account wtypes.Account, data []byte, domain []byte) (types.Signature, error) { +// signStruct signs an arbitrary structure. +func signStruct(account wtypes.Account, data interface{}, domain []byte) (e2types.Signature, error) { + objRoot, err := ssz.HashTreeRoot(data) + if err != nil { + return nil, err + } + + return signRoot(account, objRoot, domain) +} + +// SigningContainer is the container for signing roots with a domain. +// Contains SSZ sizes to allow for correct calculation of root. +type SigningContainer struct { + Root []byte `ssz-size:"32"` + Domain []byte `ssz-size:"32"` +} + +// signRoot signs a root. +func signRoot(account wtypes.Account, root [32]byte, domain []byte) (e2types.Signature, error) { + container := &SigningContainer{ + Root: root[:], + Domain: domain, + } + signingRoot, err := ssz.HashTreeRoot(container) + if err != nil { + return nil, err + } + return sign(account, signingRoot[:]) +} + +// sign signs arbitrary data. +func sign(account wtypes.Account, data []byte) (e2types.Signature, error) { if !account.IsUnlocked() { return nil, errors.New("account must be unlocked to sign") } - // TODO combine data and domain for signing. - return account.Sign(data) } diff --git a/cmd/signaturesign.go b/cmd/signaturesign.go index 354bf81..5903a4b 100644 --- a/cmd/signaturesign.go +++ b/cmd/signaturesign.go @@ -22,40 +22,40 @@ import ( "github.com/spf13/viper" pb "github.com/wealdtech/eth2-signer-api/pb/v1" "github.com/wealdtech/go-bytesutil" - types "github.com/wealdtech/go-eth2-types/v2" + e2types "github.com/wealdtech/go-eth2-types/v2" ) // signatureSignCmd represents the signature sign command var signatureSignCmd = &cobra.Command{ Use: "sign", - Short: "Sign data", + Short: "Sign a 32-byte piece of data", Long: `Sign presented data. For example: - ethereal signature sign --data="0x5FfC014343cd971B7eb70732021E26C35B744cc4" --account="Personal wallet/Operations" --passphrase="my account passphrase" + ethereal signature sign --data=0x5f24e819400c6a8ee2bfc014343cd971b7eb707320025a7bcd83e621e26c35b7 --account="Personal wallet/Operations" --passphrase="my account passphrase" In quiet mode this will return 0 if the data can be signed, otherwise 1.`, Run: func(cmd *cobra.Command, args []string) { assert(signatureData != "", "--data is required") data, err := bytesutil.FromHexString(signatureData) errCheck(err, "Failed to parse data") + assert(len(data) == 32, "data to sign must be 32 bytes") - domain := types.Domain([]byte{0, 0, 0, 0}, []byte{0, 0, 0, 0}) + domain := e2types.Domain(e2types.DomainType([4]byte{0, 0, 0, 0}), e2types.ZeroForkVersion, e2types.ZeroGenesisValidatorsRoot) if signatureDomain != "" { domainBytes, err := bytesutil.FromHexString(signatureDomain) errCheck(err, "Failed to parse domain") - assert(len(domainBytes) == 8, "Domain data invalid") + assert(len(domainBytes) == 32, "Domain data invalid") } assert(rootAccount != "", "--account is required") - var signature types.Signature + var signature e2types.Signature if remote { signClient := pb.NewSignerClient(remoteGRPCConn) - domainBytes := bytesutil.Bytes64(domain) signReq := &pb.SignRequest{ Id: &pb.SignRequest_Account{Account: rootAccount}, Data: data, - Domain: domainBytes, + Domain: domain, } ctx, cancel := context.WithTimeout(context.Background(), viper.GetDuration("timeout")) defer cancel() @@ -67,7 +67,7 @@ In quiet mode this will return 0 if the data can be signed, otherwise 1.`, case pb.ResponseState_FAILED: die("Signing request failed") case pb.ResponseState_SUCCEEDED: - signature, err = types.BLSSignatureFromBytes(resp.Signature) + signature, err = e2types.BLSSignatureFromBytes(resp.Signature) errCheck(err, "Invalid signature") } } else { @@ -75,9 +75,10 @@ In quiet mode this will return 0 if the data can be signed, otherwise 1.`, errCheck(err, "Failed to access account for signing") err = account.Unlock([]byte(rootAccountPassphrase)) errCheck(err, "Failed to unlock account for signing") + var fixedSizeData [32]byte + copy(fixedSizeData[:], data) defer account.Lock() - // TODO fix domain. - signature, err = sign(account, data, []byte{}) + signature, err = signRoot(account, fixedSizeData, domain) errCheck(err, "Failed to sign data") } diff --git a/cmd/signatureverify.go b/cmd/signatureverify.go index 9f45fec..2c9656f 100644 --- a/cmd/signatureverify.go +++ b/cmd/signatureverify.go @@ -17,10 +17,11 @@ import ( "context" "os" + "github.com/prysmaticlabs/go-ssz" "github.com/spf13/cobra" pb "github.com/wealdtech/eth2-signer-api/pb/v1" "github.com/wealdtech/go-bytesutil" - types "github.com/wealdtech/go-eth2-types/v2" + e2types "github.com/wealdtech/go-eth2-types/v2" ) var signatureVerifySignature string @@ -32,28 +33,29 @@ var signatureVerifyCmd = &cobra.Command{ Short: "Verify signed data", Long: `Verify signed data. For example: - ethereal signature verify --data="0x5FfC014343cd971B7eb70732021E26C35B744cc4" --signature="0x8888..." --account="Personal wallet/Operations" + ethereal signature verify --data=0x5f24e819400c6a8ee2bfc014343cd971b7eb707320025a7bcd83e621e26c35b7 --signature=0x8888... --account="Personal wallet/Operations" In quiet mode this will return 0 if the data can be signed, otherwise 1.`, Run: func(cmd *cobra.Command, args []string) { assert(signatureData != "", "--data is required") data, err := bytesutil.FromHexString(signatureData) errCheck(err, "Failed to parse data") + assert(len(data) == 32, "data to verify must be 32 bytes") assert(signatureVerifySignature != "", "--signature is required") signatureBytes, err := bytesutil.FromHexString(signatureVerifySignature) errCheck(err, "Failed to parse signature") - signature, err := types.BLSSignatureFromBytes(signatureBytes) + signature, err := e2types.BLSSignatureFromBytes(signatureBytes) errCheck(err, "Invalid signature") - // domain := types.Domain([]byte{0, 0, 0, 0}, []byte{0, 0, 0, 0}) + domain := e2types.Domain(e2types.DomainType([4]byte{0, 0, 0, 0}), e2types.ZeroForkVersion, e2types.ZeroGenesisValidatorsRoot) if signatureDomain != "" { domainBytes, err := bytesutil.FromHexString(signatureDomain) errCheck(err, "Failed to parse domain") - assert(len(domainBytes) == 8, "Domain data invalid") + assert(len(domainBytes) == 32, "Domain data invalid") } - var pubKey types.PublicKey + var pubKey e2types.PublicKey assert(signatureVerifyPubKey == "" || rootAccount == "", "Either --pubkey or --account should be supplied") if rootAccount != "" { if remote { @@ -67,7 +69,7 @@ In quiet mode this will return 0 if the data can be signed, otherwise 1.`, errCheck(err, "Failed to access account") assert(resp.State == pb.ResponseState_SUCCEEDED, "Failed to obtain account") assert(len(resp.Accounts) == 1, "No such account") - pubKey, err = types.BLSPublicKeyFromBytes(resp.Accounts[0].PublicKey) + pubKey, err = e2types.BLSPublicKeyFromBytes(resp.Accounts[0].PublicKey) errCheck(err, "Invalid public key provided for account") } else { account, err := accountFromPath(rootAccount) @@ -77,11 +79,17 @@ In quiet mode this will return 0 if the data can be signed, otherwise 1.`, } else { pubKeyBytes, err := bytesutil.FromHexString(signatureVerifyPubKey) errCheck(err, "Invalid public key") - pubKey, err = types.BLSPublicKeyFromBytes(pubKeyBytes) + pubKey, err = e2types.BLSPublicKeyFromBytes(pubKeyBytes) errCheck(err, "Invalid public key") } - // TODO data + domain -> root - verified := signature.Verify(data, pubKey) + container := &SigningContainer{ + Root: data, + Domain: domain, + } + root, err := ssz.HashTreeRoot(container) + errCheck(err, "Failed to create signing root") + + verified := signature.Verify(root[:], pubKey) if !verified { outputIf(!quiet, "Not verified") os.Exit(_exitFailure) diff --git a/cmd/validatordepositdata.go b/cmd/validatordepositdata.go index 4897c8c..a61b6ce 100644 --- a/cmd/validatordepositdata.go +++ b/cmd/validatordepositdata.go @@ -1,4 +1,4 @@ -// Copyright © 2019 Weald Technology Trading +// Copyright © 2019, 2020 Weald Technology Trading // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -20,6 +20,7 @@ import ( "github.com/prysmaticlabs/go-ssz" "github.com/spf13/cobra" + e2types "github.com/wealdtech/go-eth2-types/v2" util "github.com/wealdtech/go-eth2-util" string2eth "github.com/wealdtech/go-string2eth" ) @@ -84,16 +85,12 @@ In quiet mode this will return 0 if the the data can be generated correctly, oth WithdrawalCredentials: withdrawalCredentials, Value: val, } - signingRoot, err := ssz.HashTreeRoot(depositData) - errCheck(err, "Failed to generate deposit data signing root") - outputIf(debug, fmt.Sprintf("Signing root is %x", signingRoot)) - // domain := types.Domain(types.DomainDeposit, []byte{0, 0, 0, 0}) + domain := e2types.Domain(e2types.DomainDeposit, e2types.ZeroForkVersion, e2types.ZeroGenesisValidatorsRoot) err = validatorAccount.Unlock([]byte(rootAccountPassphrase)) errCheck(err, "Failed to unlock validator account") - // TODO data + domain -> root - signature, err := validatorAccount.Sign(signingRoot[:]) + signature, err := signStruct(validatorAccount, depositData, domain) validatorAccount.Lock() - errCheck(err, "Failed to sign deposit data signing root") + errCheck(err, "Failed to generate deposit data signature") signedDepositData := struct { PubKey []byte `ssz-size:"48"` diff --git a/cmd/validatorexit.go b/cmd/validatorexit.go index 3e71d9b..ec77f5e 100644 --- a/cmd/validatorexit.go +++ b/cmd/validatorexit.go @@ -20,10 +20,10 @@ import ( "time" ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" - ssz "github.com/prysmaticlabs/go-ssz" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/wealdtech/ethdo/grpc" + e2types "github.com/wealdtech/go-eth2-types/v2" ) var validatorExitEpoch int64 @@ -78,16 +78,15 @@ In quiet mode this will return 0 if the transaction has been sent, otherwise 1.` Epoch: currentEpoch, ValidatorIndex: index, } - root, err := ssz.HashTreeRoot(exit) - errCheck(err, "Failed to generate exit proposal root") // TODO fetch current fork version from config (currently using genesis fork version) - // currentForkVersion := config["GenesisForkVersion"].([]byte) - // domain := types.Domain(types.DomainVoluntaryExit, currentForkVersion) + currentForkVersion := config["GenesisForkVersion"].([]byte) + // TODO fetch genesis validators root from somewhere. + //domain := e2types.Domain(e2types.DomainVoluntaryExit, currentForkVersion, genesisValidatorsRoot) + domain := e2types.Domain(e2types.DomainVoluntaryExit, currentForkVersion, e2types.ZeroGenesisValidatorsRoot) err = account.Unlock([]byte(rootAccountPassphrase)) errCheck(err, "Failed to unlock account; please confirm passphrase is correct") - // TODO supply domain - signature, err := sign(account, root[:], []byte{}) + signature, err := signStruct(account, exit, domain) errCheck(err, "Failed to sign exit proposal") proposal := ðpb.SignedVoluntaryExit{ diff --git a/go.mod b/go.mod index dfa4949..35d0b71 100644 --- a/go.mod +++ b/go.mod @@ -29,13 +29,12 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.6.2 - github.com/wealdtech/eth2-signer-api v1.2.0 + github.com/wealdtech/eth2-signer-api v1.3.0 github.com/wealdtech/go-bytesutil v1.1.1 - github.com/wealdtech/go-eth2-types v1.0.0 - github.com/wealdtech/go-eth2-types/v2 v2.0.2 + github.com/wealdtech/go-eth2-types/v2 v2.1.0 github.com/wealdtech/go-eth2-util v1.1.2 github.com/wealdtech/go-eth2-wallet v1.9.2 - github.com/wealdtech/go-eth2-wallet-types v1.10.0 + github.com/wealdtech/go-eth2-wallet-types v1.10.0 // indirect github.com/wealdtech/go-eth2-wallet-types/v2 v2.0.0 github.com/wealdtech/go-string2eth v1.1.0 golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 // indirect diff --git a/go.sum b/go.sum index 6daeba9..904c07b 100644 --- a/go.sum +++ b/go.sum @@ -215,8 +215,8 @@ github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69 github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/wealdtech/eth2-signer-api v1.2.0 h1:AL4bRJDW6lyRc0ROPruVTEHt7Xs+EV2lRBPen2plOr8= -github.com/wealdtech/eth2-signer-api v1.2.0/go.mod h1:H8OpAoTBl6CaBvZEnhxWDjjWXNc3kwVFKWMAZd6sHlk= +github.com/wealdtech/eth2-signer-api v1.3.0 h1:Fs0GfrdhboBKW7zaMvIvUHJaOB1ibpAmRG3lkB53in4= +github.com/wealdtech/eth2-signer-api v1.3.0/go.mod h1:H8OpAoTBl6CaBvZEnhxWDjjWXNc3kwVFKWMAZd6sHlk= github.com/wealdtech/go-bytesutil v1.0.0/go.mod h1:jENeMqeTEU8FNZyDFRVc7KqBdRKSnJ9CCh26TcuNb9s= github.com/wealdtech/go-bytesutil v1.0.1 h1:6xzMM+VEHf5WNh1PsIFcRwScgcno+CP8Rw1rGvT6Cew= github.com/wealdtech/go-bytesutil v1.0.1/go.mod h1:jENeMqeTEU8FNZyDFRVc7KqBdRKSnJ9CCh26TcuNb9s= @@ -230,6 +230,8 @@ github.com/wealdtech/go-eth2-types v1.0.0 h1:ggrbQ5HeFcxVm20zxVWr8Sc3uCditaetzWB github.com/wealdtech/go-eth2-types v1.0.0/go.mod h1:fWUgtKQ7hiNVl6263bGeyjlydYuaxkxcUIPIopgz2CM= github.com/wealdtech/go-eth2-types/v2 v2.0.2 h1:L1Eg55aArRpUR2H8dnpSevHlSGRDuRQbQwA4IyYh0Js= github.com/wealdtech/go-eth2-types/v2 v2.0.2/go.mod h1:CXyZc4kcDaJ+s2SglGofkbHbSjXC6zFwKLJpEVYm5tw= +github.com/wealdtech/go-eth2-types/v2 v2.1.0 h1:nGtVjYm4zb/YerzzsKOG48BWLayqJPpZwR1tRkb+PfI= +github.com/wealdtech/go-eth2-types/v2 v2.1.0/go.mod h1:CXyZc4kcDaJ+s2SglGofkbHbSjXC6zFwKLJpEVYm5tw= github.com/wealdtech/go-eth2-util v1.1.2 h1:m56HKJgWSuNy53Gt5GN7HcoFaGRCl1uE3OGWhIhWh1M= github.com/wealdtech/go-eth2-util v1.1.2/go.mod h1:6Enc18JSH8FDy0sv/4ydEBbfoh3EOF++3HqLd66sO3M= github.com/wealdtech/go-eth2-wallet v1.9.2 h1:H/T1n0SNd0jTsbf4rA4YxigsBPFWRUWgobsTOjzW4Hw=