eth_createAccessList fall-through endpoint

This commit is contained in:
i-norden
2023-01-12 20:58:42 -06:00
parent e0de4a1591
commit 2b10ac5385
3 changed files with 88 additions and 0 deletions
+22
View File
@@ -481,6 +481,28 @@ func (pea *PublicEthAPI) GetRawTransactionByHash(ctx context.Context, hash commo
return nil, err
}
// accessListResult returns an optional accesslist
// Its the result of the `debug_createAccessList` RPC call.
// It contains an error if the transaction itself failed.
type accessListResult struct {
Accesslist *types.AccessList `json:"accessList"`
Error string `json:"error,omitempty"`
GasUsed hexutil.Uint64 `json:"gasUsed"`
}
// CreateAccessList creates a EIP-2930 type AccessList for the given transaction.
// Reexec and BlockNrOrHash can be specified to create the accessList on top of a certain state.
func (pea *PublicEthAPI) CreateAccessList(ctx context.Context, args TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash) (*accessListResult, error) {
if pea.proxyOnError {
var res *accessListResult
if err := pea.rpc.CallContext(ctx, &res, "eth_createAccessList", args, blockNrOrHash); err != nil {
return nil, err
}
return res, nil
}
return nil, RequiresProxyError{method: "eth_createAccessList"}
}
/*
Receipts and Logs