diff --git a/signer.go b/signer.go index 548aab0..6a60e29 100644 --- a/signer.go +++ b/signer.go @@ -4,6 +4,7 @@ import ( "crypto/ecdsa" "io/ioutil" "math/big" + "strings" "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" @@ -34,7 +35,7 @@ func NewSignerFromPath(prvPath string) (*Signer, error) { return nil, err } - return NewSigner(string(b)) + return NewSigner(strings.TrimSpace(string(b))) } func (s *Signer) SignTx( diff --git a/wallet.go b/wallet.go index 9225d64..336f6cf 100644 --- a/wallet.go +++ b/wallet.go @@ -4,6 +4,7 @@ import ( "fmt" "io/ioutil" "math/big" + "strings" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -57,7 +58,7 @@ func NewWalletFromPath(prvPath, rpc string) (*Wallet, error) { return nil, err } - return NewWallet(string(b), rpc) + return NewWallet(strings.TrimSpace(string(b)), rpc) } func (w *Wallet) SendTx(