watcher

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagFastQuery        = "fast-query"
	FlagFastQueryForWasm = "wasm-fast-query"
	FlagFastQueryLru     = "fast-lru"
	FlagCheckWd          = "check_watchdb"

	WatchDbDir  = "data"
	WatchDBName = "watch"
)
View Source
const (
	TypeOthers    = uint32(1)
	TypeState     = uint32(2)
	TypeDelete    = uint32(3)
	TypeEvmParams = uint32(4)

	EthReceipt  = uint64(0)
	StdResponse = uint64(1)
)
View Source
const MsgFunctionDisable = "fast query function has been disabled"

Variables

View Source
var (
	PrefixState = []byte{0x08}

	KeyLatestHeight = "LatestHeight"

	TransactionSuccess = uint32(1)
	TransactionFailed  = uint32(0)
)
View Source
var WatchCdc *codec.Codec

Functions

func DecodeAccount added in v1.6.2

func DecodeAccount(bz []byte) (*app.EthAccount, error)

func EncodeAccount added in v1.6.2

func EncodeAccount(acc *app.EthAccount) ([]byte, error)

func GetMsgAccountKey added in v0.18.7

func GetMsgAccountKey(addr []byte) []byte

func GetMsgStateKey added in v0.18.7

func GetMsgStateKey(addr common.Address, key []byte) []byte

func GetWatchLruSize added in v0.18.8

func GetWatchLruSize() int

func IsWatcherEnabled

func IsWatcherEnabled() bool

func NewEvmTx added in v1.3.0

func NewEvmTx(msgEvmTx *types.MsgEthereumTx, txHash ethcmn.Hash, blockHash ethcmn.Hash, height, index uint64) *evmTx

Types

type Batch added in v1.0.0

type Batch struct {
	Key       []byte `json:"key"`
	Value     []byte `json:"value"`
	TypeValue uint32 `json:"type_value"`
}

func (*Batch) MarshalToAmino added in v1.1.6

func (b *Batch) MarshalToAmino(cdc *amino.Codec) ([]byte, error)

MarshalToAmino marshal batch data to amino bytes

func (*Batch) UnmarshalFromAmino added in v1.1.6

func (b *Batch) UnmarshalFromAmino(cdc *amino.Codec, data []byte) error

UnmarshalFromAmino unmarshal amino bytes to this object

type Block added in v1.2.0

type Block struct {
	Number           hexutil.Uint64 `json:"number"`
	Hash             common.Hash    `json:"hash"`
	ParentHash       common.Hash    `json:"parentHash"`
	Nonce            BlockNonce     `json:"nonce"`
	UncleHash        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           []common.Hash  `json:"uncles"`
	ReceiptsRoot     common.Hash    `json:"receiptsRoot"`
	Transactions     interface{}    `json:"transactions"`
}

Block represents a transaction returned to RPC clients.

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 CodeInfo

type CodeInfo struct {
	Height uint64 `json:"height"`
	Code   string `json:"code"`
}

type DelAccMsg added in v1.1.5

type DelAccMsg struct {
	// contains filtered or unexported fields
}

func NewDelAccMsg added in v1.1.5

func NewDelAccMsg(acc auth.Account) *DelAccMsg

func (*DelAccMsg) GetKey added in v1.1.5

func (delAcc *DelAccMsg) GetKey() []byte

func (*DelAccMsg) GetType added in v1.1.5

func (delAcc *DelAccMsg) GetType() uint32

func (*DelAccMsg) GetValue added in v1.1.5

func (delAcc *DelAccMsg) GetValue() string

type InfuraKeeper added in v1.5.5

type InfuraKeeper interface {
	OnSaveTransactionReceipt(TransactionReceipt)
	OnSaveBlock(Block)
	OnSaveTransaction(Transaction)
	OnSaveContractCode(address string, code []byte)
}

type LazyValueMarshaler added in v1.1.8

type LazyValueMarshaler interface {
	GetValue() string
}

type MsgAccount added in v0.18.7

type MsgAccount struct {
	// contains filtered or unexported fields
}

func NewMsgAccount added in v0.18.7

func NewMsgAccount(acc auth.Account) *MsgAccount

func (*MsgAccount) GetKey added in v0.18.7

func (msgAccount *MsgAccount) GetKey() []byte

func (*MsgAccount) GetType added in v0.18.8

func (msgAccount *MsgAccount) GetType() uint32

func (*MsgAccount) GetValue added in v0.18.7

func (msgAccount *MsgAccount) GetValue() string

type MsgBlock

type MsgBlock struct {
	// contains filtered or unexported fields
}

func NewMsgBlock

func NewMsgBlock(b Block) *MsgBlock

func (MsgBlock) GetKey

func (m MsgBlock) GetKey() []byte

func (MsgBlock) GetType added in v0.18.8

func (m MsgBlock) GetType() uint32

func (MsgBlock) GetValue

func (m MsgBlock) GetValue() string

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() []byte

func (MsgBlockInfo) GetType added in v0.18.8

func (b MsgBlockInfo) GetType() uint32

func (MsgBlockInfo) GetValue

func (b MsgBlockInfo) GetValue() string

type MsgBlockStdTxHash added in v1.6.2

type MsgBlockStdTxHash struct {
	// contains filtered or unexported fields
}

func NewMsgBlockStdTxHash added in v1.6.2

func NewMsgBlockStdTxHash(stdTxHash []common.Hash, blockHash common.Hash) *MsgBlockStdTxHash

func (*MsgBlockStdTxHash) GetKey added in v1.6.2

func (m *MsgBlockStdTxHash) GetKey() []byte

func (*MsgBlockStdTxHash) GetType added in v1.6.2

func (m *MsgBlockStdTxHash) GetType() uint32

func (*MsgBlockStdTxHash) GetValue added in v1.6.2

func (m *MsgBlockStdTxHash) GetValue() string

type MsgCode

type MsgCode struct {
	Key  []byte
	Code string
}

func NewMsgCode

func NewMsgCode(contractAddr common.Address, code []byte, height uint64) *MsgCode

func (MsgCode) GetKey

func (m MsgCode) GetKey() []byte

func (MsgCode) GetType added in v0.18.8

func (m MsgCode) GetType() uint32

func (MsgCode) GetValue

func (m MsgCode) GetValue() string

type MsgCodeByHash added in v0.18.7

type MsgCodeByHash struct {
	Key  []byte
	Code string
}

func NewMsgCodeByHash added in v0.18.7

func NewMsgCodeByHash(hash []byte, code []byte) *MsgCodeByHash

func (MsgCodeByHash) GetKey added in v0.18.7

func (m MsgCodeByHash) GetKey() []byte

func (MsgCodeByHash) GetType added in v0.18.8

func (m MsgCodeByHash) GetType() uint32

func (MsgCodeByHash) GetValue added in v0.18.7

func (m MsgCodeByHash) GetValue() string

type MsgContractBlockedListItem added in v0.18.7

type MsgContractBlockedListItem struct {
	// contains filtered or unexported fields
}

func NewMsgContractBlockedListItem added in v0.18.7

func NewMsgContractBlockedListItem(addr sdk.AccAddress) *MsgContractBlockedListItem

func (*MsgContractBlockedListItem) GetKey added in v0.18.7

func (msgItem *MsgContractBlockedListItem) GetKey() []byte

func (*MsgContractBlockedListItem) GetType added in v0.18.8

func (msgItem *MsgContractBlockedListItem) GetType() uint32

func (*MsgContractBlockedListItem) GetValue added in v0.18.7

func (msgItem *MsgContractBlockedListItem) GetValue() string

type MsgContractDeploymentWhitelistItem added in v0.18.7

type MsgContractDeploymentWhitelistItem struct {
	// contains filtered or unexported fields
}

func NewMsgContractDeploymentWhitelistItem added in v0.18.7

func NewMsgContractDeploymentWhitelistItem(addr sdk.AccAddress) *MsgContractDeploymentWhitelistItem

func (*MsgContractDeploymentWhitelistItem) GetKey added in v0.18.7

func (msgItem *MsgContractDeploymentWhitelistItem) GetKey() []byte

func (*MsgContractDeploymentWhitelistItem) GetType added in v0.18.8

func (msgItem *MsgContractDeploymentWhitelistItem) GetType() uint32

func (*MsgContractDeploymentWhitelistItem) GetValue added in v0.18.7

func (msgItem *MsgContractDeploymentWhitelistItem) GetValue() string

type MsgContractMethodBlockedListItem added in v1.0.0

type MsgContractMethodBlockedListItem struct {
	// contains filtered or unexported fields
}

func NewMsgContractMethodBlockedListItem added in v1.0.0

func NewMsgContractMethodBlockedListItem(addr sdk.AccAddress, methods []byte) *MsgContractMethodBlockedListItem

func (*MsgContractMethodBlockedListItem) GetKey added in v1.0.0

func (msgItem *MsgContractMethodBlockedListItem) GetKey() []byte

func (*MsgContractMethodBlockedListItem) GetType added in v1.0.0

func (msgItem *MsgContractMethodBlockedListItem) GetType() uint32

func (*MsgContractMethodBlockedListItem) GetValue added in v1.0.0

func (msgItem *MsgContractMethodBlockedListItem) GetValue() string

type MsgDelContractBlockedListItem added in v1.6.0

type MsgDelContractBlockedListItem struct {
	// contains filtered or unexported fields
}

func NewMsgDelContractBlockedListItem added in v1.6.0

func NewMsgDelContractBlockedListItem(addr sdk.AccAddress) *MsgDelContractBlockedListItem

func (*MsgDelContractBlockedListItem) GetKey added in v1.6.0

func (msgItem *MsgDelContractBlockedListItem) GetKey() []byte

func (*MsgDelContractBlockedListItem) GetType added in v1.6.0

func (msgItem *MsgDelContractBlockedListItem) GetType() uint32

func (*MsgDelContractBlockedListItem) GetValue added in v1.6.0

func (msgItem *MsgDelContractBlockedListItem) GetValue() string

type MsgDelContractDeploymentWhitelistItem added in v1.6.0

type MsgDelContractDeploymentWhitelistItem struct {
	// contains filtered or unexported fields
}

func NewMsgDelContractDeploymentWhitelistItem added in v1.6.0

func NewMsgDelContractDeploymentWhitelistItem(addr sdk.AccAddress) *MsgDelContractDeploymentWhitelistItem

func (*MsgDelContractDeploymentWhitelistItem) GetKey added in v1.6.0

func (msgItem *MsgDelContractDeploymentWhitelistItem) GetKey() []byte

func (*MsgDelContractDeploymentWhitelistItem) GetType added in v1.6.0

func (msgItem *MsgDelContractDeploymentWhitelistItem) GetType() uint32

func (*MsgDelContractDeploymentWhitelistItem) GetValue added in v1.6.0

func (msgItem *MsgDelContractDeploymentWhitelistItem) GetValue() string

type MsgEthTx

type MsgEthTx struct {
	*Transaction
	Key []byte
}

func (MsgEthTx) GetKey

func (m MsgEthTx) GetKey() []byte

func (MsgEthTx) GetType added in v0.18.8

func (m MsgEthTx) GetType() uint32

type MsgLatestHeight

type MsgLatestHeight struct {
	// contains filtered or unexported fields
}

func NewMsgLatestHeight

func NewMsgLatestHeight(height uint64) *MsgLatestHeight

func (MsgLatestHeight) GetKey

func (b MsgLatestHeight) GetKey() []byte

func (MsgLatestHeight) GetType added in v0.18.8

func (b MsgLatestHeight) GetType() uint32

func (MsgLatestHeight) GetValue

func (b MsgLatestHeight) GetValue() string

type MsgParams added in v0.18.7

type MsgParams struct {
	types.Params
}

func NewMsgParams added in v0.18.7

func NewMsgParams(params types.Params) *MsgParams

func (*MsgParams) GetKey added in v0.18.7

func (msgParams *MsgParams) GetKey() []byte

func (*MsgParams) GetType added in v0.18.8

func (msgParams *MsgParams) GetType() uint32

func (*MsgParams) GetValue added in v0.18.7

func (msgParams *MsgParams) GetValue() string

type MsgState added in v0.18.7

type MsgState struct {
	// contains filtered or unexported fields
}

func NewMsgState added in v0.18.7

func NewMsgState(addr common.Address, key, value []byte) *MsgState

func (*MsgState) GetKey added in v0.18.7

func (msgState *MsgState) GetKey() []byte

func (*MsgState) GetType added in v0.18.8

func (msgState *MsgState) GetType() uint32

func (*MsgState) GetValue added in v0.18.7

func (msgState *MsgState) GetValue() string

type MsgStdTransactionResponse added in v1.6.2

type MsgStdTransactionResponse struct {
	// contains filtered or unexported fields
}

func NewStdTransactionResponse added in v1.6.2

func NewStdTransactionResponse(tr *ctypes.ResultTx, timestamp time.Time, txHash common.Hash) *MsgStdTransactionResponse

func (*MsgStdTransactionResponse) GetKey added in v1.6.2

func (tr *MsgStdTransactionResponse) GetKey() []byte

func (*MsgStdTransactionResponse) GetType added in v1.6.2

func (tr *MsgStdTransactionResponse) GetType() uint32

func (*MsgStdTransactionResponse) GetValue added in v1.6.2

func (tr *MsgStdTransactionResponse) GetValue() string

type MsgTransactionReceipt

type MsgTransactionReceipt struct {
	*TransactionReceipt
	// contains filtered or unexported fields
}

func NewMsgTransactionReceipt

func NewMsgTransactionReceipt(tr TransactionReceipt, txHash common.Hash) *MsgTransactionReceipt

func (MsgTransactionReceipt) GetKey

func (m MsgTransactionReceipt) GetKey() []byte

func (MsgTransactionReceipt) GetType added in v0.18.8

func (m MsgTransactionReceipt) GetType() uint32

type Querier

type Querier struct {
	// contains filtered or unexported fields
}

func NewQuerier

func NewQuerier() *Querier

func (Querier) DeleteAccountFromRdb added in v0.18.8

func (q Querier) DeleteAccountFromRdb(addr sdk.AccAddress)

func (Querier) DeleteStateFromRdb added in v0.18.8

func (q Querier) DeleteStateFromRdb(addr common.Address, key []byte)

func (*Querier) Enable

func (q *Querier) Enable(sw bool)

func (Querier) GetAccount added in v0.18.7

func (q Querier) GetAccount(addr sdk.AccAddress) (*types.EthAccount, error)

func (Querier) GetAccountFromRdb added in v0.18.7

func (q Querier) GetAccountFromRdb(addr sdk.AccAddress) (*types.EthAccount, error)

func (Querier) GetBlockByHash

func (q Querier) GetBlockByHash(hash common.Hash, fullTx bool) (*Block, error)

func (Querier) GetBlockByNumber

func (q Querier) GetBlockByNumber(number uint64, fullTx bool) (*Block, error)

func (Querier) GetBlockHashByNumber added in v0.18.8

func (q Querier) GetBlockHashByNumber(number uint64) (common.Hash, error)

func (Querier) GetCode

func (q Querier) GetCode(contractAddr common.Address, height uint64) ([]byte, error)

func (Querier) GetCodeByHash added in v0.18.7

func (q Querier) GetCodeByHash(codeHash []byte) ([]byte, error)

func (Querier) GetContractMethodBlockedList added in v1.0.0

func (q Querier) GetContractMethodBlockedList(key []byte) ([]byte, error)

func (Querier) GetLatestBlockNumber

func (q Querier) GetLatestBlockNumber() (uint64, error)

func (Querier) GetParams added in v0.18.7

func (q Querier) GetParams() (*evmtypes.Params, error)

func (Querier) GetState added in v0.18.7

func (q Querier) GetState(key []byte) ([]byte, error)

func (Querier) GetStateFromRdb added in v0.18.7

func (q Querier) GetStateFromRdb(key []byte) ([]byte, error)

func (Querier) GetStdTxHashByBlockHash added in v1.6.2

func (q Querier) GetStdTxHashByBlockHash(hash common.Hash) ([]common.Hash, error)

func (Querier) GetTransactionByBlockHashAndIndex

func (q Querier) GetTransactionByBlockHashAndIndex(hash common.Hash, idx uint) (*Transaction, error)

func (Querier) GetTransactionByBlockNumberAndIndex

func (q Querier) GetTransactionByBlockNumberAndIndex(number uint64, idx uint) (*Transaction, error)

func (Querier) GetTransactionByHash

func (q Querier) GetTransactionByHash(hash common.Hash) (*Transaction, error)

func (Querier) GetTransactionReceipt

func (q Querier) GetTransactionReceipt(hash common.Hash) (*TransactionReceipt, error)

func (Querier) GetTransactionResponse added in v1.6.2

func (q Querier) GetTransactionResponse(hash common.Hash) (*TransactionResponse, error)

func (Querier) GetTransactionsByBlockNumber added in v0.19.14

func (q Querier) GetTransactionsByBlockNumber(number, offset, limit uint64) ([]*Transaction, error)

func (Querier) GetTxResultByBlock added in v1.6.2

func (q Querier) GetTxResultByBlock(clientCtx clientcontext.CLIContext,
	height, offset, limit uint64) ([]*TransactionResult, error)

func (Querier) HasContractBlockedList added in v0.18.7

func (q Querier) HasContractBlockedList(key []byte) bool

func (Querier) HasContractDeploymentWhitelist added in v0.18.7

func (q Querier) HasContractDeploymentWhitelist(key []byte) bool

func (Querier) MustGetAccount added in v0.18.7

func (q Querier) MustGetAccount(addr sdk.AccAddress) (*types.EthAccount, error)

func (Querier) MustGetState added in v0.18.7

func (q Querier) MustGetState(addr common.Address, key []byte) ([]byte, error)

type Transaction added in v1.2.0

type Transaction struct {
	BlockHash        *common.Hash    `json:"blockHash"`
	BlockNumber      *hexutil.Big    `json:"blockNumber"`
	From             common.Address  `json:"from"`
	Gas              hexutil.Uint64  `json:"gas"`
	GasPrice         *hexutil.Big    `json:"gasPrice"`
	Hash             common.Hash     `json:"hash"`
	Input            hexutil.Bytes   `json:"input"`
	Nonce            hexutil.Uint64  `json:"nonce"`
	To               *common.Address `json:"to"`
	TransactionIndex *hexutil.Uint64 `json:"transactionIndex"`
	Value            *hexutil.Big    `json:"value"`
	V                *hexutil.Big    `json:"v"`
	R                *hexutil.Big    `json:"r"`
	S                *hexutil.Big    `json:"s"`
	// contains filtered or unexported fields
}

Transaction represents a transaction returned to RPC clients.

func NewTransaction added in v1.2.0

func NewTransaction(tx *evmtypes.MsgEthereumTx, txHash, blockHash common.Hash, blockNumber, index uint64) (*Transaction, error)

NewTransaction returns a transaction that will serialize to the RPC representation, with the given location metadata set (if available).

func (*Transaction) GetValue added in v1.5.4

func (tr *Transaction) GetValue() string

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"`
	// contains filtered or unexported fields
}

func (*TransactionReceipt) GetBlockHash added in v1.6.1

func (tr *TransactionReceipt) GetBlockHash() string

func (*TransactionReceipt) GetFrom added in v1.6.1

func (tr *TransactionReceipt) GetFrom() string

func (*TransactionReceipt) GetHash added in v1.6.1

func (tr *TransactionReceipt) GetHash() string

func (*TransactionReceipt) GetTo added in v1.6.1

func (tr *TransactionReceipt) GetTo() *common.Address

func (*TransactionReceipt) GetValue added in v1.5.4

func (tr *TransactionReceipt) GetValue() string

type TransactionResponse added in v1.6.2

type TransactionResponse struct {
	*ctypes.ResultTx
	Timestamp time.Time
}

type TransactionResult added in v1.6.2

type TransactionResult struct {
	TxType   hexutil.Uint64            `json:"type"`
	EthTx    *Transaction              `json:"ethTx"`
	EthTxLog string                    `json:"ethTxLog"`
	Receipt  *TransactionReceipt       `json:"receipt"`
	Response *WrappedResponseWithCodec `json:"response"`
}

func RawTxResultToStdResponse added in v1.6.2

func RawTxResultToStdResponse(clientCtx clientcontext.CLIContext,
	tr *ctypes.ResultTx, tx sdk.Tx, timestamp time.Time) (*TransactionResult, error)

type TxWatcher added in v1.6.0

type TxWatcher struct {
	// contains filtered or unexported fields
}

TxWatcher cache watch data when run tx Use Enabled() to check if watcher is enable when call methods of TxWatcher

func NewTxWatcher added in v1.6.0

func NewTxWatcher() *TxWatcher

func (*TxWatcher) DeleteAccount added in v1.6.0

func (w *TxWatcher) DeleteAccount(account interface{})

func (*TxWatcher) DeleteContractBlockedList added in v1.6.0

func (w *TxWatcher) DeleteContractBlockedList(addr interface{})

func (*TxWatcher) DeleteContractDeploymentWhitelist added in v1.6.0

func (w *TxWatcher) DeleteContractDeploymentWhitelist(addr interface{})

func (*TxWatcher) Destruct added in v1.6.0

func (w *TxWatcher) Destruct() []WatchMessage

func (*TxWatcher) Enabled added in v1.6.0

func (w *TxWatcher) Enabled() bool

func (*TxWatcher) Finalize added in v1.6.0

func (w *TxWatcher) Finalize()

func (*TxWatcher) SaveAccount added in v1.6.0

func (w *TxWatcher) SaveAccount(account interface{})

func (*TxWatcher) SaveContractBlockedListItem added in v1.6.0

func (w *TxWatcher) SaveContractBlockedListItem(addr interface{})

func (*TxWatcher) SaveContractCode added in v1.6.0

func (w *TxWatcher) SaveContractCode(addr common.Address, code []byte, height uint64)

func (*TxWatcher) SaveContractCodeByHash added in v1.6.0

func (w *TxWatcher) SaveContractCodeByHash(hash []byte, code []byte)

func (*TxWatcher) SaveContractDeploymentWhitelistItem added in v1.6.0

func (w *TxWatcher) SaveContractDeploymentWhitelistItem(addr interface{})

func (*TxWatcher) SaveContractMethodBlockedListItem added in v1.6.0

func (w *TxWatcher) SaveContractMethodBlockedListItem(addr interface{}, methods []byte)

func (*TxWatcher) SaveState added in v1.6.0

func (w *TxWatcher) SaveState(addr common.Address, key, value []byte)

type WatchData added in v1.0.0

type WatchData struct {
	DirtyAccount  []*sdk.AccAddress `json:"dirty_account"`
	Batches       []*Batch          `json:"batches"`
	DelayEraseKey [][]byte          `json:"delay_erase_key"`
	BloomData     []*types.KV       `json:"bloom_data"`
	DirtyList     [][]byte          `json:"dirty_list"`
}

func (*WatchData) MarshalToAmino added in v1.1.6

func (w *WatchData) MarshalToAmino(cdc *amino.Codec) ([]byte, error)

MarshalToAmino marshal to amino bytes

func (*WatchData) Size added in v1.0.0

func (w *WatchData) Size() int

func (*WatchData) UnmarshalFromAmino added in v1.1.6

func (w *WatchData) UnmarshalFromAmino(cdc *amino.Codec, data []byte) error

UnmarshalFromAmino unmarshal from amino bytes

type WatchMessage

type WatchMessage = sdk.WatchMessage

type WatchStore

type WatchStore struct {
	// contains filtered or unexported fields
}

func InstanceOfWatchStore

func InstanceOfWatchStore() *WatchStore

func (WatchStore) Delete added in v0.18.7

func (w WatchStore) Delete(key []byte)

func (WatchStore) Get

func (w WatchStore) Get(key []byte) ([]byte, error)

func (WatchStore) GetEvmParams added in v1.6.0

func (w WatchStore) GetEvmParams() evmtypes.Params

func (WatchStore) GetUnsafe added in v1.2.0

func (w WatchStore) GetUnsafe(key []byte, processor dbm.UnsafeValueProcessor) (interface{}, error)

func (WatchStore) Has added in v0.18.7

func (w WatchStore) Has(key []byte) bool

func (WatchStore) Iterator added in v1.1.0

func (w WatchStore) Iterator(start, end []byte) dbm.Iterator

func (WatchStore) Set

func (w WatchStore) Set(key []byte, value []byte)

func (*WatchStore) SetEvmParams added in v1.6.0

func (w *WatchStore) SetEvmParams(params evmtypes.Params)

type WatchTx added in v1.3.0

type WatchTx interface {
	GetTxWatchMessage() WatchMessage
	GetTransaction() *Transaction
	GetTxHash() common.Hash
	GetFailedReceipts(cumulativeGas, gasUsed uint64) *TransactionReceipt
	GetIndex() uint64
}

type Watcher

type Watcher struct {
	InfuraKeeper InfuraKeeper
	// contains filtered or unexported fields
}

func NewWatcher

func NewWatcher(logger log.Logger) *Watcher

func (*Watcher) ApplyWatchData added in v1.6.2

func (w *Watcher) ApplyWatchData(watchData interface{})

func (*Watcher) CheckWatchDB added in v1.1.1

func (w *Watcher) CheckWatchDB(keys [][]byte, mode string)

func (*Watcher) Collect added in v1.6.0

func (w *Watcher) Collect(watchers ...sdk.IWatcher)

func (*Watcher) Commit

func (w *Watcher) Commit()

func (*Watcher) CommitAccountToRpcDb added in v0.18.7

func (w *Watcher) CommitAccountToRpcDb(account auth.Account)

func (*Watcher) CommitCodeHashToDb added in v0.18.7

func (w *Watcher) CommitCodeHashToDb(hash []byte, code []byte)

func (*Watcher) CommitStateToRpcDb added in v0.18.7

func (w *Watcher) CommitStateToRpcDb(addr common.Address, key, value []byte)

func (*Watcher) CommitWatchData added in v1.0.0

func (w *Watcher) CommitWatchData(data WatchData)

func (*Watcher) CreateWatchDataGenerator added in v1.6.2

func (w *Watcher) CreateWatchDataGenerator() func() ([]byte, error)

func (*Watcher) DelayEraseKey added in v1.5.0

func (w *Watcher) DelayEraseKey()

func (*Watcher) DeleteAccount added in v0.18.7

func (w *Watcher) DeleteAccount(addr sdk.AccAddress)

func (*Watcher) Enable

func (w *Watcher) Enable(enable bool)

func (*Watcher) Enabled added in v0.18.7

func (w *Watcher) Enabled() bool

func (*Watcher) ExecuteDelayEraseKey added in v0.18.9

func (w *Watcher) ExecuteDelayEraseKey(delayEraseKey [][]byte)

func (*Watcher) GetBloomDataPoint added in v1.0.0

func (w *Watcher) GetBloomDataPoint() *[]*evmtypes.KV

func (*Watcher) GetEvmTxIndex added in v1.3.0

func (w *Watcher) GetEvmTxIndex() uint64

func (*Watcher) Height added in v1.5.5

func (w *Watcher) Height() uint64

func (*Watcher) IsFirstUse added in v0.18.7

func (w *Watcher) IsFirstUse() bool

func (*Watcher) IsRealEvmTx added in v1.6.6

func (w *Watcher) IsRealEvmTx(resp *tm.ResponseDeliverTx) bool

func (*Watcher) NewHeight

func (w *Watcher) NewHeight(height uint64, blockHash common.Hash, header types.Header)

func (*Watcher) RecordTxAndFailedReceipt added in v1.3.0

func (w *Watcher) RecordTxAndFailedReceipt(tx tm.TxEssentials, resp *tm.ResponseDeliverTx, txDecoder sdk.TxDecoder)

func (*Watcher) SaveAccount added in v0.18.7

func (w *Watcher) SaveAccount(account auth.Account)

func (*Watcher) SaveBlock

func (w *Watcher) SaveBlock(bloom ethtypes.Bloom)

func (*Watcher) SaveBlockStdTxHash added in v1.6.2

func (w *Watcher) SaveBlockStdTxHash()

func (*Watcher) SaveContractBlockedListItem added in v0.18.7

func (w *Watcher) SaveContractBlockedListItem(addr sdk.AccAddress)

func (*Watcher) SaveContractDeploymentWhitelistItem added in v0.18.7

func (w *Watcher) SaveContractDeploymentWhitelistItem(addr sdk.AccAddress)

func (*Watcher) SaveContractMethodBlockedListItem added in v1.0.0

func (w *Watcher) SaveContractMethodBlockedListItem(addr sdk.AccAddress, methods []byte)

func (*Watcher) SaveLatestHeight

func (w *Watcher) SaveLatestHeight(height uint64)

func (*Watcher) SaveParallelTx added in v1.6.0

func (w *Watcher) SaveParallelTx(realTx sdk.Tx, resultData *types.ResultData, resp tm.ResponseDeliverTx)

SaveParallelTx saves parallel transactions and transactionReceipts to watcher

func (*Watcher) SaveParams added in v0.18.7

func (w *Watcher) SaveParams(params evmtypes.Params)

func (*Watcher) SaveTransactionReceipt

func (w *Watcher) SaveTransactionReceipt(status uint32, msg *evmtypes.MsgEthereumTx, txHash common.Hash, txIndex uint64, data *evmtypes.ResultData, gasUsed uint64)

func (*Watcher) SetFirstUse added in v1.5.5

func (w *Watcher) SetFirstUse(v bool)

SetFirstUse sets fistUse of Watcher only could use for ut

func (*Watcher) SetWatchDataManager added in v1.6.2

func (w *Watcher) SetWatchDataManager()

func (*Watcher) Stop added in v1.6.3

func (w *Watcher) Stop()

func (*Watcher) UnmarshalWatchData added in v1.1.6

func (w *Watcher) UnmarshalWatchData(wdByte []byte) (interface{}, error)

func (*Watcher) UpdateCumulativeGas

func (w *Watcher) UpdateCumulativeGas(txIndex, gasUsed uint64)

func (*Watcher) Used added in v0.18.7

func (w *Watcher) Used()

type WrappedResponseWithCodec added in v1.6.2

type WrappedResponseWithCodec struct {
	Response sdk.TxResponse
	Codec    *codec.Codec `json:"-"`
}

type WrappedResponseWithCodec

func (*WrappedResponseWithCodec) MarshalJSON added in v1.6.2

func (wr *WrappedResponseWithCodec) MarshalJSON() ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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