Documentation ¶
Index ¶
- Constants
- type BchScanner
- func (b *BchScanner) AddKnownTx(txHash string)
- func (b *BchScanner) GetConfirmations(txHash [32]byte) int32
- func (b *BchScanner) GetLatestScanHeight() int64
- func (b *BchScanner) GetNewTxs(blockHeight int64, blockHash [32]byte, scanBlock bool) []modbtypes.Tx
- func (b *BchScanner) SetLatestScanHeight(blockHeight int64)
- type IScanner
- type MockStore
- func (m *MockStore) AddBlock(blk *modbtypes.Block)
- func (m MockStore) Close()
- func (m *MockStore) GetBlockByHash(blkHash [32]byte) (blk *types.Block, err error)
- func (m *MockStore) GetBlockByHeight(height uint64) (*types.Block, error)
- func (m *MockStore) GetLatestBlockInfo() (height, timestamp int64, hash [32]byte, latestScanBlockHeight int64)
- func (m *MockStore) GetTxByHash(txHash common.Hash) (tx *types.Transaction, sig [65]byte, err error)
- func (m MockStore) GetTxListByHeightWithRange(height uint32, start, end int) (txs []*types.Transaction, sigs [][65]byte, err error)
- func (m *MockStore) IsTxMined(txHash string) bool
- func (m MockStore) QueryLogs(addresses []common.Address, topics [][]common.Hash, ...) (logs []types.Log, err error)
Constants ¶
View Source
const MaxCacheSize = 100_000
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BchScanner ¶
type BchScanner struct { Client bch.IBchClient Store store.IStore MaxTxsInBlock int OriginChainParam *chaincfg.Params LatestScanBlockHeight int64 // contains filtered or unexported fields }
func NewBchScanner ¶
func (*BchScanner) AddKnownTx ¶
func (b *BchScanner) AddKnownTx(txHash string)
func (*BchScanner) GetConfirmations ¶
func (b *BchScanner) GetConfirmations(txHash [32]byte) int32
Getconfirmations return value: when tx mined in virtual chain, its finalize number is 0, when it mined in source chain the latest block, its finalize number is 1, when it not is mined by source chain and is not in mempool either, we think one or more of its inputs have been spent by other tx, so its finalize number is -1.
func (*BchScanner) GetLatestScanHeight ¶
func (b *BchScanner) GetLatestScanHeight() int64
func (*BchScanner) SetLatestScanHeight ¶
func (b *BchScanner) SetLatestScanHeight(blockHeight int64)
type MockStore ¶
type MockStore struct {
// contains filtered or unexported fields
}
func (*MockStore) GetBlockByHash ¶
func (*MockStore) GetBlockByHeight ¶
func (*MockStore) GetLatestBlockInfo ¶
func (*MockStore) GetTxByHash ¶
func (MockStore) GetTxListByHeightWithRange ¶
Click to show internal directories.
Click to hide internal directories.