mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 09:37:38 +00:00
7b80744768
* Ensure fake Bor txs + receipts are returned from all relevant RPC methods * Add rest of bor implementation for eth_getBlockByNumber * Use TxLookup index to find Bor txs * Fix txHash on emitted borTxs and borReceipts * Fix checks given that borTxs get registered in TxLookup; remove useless ref indirections
65 lines
1.4 KiB
Go
65 lines
1.4 KiB
Go
package ethapi
|
|
|
|
// This file stores proxy-objects for `internal` package
|
|
import (
|
|
"github.com/ledgerwatch/erigon/core"
|
|
"github.com/ledgerwatch/erigon/core/types"
|
|
"github.com/ledgerwatch/erigon/internal/ethapi"
|
|
)
|
|
|
|
// This package provides copy-paste and proxy objects to "internal/ethapi" package
|
|
|
|
func NewRevertError(result *core.ExecutionResult) *RevertError {
|
|
return &RevertError{ethapi.NewRevertError(result)}
|
|
}
|
|
|
|
type RevertError struct {
|
|
*ethapi.RevertError
|
|
}
|
|
|
|
type CallArgs struct {
|
|
*ethapi.CallArgs
|
|
}
|
|
|
|
type ExecutionResult struct {
|
|
*ethapi.ExecutionResult
|
|
}
|
|
|
|
//nolint
|
|
func RPCMarshalHeader(head *types.Header) map[string]interface{} {
|
|
return ethapi.RPCMarshalHeader(head)
|
|
}
|
|
|
|
//nolint
|
|
func RPCMarshalBlock(b *types.Block, inclTx bool, fullTx bool, additional map[string]interface{}) (map[string]interface{}, error) {
|
|
fields, err := ethapi.RPCMarshalBlock(b, inclTx, fullTx)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
for k, v := range additional {
|
|
fields[k] = v
|
|
}
|
|
|
|
return fields, err
|
|
}
|
|
|
|
//nolint
|
|
func RPCMarshalBlockEx(b *types.Block, inclTx bool, fullTx bool, borTx types.Transaction, borReceipt *types.Receipt, additional map[string]interface{}) (map[string]interface{}, error) {
|
|
fields, err := ethapi.RPCMarshalBlockEx(b, inclTx, fullTx, borTx, borReceipt)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
for k, v := range additional {
|
|
fields[k] = v
|
|
}
|
|
|
|
return fields, err
|
|
}
|
|
|
|
//nolint
|
|
type RPCTransaction struct {
|
|
*ethapi.RPCTransaction
|
|
}
|