Skip to content

Commit

Permalink
Use LatestSignerForChainID
Browse files Browse the repository at this point in the history
  • Loading branch information
teghnet committed May 23, 2022
1 parent cfdffc0 commit 21aded5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions hdwallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcutil/hdkeychain"
ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
Expand Down Expand Up @@ -280,13 +280,15 @@ func (w *Wallet) SignTx(account accounts.Account, tx *types.Transaction, chainID
return nil, err
}

signer := types.LatestSignerForChainID(chainID)

// Sign the transaction and verify the sender to avoid hardware fault surprises
signedTx, err := types.SignTx(tx, types.HomesteadSigner{}, privateKey)
signedTx, err := types.SignTx(tx, signer, privateKey)
if err != nil {
return nil, err
}

msg, err := signedTx.AsMessage(types.HomesteadSigner{}, baseFee)
msg, err := signedTx.AsMessage(signer, baseFee)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 21aded5

Please sign in to comment.