accounts/external, signer/core: add support for EIP-2930 transactions (#22585)
This adds support for signing EIP-2930 with clef.
This commit is contained in:
committed by
GitHub
parent
4b783c0064
commit
67da83aca5
14
accounts/external/backend.go
vendored
14
accounts/external/backend.go
vendored
@ -212,6 +212,20 @@ func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transactio
|
||||
To: to,
|
||||
From: common.NewMixedcaseAddress(account.Address),
|
||||
}
|
||||
// We should request the default chain id that we're operating with
|
||||
// (the chain we're executing on)
|
||||
if chainID != nil {
|
||||
args.ChainID = (*hexutil.Big)(chainID)
|
||||
}
|
||||
// However, if the user asked for a particular chain id, then we should
|
||||
// use that instead.
|
||||
if tx.Type() != types.LegacyTxType && tx.ChainId() != nil {
|
||||
args.ChainID = (*hexutil.Big)(tx.ChainId())
|
||||
}
|
||||
if tx.Type() == types.AccessListTxType {
|
||||
accessList := tx.AccessList()
|
||||
args.AccessList = &accessList
|
||||
}
|
||||
var res signTransactionResult
|
||||
if err := api.client.Call(&res, "account_signTransaction", args); err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user