accounts/abi/bind: check invalid chainID first (#29275)

pull/29293/head
Tien Nguyen 8 months ago committed by GitHub
parent 6b3d4d068a
commit eda9c7e36f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      accounts/abi/bind/auth.go

@ -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,

Loading…
Cancel
Save