Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Detail ¶
type Detail struct { Version uint32 `json:"version"` BlockHash common.Hash `json:"block_hash"` BlockNumber hexutil.Uint64 `json:"block_number"` // just for json Rewards []*RewardInfo `json:"rewards" rlp:"-"` InnerTxs []*InnerTx `json:"inner_txs" rlp:"-"` // just for rlp RewardsPayload []byte `json:"-"` InnerTxPayload []byte `json:"-"` }
type DetailDB ¶
type DetailDB interface { NewRecorder() DetailRecorder WriteDetail(d *Detail) ReadDetail(blockHash common.Hash) *Detail Close() }
func FakeDetailDB ¶
func FakeDetailDB() DetailDB
type DetailRecorder ¶
type DetailRecorder interface { IsWatch() bool Init(blockHash common.Hash, number uint64) AddReward(validator, coinbase common.Address, value *big.Int) AddInnerTx(parent common.Hash, from, to common.Address, value *big.Int, gasLimit uint64) Finalize() *Detail }
func FakeRecorder ¶
func FakeRecorder() DetailRecorder
type InnerTx ¶
type InnerTx struct { ParentHash common.Hash `json:"parent_hash"` From common.Address `json:"from"` To common.Address `json:"to"` Value *big.Int `json:"value"` GasLimit uint64 `json:"gas_limit"` }
func (InnerTx) MarshalJSON ¶
MarshalJSON marshals as JSON.
func (*InnerTx) UnmarshalJSON ¶
UnmarshalJSON unmarshals from JSON.
type RewardInfo ¶
type RewardInfo struct { Validator common.Address `json:"validator"` Coinbase common.Address `json:"coinbase"` Reward *big.Int `json:"reward"` }
func (RewardInfo) MarshalJSON ¶
func (r RewardInfo) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*RewardInfo) UnmarshalJSON ¶
func (r *RewardInfo) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
Click to show internal directories.
Click to hide internal directories.