common

package
v0.0.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcBlockReward

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

func ToCoreLog

func ToCoreLog(gethLog types.Log) core.FullSyncLog

func ToCoreReceipt

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

func ToCoreReceipts

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

func ToFullSyncLogs

func ToFullSyncLogs(gethLogs []types.Log) []core.FullSyncLog

Types

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 https://github.com/ethereum/go-ethereum/issues/1591 https://ethereum.stackexchange.com/questions/27172/different-uncles-reward https://github.com/ethereum/homestead-guide/issues/399 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