Skip to content

Commit

Permalink
accounts/abi/bind: check invalid chainID first (#29275)
Browse files Browse the repository at this point in the history
  • Loading branch information
htiennv authored Mar 19, 2024
1 parent 6b3d4d0 commit eda9c7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion accounts/abi/bind/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ func NewKeyStoreTransactorWithChainID(keystore *keystore.KeyStore, account accou
// NewKeyedTransactorWithChainID is a utility method to easily create a transaction signer
// from a single private key.
func NewKeyedTransactorWithChainID(key *ecdsa.PrivateKey, chainID *big.Int) (*TransactOpts, error) {
keyAddr := crypto.PubkeyToAddress(key.PublicKey)
if chainID == nil {
return nil, ErrNoChainID
}
keyAddr := crypto.PubkeyToAddress(key.PublicKey)
signer := types.LatestSignerForChainID(chainID)
return &TransactOpts{
From: keyAddr,
Expand Down

0 comments on commit eda9c7e

Please sign in to comment.