mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-21 22:24:32 +00:00
accounts/abi/bind: check invalid chainID first (#29275)
This commit is contained in:
parent
2b60816af1
commit
30dc0f47c9
1 changed files with 1 additions and 1 deletions
|
|
@ -141,10 +141,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…
Reference in a new issue