v0.0.6 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2019 License: AGPL-3.0 Imports: 9 Imported by: 0




This section is empty.


This section is empty.


func CalcBlockReward

func CalcBlockReward(block core.Block, uncles []*types.Header) *big.Int

func ToCoreLog

func ToCoreLog(gethLog types.Log) core.Log

func ToCoreLogs

func ToCoreLogs(gethLogs []types.Log) []core.Log

func ToCoreReceipt

func ToCoreReceipt(gethReceipt *types.Receipt) (core.Receipt, error)

func ToCoreReceipts

func ToCoreReceipts(gethReceipts types.Receipts) ([]core.Receipt, error)


type BlockConverter

type BlockConverter struct {
	// contains filtered or unexported fields

func NewBlockConverter

func NewBlockConverter(transactionConverter TransactionConverter) BlockConverter

func (BlockConverter) ToCoreBlock

func (bc BlockConverter) ToCoreBlock(gethBlock *types.Block) (core.Block, error)

func (BlockConverter) ToCoreUncle

func (bc BlockConverter) ToCoreUncle(block core.Block, uncles []*types.Header) (*big.Int, []core.Uncle)

Rewards for the miners of uncles is calculated as (U_n + 8 - B_n) * R / 8 Where U_n is the uncle block number, B_n is the parent block number and R is the static block reward at B_n Returns the total uncle reward and the individual processed uncles

type HeaderConverter

type HeaderConverter struct{}

func (HeaderConverter) Convert

func (converter HeaderConverter) Convert(gethHeader *types.Header, blockHash string) core.Header

type TransactionConverter

type TransactionConverter interface {
	ConvertBlockTransactionsToCore(gethBlock *types.Block) ([]core.TransactionModel, error)
	ConvertRpcTransactionsToModels(transactions []core.RpcTransaction) ([]core.TransactionModel, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL