Skip to content

Commit

Permalink
bugfix: from path tirm space
Browse files Browse the repository at this point in the history
  • Loading branch information
outprog committed Dec 19, 2020
1 parent 4781b91 commit 2e75386
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"crypto/ecdsa"
"io/ioutil"
"math/big"
"strings"

"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"io/ioutil"
"math/big"
"strings"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 2e75386

Please sign in to comment.