Wrap errors (#3123)

This commit is contained in:
Preston Van Loon
2019-08-01 22:27:38 -04:00
committed by terence tsao
parent 7eca7ba43b
commit 953c59a302
73 changed files with 351 additions and 307 deletions

View File

@@ -31,6 +31,7 @@ go_library(
"@com_github_ethereum_go_ethereum//ethclient:go_default_library",
"@com_github_ethereum_go_ethereum//rpc:go_default_library",
"@com_github_gogo_protobuf//proto:go_default_library",
"@com_github_pkg_errors//:go_default_library",
"@com_github_prometheus_client_golang//prometheus:go_default_library",
"@com_github_prometheus_client_golang//prometheus/promauto:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
@@ -92,6 +93,7 @@ go_image(
"@com_github_ethereum_go_ethereum//ethclient:go_default_library",
"@com_github_ethereum_go_ethereum//rpc:go_default_library",
"@com_github_gogo_protobuf//proto:go_default_library",
"@com_github_pkg_errors//:go_default_library",
"@com_github_prometheus_client_golang//prometheus:go_default_library",
"@com_github_prometheus_client_golang//prometheus/promauto:go_default_library",
"@com_github_prysmaticlabs_go_ssz//:go_default_library",

View File

@@ -4,7 +4,6 @@ import (
"context"
"crypto/ecdsa"
"crypto/rand"
"fmt"
"math/big"
"sync"
@@ -13,6 +12,7 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/rpc"
"github.com/pkg/errors"
contracts "github.com/prysmaticlabs/prysm/contracts/deposit-contract"
pb "github.com/prysmaticlabs/prysm/proto/cluster"
"github.com/prysmaticlabs/prysm/shared/keystore"
@@ -70,7 +70,7 @@ func (s *server) makeDeposit(pubkey []byte, withdrawalCredentials []byte, signat
txOps.GasLimit = gasLimit
tx, err := s.contract.Deposit(txOps, pubkey, withdrawalCredentials, signature)
if err != nil {
return fmt.Errorf("deposit failed: %v", err)
return errors.Wrap(err, "deposit failed")
}
log.WithField("tx", tx.Hash().Hex()).Info("Deposit transaction sent")