Documentation ¶
Index ¶
- Constants
- func IsWatcherEnabled() bool
- type BlockNonce
- type CodeInfo
- type EthBlock
- type MsgBlock
- type MsgBlockInfo
- type MsgCode
- type MsgEthTx
- type MsgLatestHeight
- type MsgTransactionReceipt
- type Querier
- func (q *Querier) Enable(sw bool)
- func (q Querier) GetBlockByHash(hash common.Hash, fullTx bool) (*EthBlock, error)
- func (q Querier) GetBlockByNumber(number uint64, fullTx bool) (*EthBlock, error)
- func (q Querier) GetCode(contractAddr common.Address, height uint64) ([]byte, error)
- func (q Querier) GetLatestBlockNumber() (uint64, error)
- func (q Querier) GetTransactionByBlockHashAndIndex(hash common.Hash, idx uint) (*rpctypes.Transaction, error)
- func (q Querier) GetTransactionByBlockNumberAndIndex(number uint64, idx uint) (*rpctypes.Transaction, error)
- func (q Querier) GetTransactionByHash(hash common.Hash) (*rpctypes.Transaction, error)
- func (q Querier) GetTransactionReceipt(hash common.Hash) (*TransactionReceipt, error)
- type TransactionReceipt
- type WatchMessage
- type WatchStore
- type Watcher
- func (w *Watcher) Commit()
- func (w *Watcher) Enable(sw bool)
- func (w *Watcher) NewHeight(height uint64, blockHash common.Hash, header types.Header)
- func (w *Watcher) SaveBlock(bloom ethtypes.Bloom)
- func (w *Watcher) SaveContractCode(addr common.Address, code []byte)
- func (w *Watcher) SaveEthereumTx(msg types2.MsgEthereumTx, txHash common.Hash, index uint64)
- func (w *Watcher) SaveLatestHeight(height uint64)
- func (w *Watcher) SaveTransactionReceipt(status uint32, msg types2.MsgEthereumTx, txHash common.Hash, txIndex uint64, ...)
- func (w *Watcher) UpdateBlockTxs(txHash common.Hash)
- func (w *Watcher) UpdateCumulativeGas(txIndex, gasUsed uint64)
Constants ¶
View Source
const ( KeyLatestHeight = "LatestHeight" TransactionSuccess = 1 TransactionFailed = 0 )
View Source
const FlagFastQuery = "fast-query"
View Source
const MsgFunctionDisable = "fast query function disabled"
Variables ¶
This section is empty.
Functions ¶
func IsWatcherEnabled ¶
func IsWatcherEnabled() bool
Types ¶
type BlockNonce ¶
type BlockNonce [8]byte
A BlockNonce is a 64-bit hash which proves (combined with the mix-hash) that a sufficient amount of computation has been carried out on a block.
func EncodeNonce ¶
func EncodeNonce(i uint64) BlockNonce
EncodeNonce converts the given integer to a block nonce.
func (BlockNonce) MarshalText ¶
func (n BlockNonce) MarshalText() ([]byte, error)
MarshalText encodes n as a hex string with 0x prefix.
func (BlockNonce) Uint64 ¶
func (n BlockNonce) Uint64() uint64
Uint64 returns the integer value of a block nonce.
func (*BlockNonce) UnmarshalText ¶
func (n *BlockNonce) UnmarshalText(input []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type EthBlock ¶
type EthBlock struct { Number hexutil.Uint64 `json:"number"` Hash common.Hash `json:"hash"` ParentHash common.Hash `json:"parentHash"` Nonce BlockNonce `json:"nonce"` Sha3Uncles common.Hash `json:"sha3Uncles"` LogsBloom ethtypes.Bloom `json:"logsBloom"` TransactionsRoot common.Hash `json:"transactionsRoot"` StateRoot common.Hash `json:"stateRoot"` Miner common.Address `json:"miner"` MixHash common.Hash `json:"mixHash"` Difficulty hexutil.Uint64 `json:"difficulty"` TotalDifficulty hexutil.Uint64 `json:"totalDifficulty"` ExtraData hexutil.Bytes `json:"extraData"` Size hexutil.Uint64 `json:"size"` GasLimit hexutil.Uint64 `json:"gasLimit"` GasUsed *hexutil.Big `json:"gasUsed"` Timestamp hexutil.Uint64 `json:"timestamp"` Uncles []string `json:"uncles"` ReceiptsRoot common.Hash `json:"receiptsRoot"` Transactions interface{} `json:"transactions"` }
type MsgBlock ¶
type MsgBlock struct {
// contains filtered or unexported fields
}
func NewMsgBlock ¶
type MsgBlockInfo ¶
type MsgBlockInfo struct {
// contains filtered or unexported fields
}
func NewMsgBlockInfo ¶
func NewMsgBlockInfo(height uint64, blockHash common.Hash) *MsgBlockInfo
func (MsgBlockInfo) GetKey ¶
func (b MsgBlockInfo) GetKey() string
func (MsgBlockInfo) GetValue ¶
func (b MsgBlockInfo) GetValue() string
type MsgEthTx ¶
func NewMsgEthTx ¶
type MsgLatestHeight ¶
type MsgLatestHeight struct {
// contains filtered or unexported fields
}
func NewMsgLatestHeight ¶
func NewMsgLatestHeight(height uint64) *MsgLatestHeight
func (MsgLatestHeight) GetKey ¶
func (b MsgLatestHeight) GetKey() string
func (MsgLatestHeight) GetValue ¶
func (b MsgLatestHeight) GetValue() string
type MsgTransactionReceipt ¶
type MsgTransactionReceipt struct {
// contains filtered or unexported fields
}
func NewMsgTransactionReceipt ¶
func NewMsgTransactionReceipt(status uint32, tx *types.MsgEthereumTx, txHash, blockHash common.Hash, txIndex, height uint64, data *types.ResultData, cumulativeGas, GasUsed uint64) *MsgTransactionReceipt
func (MsgTransactionReceipt) GetKey ¶
func (m MsgTransactionReceipt) GetKey() string
func (MsgTransactionReceipt) GetValue ¶
func (m MsgTransactionReceipt) GetValue() string
type Querier ¶
type Querier struct {
// contains filtered or unexported fields
}
func NewQuerier ¶
func NewQuerier() *Querier
func (Querier) GetBlockByHash ¶
func (Querier) GetBlockByNumber ¶
func (Querier) GetLatestBlockNumber ¶
func (Querier) GetTransactionByBlockHashAndIndex ¶
func (Querier) GetTransactionByBlockNumberAndIndex ¶
func (Querier) GetTransactionByHash ¶
func (Querier) GetTransactionReceipt ¶
func (q Querier) GetTransactionReceipt(hash common.Hash) (*TransactionReceipt, error)
type TransactionReceipt ¶
type TransactionReceipt struct { Status hexutil.Uint64 `json:"status"` CumulativeGasUsed hexutil.Uint64 `json:"cumulativeGasUsed"` LogsBloom ethtypes.Bloom `json:"logsBloom"` Logs []*ethtypes.Log `json:"logs"` TransactionHash string `json:"transactionHash"` ContractAddress *common.Address `json:"contractAddress"` GasUsed hexutil.Uint64 `json:"gasUsed"` BlockHash string `json:"blockHash"` BlockNumber hexutil.Uint64 `json:"blockNumber"` TransactionIndex hexutil.Uint64 `json:"transactionIndex"` From string `json:"from"` To *common.Address `json:"to"` }
type WatchMessage ¶
type WatchStore ¶
type WatchStore struct {
// contains filtered or unexported fields
}
func InstanceOfWatchStore ¶
func InstanceOfWatchStore() *WatchStore
func (WatchStore) Set ¶
func (w WatchStore) Set(key []byte, value []byte)
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
func NewWatcher ¶
func NewWatcher() *Watcher
func (*Watcher) SaveContractCode ¶
func (*Watcher) SaveEthereumTx ¶
func (*Watcher) SaveLatestHeight ¶
func (*Watcher) SaveTransactionReceipt ¶
func (w *Watcher) SaveTransactionReceipt(status uint32, msg types2.MsgEthereumTx, txHash common.Hash, txIndex uint64, data *types2.ResultData, gasUsed uint64)
func (*Watcher) UpdateBlockTxs ¶
func (*Watcher) UpdateCumulativeGas ¶
Click to show internal directories.
Click to hide internal directories.