2020-08-19 11:46:20 +00:00
|
|
|
package ethapi
|
|
|
|
|
|
|
|
// This file stores proxy-objects for `internal` package
|
|
|
|
import (
|
2023-01-13 18:12:18 +00:00
|
|
|
libcommon "github.com/ledgerwatch/erigon-lib/common"
|
|
|
|
|
2021-05-20 18:25:53 +00:00
|
|
|
"github.com/ledgerwatch/erigon/core/types"
|
2020-08-19 11:46:20 +00:00
|
|
|
)
|
|
|
|
|
2022-08-10 12:04:13 +00:00
|
|
|
// nolint
|
2020-08-19 11:46:20 +00:00
|
|
|
func RPCMarshalBlock(b *types.Block, inclTx bool, fullTx bool, additional map[string]interface{}) (map[string]interface{}, error) {
|
2022-10-25 02:58:25 +00:00
|
|
|
fields, err := RPCMarshalBlockDeprecated(b, inclTx, fullTx)
|
2020-08-19 11:46:20 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
for k, v := range additional {
|
|
|
|
fields[k] = v
|
|
|
|
}
|
|
|
|
|
|
|
|
return fields, err
|
|
|
|
}
|
|
|
|
|
2022-08-10 12:04:13 +00:00
|
|
|
// nolint
|
2023-01-13 18:12:18 +00:00
|
|
|
func RPCMarshalBlockEx(b *types.Block, inclTx bool, fullTx bool, borTx types.Transaction, borTxHash libcommon.Hash, additional map[string]interface{}) (map[string]interface{}, error) {
|
2022-10-25 02:58:25 +00:00
|
|
|
fields, err := RPCMarshalBlockExDeprecated(b, inclTx, fullTx, borTx, borTxHash)
|
2022-07-07 08:40:50 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
for k, v := range additional {
|
|
|
|
fields[k] = v
|
|
|
|
}
|
|
|
|
|
|
|
|
return fields, err
|
|
|
|
}
|