Documentation ¶
Index ¶
- Variables
- func GetFakeHeader(blockNumber int64) core.Header
- func GetFakeHeaderWithTimestamp(timestamp, blockNumber int64) core.Header
- func GetFakeTransaction(hash string, receipt core.Receipt) core.TransactionModel
- func GetFakeUncle(hash, reward string) core.Uncle
- type MockBlockChain
- func (chain *MockBlockChain) AssertFetchContractDataCalledWith(abiJSON string, address string, method string, methodArgs []interface{}, ...)
- func (blockChain *MockBlockChain) AssertGetEthLogsWithCustomQueryCalledWith(query ethereum.FilterQuery)
- func (chain *MockBlockChain) CallContract(contractHash string, input []byte, blockNumber *big.Int) ([]byte, error)
- func (blockChain *MockBlockChain) FetchContractData(abiJSON string, address string, method string, methodArgs []interface{}, ...) error
- func (blockChain *MockBlockChain) GetAccountBalance(address common.Address, blockNumber *big.Int) (*big.Int, error)
- func (chain *MockBlockChain) GetBlockByNumber(blockNumber int64) (core.Block, error)
- func (blockChain *MockBlockChain) GetEthLogsWithCustomQuery(query ethereum.FilterQuery) ([]types.Log, error)
- func (chain *MockBlockChain) GetHeaderByNumber(blockNumber int64) (core.Header, error)
- func (chain *MockBlockChain) GetHeadersByNumbers(blockNumbers []int64) ([]core.Header, error)
- func (chain *MockBlockChain) GetLogs(contract core.Contract, startingBlockNumber, endingBlockNumber *big.Int) ([]core.Log, error)
- func (chain *MockBlockChain) GetTransactions(transactionHashes []common.Hash) ([]core.TransactionModel, error)
- func (chain *MockBlockChain) LastBlock() (*big.Int, error)
- func (chain *MockBlockChain) Node() core.Node
- func (chain *MockBlockChain) SetFetchContractDataErr(err error)
- func (blockChain *MockBlockChain) SetGetAccountBalance(balance *big.Int)
- func (blockChain *MockBlockChain) SetGetAccountBalanceErr(err error)
- func (chain *MockBlockChain) SetGetBlockByNumberErr(err error)
- func (chain *MockBlockChain) SetGetEthLogsWithCustomQueryErr(err error)
- func (chain *MockBlockChain) SetGetEthLogsWithCustomQueryReturnLogs(logs []types.Log)
- func (chain *MockBlockChain) SetLastBlock(blockNumber *big.Int)
- type MockBlockRepository
- func (repository *MockBlockRepository) AssertCreateOrUpdateBlockCallCountEquals(times int)
- func (repository *MockBlockRepository) AssertCreateOrUpdateBlockCalledWith(block core.Block)
- func (repository *MockBlockRepository) AssertCreateOrUpdateBlocksCallCountAndBlockNumbersEquals(times int, blockNumbers []int64)
- func (repository *MockBlockRepository) AssertMissingBlockNumbersCalledWith(startingBlockNumber int64, endingBlockNumber int64, nodeId string)
- func (repository *MockBlockRepository) AssertSetBlockStatusCalledWith(chainHead int64)
- func (repository *MockBlockRepository) CreateOrUpdateBlock(block core.Block) (int64, error)
- func (repository *MockBlockRepository) GetBlock(blockNumber int64) (core.Block, error)
- func (repository *MockBlockRepository) MissingBlockNumbers(startingBlockNumber int64, endingBlockNumber int64, nodeId string) []int64
- func (repository *MockBlockRepository) SetBlocksStatus(chainHead int64) error
- func (repository *MockBlockRepository) SetCreateOrUpdateBlockReturnVals(i int64, err error)
- func (repository *MockBlockRepository) SetMissingBlockNumbersReturnArray(returnArray []int64)
- type MockCryptoParser
- type MockEthClient
- func (client *MockEthClient) AssertBalanceAtCalled(ctx context.Context, account common.Address, blockNumber *big.Int)
- func (client *MockEthClient) AssertBatchCalledWith(method string)
- func (client *MockEthClient) AssertBlockByNumberCalledWith(ctx context.Context, number *big.Int)
- func (client *MockEthClient) AssertCallContractCalledWith(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int)
- func (client *MockEthClient) AssertFilterLogsCalledWith(ctx context.Context, q ethereum.FilterQuery)
- func (client *MockEthClient) AssertHeaderByNumberCalledWith(ctx context.Context, number *big.Int)
- func (client *MockEthClient) AssertHeaderByNumbersCalledWith(number []*big.Int)
- func (client *MockEthClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
- func (client *MockEthClient) BatchCall(batch []client.BatchElem) error
- func (client *MockEthClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
- func (client *MockEthClient) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
- func (client *MockEthClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)
- func (client *MockEthClient) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
- func (client *MockEthClient) HeaderByNumbers(numbers []*big.Int) ([]*types.Header, error)
- func (client *MockEthClient) SetBalanceAt(balance *big.Int)
- func (client *MockEthClient) SetBalanceAtErr(err error)
- func (client *MockEthClient) SetBlockByNumberErr(err error)
- func (client *MockEthClient) SetBlockByNumberReturnBlock(block *types.Block)
- func (client *MockEthClient) SetCallContractErr(err error)
- func (client *MockEthClient) SetCallContractReturnBytes(returnBytes []byte)
- func (client *MockEthClient) SetFilterLogsErr(err error)
- func (client *MockEthClient) SetFilterLogsReturnLogs(logs []types.Log)
- func (client *MockEthClient) SetHeaderByNumberErr(err error)
- func (client *MockEthClient) SetHeaderByNumberReturnHeader(header *types.Header)
- func (client *MockEthClient) SetHeaderByNumbersReturnHeader(headers []*types.Header)
- func (client *MockEthClient) SetTransactionReceiptErr(err error)
- func (client *MockEthClient) SetTransactionReceipts(receipts []*types.Receipt)
- func (client *MockEthClient) SetTransactionSenderErr(err error)
- func (client *MockEthClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
- func (client *MockEthClient) TransactionSender(ctx context.Context, tx *types.Transaction, block common.Hash, index uint) (common.Address, error)
- type MockEthereumDatabase
- func (med *MockEthereumDatabase) AssertGetBlockCalledWith(hash []byte, blockNumber int64)
- func (med *MockEthereumDatabase) AssertGetBlockHashCalledWith(blockNumber int64)
- func (med *MockEthereumDatabase) AssertGetBlockReceiptsCalledWith(blockHash []byte, blockNumber int64)
- func (med *MockEthereumDatabase) GetBlock(hash []byte, blockNumber int64) *types.Block
- func (med *MockEthereumDatabase) GetBlockHash(blockNumber int64) []byte
- func (med *MockEthereumDatabase) GetBlockReceipts(blockHash []byte, blockNumber int64) types.Receipts
- func (med *MockEthereumDatabase) GetHeadBlockNumber() int64
- func (med *MockEthereumDatabase) SetReturnBlock(block *types.Block)
- func (med *MockEthereumDatabase) SetReturnHash(hash []byte)
- func (med *MockEthereumDatabase) SetReturnReceipts(receipts types.Receipts)
- type MockFilterRepository
- type MockFsReader
- type MockFullSyncBlockRetriever
- type MockHeaderRepository
- func (repository *MockHeaderRepository) AssertCreateOrUpdateHeaderCallCountAndPassedBlockNumbers(times int, blockNumbers []int64)
- func (repository *MockHeaderRepository) CreateOrUpdateHeader(header core.Header) (int64, error)
- func (repository *MockHeaderRepository) CreateTransactions(headerID int64, transactions []core.TransactionModel) error
- func (repository *MockHeaderRepository) GetHeader(blockNumber int64) (core.Header, error)
- func (repository *MockHeaderRepository) MissingBlockNumbers(startingBlockNumber, endingBlockNumber int64, nodeID string) ([]int64, error)
- func (repository *MockHeaderRepository) SetCreateOrUpdateHeaderReturnErr(err error)
- func (repository *MockHeaderRepository) SetCreateOrUpdateHeaderReturnID(id int64)
- func (repository *MockHeaderRepository) SetGetHeaderError(err error)
- func (repository *MockHeaderRepository) SetGetHeaderReturnBlockHash(hash string)
- func (repository *MockHeaderRepository) SetMissingBlockNumbers(blockNumbers []int64)
- type MockHeaderSyncBlockRetriever
- type MockHeaderSyncHeaderRepository
- func (*MockHeaderSyncHeaderRepository) AddCheckColumn(id string) error
- func (*MockHeaderSyncHeaderRepository) AddCheckColumns(ids []string) error
- func (*MockHeaderSyncHeaderRepository) CheckCache(key string) (interface{}, bool)
- func (*MockHeaderSyncHeaderRepository) MarkHeaderChecked(headerID int64, eventID string) error
- func (*MockHeaderSyncHeaderRepository) MarkHeaderCheckedForAll(headerID int64, ids []string) error
- func (*MockHeaderSyncHeaderRepository) MarkHeadersCheckedForAll(headers []core.Header, ids []string) error
- func (*MockHeaderSyncHeaderRepository) MissingHeaders(startingBlockNumber int64, endingBlockNumber int64, eventID string) ([]core.Header, error)
- func (*MockHeaderSyncHeaderRepository) MissingHeadersForAll(startingBlockNumber, endingBlockNumber int64, ids []string) ([]core.Header, error)
- func (*MockHeaderSyncHeaderRepository) MissingMethodsCheckedEventsIntersection(startingBlockNumber, endingBlockNumber int64, methodIds, eventIds []string) ([]core.Header, error)
- type MockLevelDatabaseReader
- func (mldr *MockLevelDatabaseReader) AssertGetBlockCalledWith(hash common.Hash, number uint64)
- func (mldr *MockLevelDatabaseReader) AssertGetBlockNumberCalledWith(hash common.Hash)
- func (mldr *MockLevelDatabaseReader) AssertGetBlockReceiptsCalledWith(hash common.Hash, number uint64)
- func (mldr *MockLevelDatabaseReader) AssertGetCanonicalHashCalledWith(number uint64)
- func (mldr *MockLevelDatabaseReader) AssertGetHeadBlockHashCalled()
- func (mldr *MockLevelDatabaseReader) GetBlock(hash common.Hash, number uint64) *types.Block
- func (mldr *MockLevelDatabaseReader) GetBlockNumber(hash common.Hash) *uint64
- func (mldr *MockLevelDatabaseReader) GetBlockReceipts(hash common.Hash, number uint64) types.Receipts
- func (mldr *MockLevelDatabaseReader) GetCanonicalHash(number uint64) common.Hash
- func (mldr *MockLevelDatabaseReader) GetHeadBlockHash() common.Hash
- func (mldr *MockLevelDatabaseReader) SetGetCanonicalHashReturnHash(hash common.Hash)
- func (mldr *MockLevelDatabaseReader) SetHeadBlockHashReturnHash(hash common.Hash)
- func (mldr *MockLevelDatabaseReader) SetReturnBlock(block *types.Block)
- func (mldr *MockLevelDatabaseReader) SetReturnBlockNumber(n uint64)
- func (mldr *MockLevelDatabaseReader) SetReturnReceipts(receipts types.Receipts)
- type MockParser
- func (parser *MockParser) Abi() string
- func (parser *MockParser) GetEvents(wanted []string) map[string]types.Event
- func (*MockParser) GetMethods(wanted []string) []types.Method
- func (*MockParser) GetSelectMethods(wanted []string) []types.Method
- func (*MockParser) Parse(contractAddr string) error
- func (m *MockParser) ParseAbiStr(abiStr string) error
- func (*MockParser) ParsedAbi() abi.ABI
- type MockPoller
- type MockReceiptRepository
- func (mrr *MockReceiptRepository) AssertCreateReceiptsAndLogsCalledWith(blockId int64, receipts []core.Receipt)
- func (mrr *MockReceiptRepository) AssertCreateReceiptsAndLogsNotCalled()
- func (mrr *MockReceiptRepository) CreateReceipt(blockId int64, receipt core.Receipt) (int64, error)
- func (mrr *MockReceiptRepository) CreateReceiptsAndLogs(blockId int64, receipts []core.Receipt) error
- func (mrr *MockReceiptRepository) GetReceipt(txHash string) (core.Receipt, error)
- func (mrr *MockReceiptRepository) SetCreateReceiptsAndLogsReturnErr(err error)
- type MockRpcClient
- func (client *MockRpcClient) AssertBatchCalledWith(method string, lengthOfBatch int)
- func (client *MockRpcClient) AssertCallContextCalledWith(ctx context.Context, result interface{}, method string)
- func (client *MockRpcClient) BatchCall(batch []client.BatchElem) error
- func (client *MockRpcClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
- func (client *MockRpcClient) IpcPath() string
- func (client *MockRpcClient) SetCallContextErr(err error)
- func (client *MockRpcClient) SetIpcPath(ipcPath string)
- func (client *MockRpcClient) SetReturnPOAHeader(header core.POAHeader)
- func (client *MockRpcClient) SetReturnPOAHeaders(headers []core.POAHeader)
- func (client *MockRpcClient) SetReturnPOWHeaders(headers []*types.Header)
- func (client *MockRpcClient) SetSupporedModules(supportedModules map[string]string)
- func (client *MockRpcClient) SupportedModules() (map[string]string, error)
- type MockTailer
- type MockTransactionConverter
- type MockTransactionSyncer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( FakeAddress = common.HexToAddress("0x1234567890abcdef") FakeError = errors.New("failed") FakeHash = common.BytesToHash([]byte{1, 2, 3, 4, 5}) )
View Source
var FakeHeader = core.Header{ Hash: FakeHash.String(), Raw: rawFakeHeader, Timestamp: strconv.FormatInt(fakeTimestamp, 10), }
View Source
var FakeTransaction = core.TransactionModel{ Data: []byte{}, From: "", GasLimit: 0, GasPrice: 0, Hash: "", Nonce: 0, Raw: rawTransaction.Bytes(), Receipt: core.Receipt{}, To: "", TxIndex: 0, Value: "0", }
Functions ¶
func GetFakeHeader ¶
func GetFakeHeaderWithTimestamp ¶ added in v0.0.2
func GetFakeTransaction ¶
func GetFakeTransaction(hash string, receipt core.Receipt) core.TransactionModel
func GetFakeUncle ¶
Types ¶
type MockBlockChain ¶
type MockBlockChain struct { GetTransactionsCalled bool GetTransactionsError error GetTransactionsPassedHashes []common.Hash Transactions []core.TransactionModel // contains filtered or unexported fields }
func NewMockBlockChain ¶
func NewMockBlockChain() *MockBlockChain
func (*MockBlockChain) AssertFetchContractDataCalledWith ¶
func (chain *MockBlockChain) AssertFetchContractDataCalledWith(abiJSON string, address string, method string, methodArgs []interface{}, result interface{}, blockNumber int64)
func (*MockBlockChain) AssertGetEthLogsWithCustomQueryCalledWith ¶
func (blockChain *MockBlockChain) AssertGetEthLogsWithCustomQueryCalledWith(query ethereum.FilterQuery)
func (*MockBlockChain) CallContract ¶
func (*MockBlockChain) FetchContractData ¶
func (*MockBlockChain) GetAccountBalance ¶
func (*MockBlockChain) GetBlockByNumber ¶
func (chain *MockBlockChain) GetBlockByNumber(blockNumber int64) (core.Block, error)
func (*MockBlockChain) GetEthLogsWithCustomQuery ¶
func (blockChain *MockBlockChain) GetEthLogsWithCustomQuery(query ethereum.FilterQuery) ([]types.Log, error)
func (*MockBlockChain) GetHeaderByNumber ¶
func (chain *MockBlockChain) GetHeaderByNumber(blockNumber int64) (core.Header, error)
func (*MockBlockChain) GetHeadersByNumbers ¶ added in v0.0.3
func (chain *MockBlockChain) GetHeadersByNumbers(blockNumbers []int64) ([]core.Header, error)
func (*MockBlockChain) GetTransactions ¶
func (chain *MockBlockChain) GetTransactions(transactionHashes []common.Hash) ([]core.TransactionModel, error)
func (*MockBlockChain) Node ¶
func (chain *MockBlockChain) Node() core.Node
func (*MockBlockChain) SetFetchContractDataErr ¶
func (chain *MockBlockChain) SetFetchContractDataErr(err error)
func (*MockBlockChain) SetGetAccountBalance ¶
func (blockChain *MockBlockChain) SetGetAccountBalance(balance *big.Int)
func (*MockBlockChain) SetGetAccountBalanceErr ¶
func (blockChain *MockBlockChain) SetGetAccountBalanceErr(err error)
func (*MockBlockChain) SetGetBlockByNumberErr ¶
func (chain *MockBlockChain) SetGetBlockByNumberErr(err error)
func (*MockBlockChain) SetGetEthLogsWithCustomQueryErr ¶
func (chain *MockBlockChain) SetGetEthLogsWithCustomQueryErr(err error)
func (*MockBlockChain) SetGetEthLogsWithCustomQueryReturnLogs ¶
func (chain *MockBlockChain) SetGetEthLogsWithCustomQueryReturnLogs(logs []types.Log)
func (*MockBlockChain) SetLastBlock ¶
func (chain *MockBlockChain) SetLastBlock(blockNumber *big.Int)
type MockBlockRepository ¶
type MockBlockRepository struct {
// contains filtered or unexported fields
}
func NewMockBlockRepository ¶
func NewMockBlockRepository() *MockBlockRepository
func (*MockBlockRepository) AssertCreateOrUpdateBlockCallCountEquals ¶
func (repository *MockBlockRepository) AssertCreateOrUpdateBlockCallCountEquals(times int)
func (*MockBlockRepository) AssertCreateOrUpdateBlockCalledWith ¶
func (repository *MockBlockRepository) AssertCreateOrUpdateBlockCalledWith(block core.Block)
func (*MockBlockRepository) AssertCreateOrUpdateBlocksCallCountAndBlockNumbersEquals ¶
func (repository *MockBlockRepository) AssertCreateOrUpdateBlocksCallCountAndBlockNumbersEquals(times int, blockNumbers []int64)
func (*MockBlockRepository) AssertMissingBlockNumbersCalledWith ¶
func (repository *MockBlockRepository) AssertMissingBlockNumbersCalledWith(startingBlockNumber int64, endingBlockNumber int64, nodeId string)
func (*MockBlockRepository) AssertSetBlockStatusCalledWith ¶
func (repository *MockBlockRepository) AssertSetBlockStatusCalledWith(chainHead int64)
func (*MockBlockRepository) CreateOrUpdateBlock ¶
func (repository *MockBlockRepository) CreateOrUpdateBlock(block core.Block) (int64, error)
func (*MockBlockRepository) GetBlock ¶
func (repository *MockBlockRepository) GetBlock(blockNumber int64) (core.Block, error)
func (*MockBlockRepository) MissingBlockNumbers ¶
func (repository *MockBlockRepository) MissingBlockNumbers(startingBlockNumber int64, endingBlockNumber int64, nodeId string) []int64
func (*MockBlockRepository) SetBlocksStatus ¶
func (repository *MockBlockRepository) SetBlocksStatus(chainHead int64) error
func (*MockBlockRepository) SetCreateOrUpdateBlockReturnVals ¶
func (repository *MockBlockRepository) SetCreateOrUpdateBlockReturnVals(i int64, err error)
func (*MockBlockRepository) SetMissingBlockNumbersReturnArray ¶
func (repository *MockBlockRepository) SetMissingBlockNumbersReturnArray(returnArray []int64)
type MockCryptoParser ¶
type MockCryptoParser struct {
// contains filtered or unexported fields
}
func NewMockCryptoParser ¶
func NewMockCryptoParser() *MockCryptoParser
func (*MockCryptoParser) AssertParsePublicKeyCalledWith ¶
func (mcp *MockCryptoParser) AssertParsePublicKeyCalledWith(privateKey string)
func (*MockCryptoParser) ParsePublicKey ¶
func (mcp *MockCryptoParser) ParsePublicKey(privateKey string) (string, error)
func (*MockCryptoParser) SetReturnErr ¶
func (mcp *MockCryptoParser) SetReturnErr(err error)
func (*MockCryptoParser) SetReturnVal ¶
func (mcp *MockCryptoParser) SetReturnVal(pubKey string)
type MockEthClient ¶
type MockEthClient struct {
// contains filtered or unexported fields
}
func NewMockEthClient ¶
func NewMockEthClient() *MockEthClient
func (*MockEthClient) AssertBalanceAtCalled ¶
func (*MockEthClient) AssertBatchCalledWith ¶
func (client *MockEthClient) AssertBatchCalledWith(method string)
func (*MockEthClient) AssertBlockByNumberCalledWith ¶
func (client *MockEthClient) AssertBlockByNumberCalledWith(ctx context.Context, number *big.Int)
func (*MockEthClient) AssertCallContractCalledWith ¶
func (client *MockEthClient) AssertCallContractCalledWith(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int)
func (*MockEthClient) AssertFilterLogsCalledWith ¶
func (client *MockEthClient) AssertFilterLogsCalledWith(ctx context.Context, q ethereum.FilterQuery)
func (*MockEthClient) AssertHeaderByNumberCalledWith ¶
func (client *MockEthClient) AssertHeaderByNumberCalledWith(ctx context.Context, number *big.Int)
func (*MockEthClient) AssertHeaderByNumbersCalledWith ¶
func (client *MockEthClient) AssertHeaderByNumbersCalledWith(number []*big.Int)
func (*MockEthClient) BatchCall ¶
func (client *MockEthClient) BatchCall(batch []client.BatchElem) error
func (*MockEthClient) BlockByNumber ¶
func (*MockEthClient) CallContract ¶
func (*MockEthClient) FilterLogs ¶
func (*MockEthClient) HeaderByNumber ¶
func (*MockEthClient) HeaderByNumbers ¶
func (*MockEthClient) SetBalanceAt ¶
func (client *MockEthClient) SetBalanceAt(balance *big.Int)
func (*MockEthClient) SetBalanceAtErr ¶
func (client *MockEthClient) SetBalanceAtErr(err error)
func (*MockEthClient) SetBlockByNumberErr ¶
func (client *MockEthClient) SetBlockByNumberErr(err error)
func (*MockEthClient) SetBlockByNumberReturnBlock ¶
func (client *MockEthClient) SetBlockByNumberReturnBlock(block *types.Block)
func (*MockEthClient) SetCallContractErr ¶
func (client *MockEthClient) SetCallContractErr(err error)
func (*MockEthClient) SetCallContractReturnBytes ¶
func (client *MockEthClient) SetCallContractReturnBytes(returnBytes []byte)
func (*MockEthClient) SetFilterLogsErr ¶
func (client *MockEthClient) SetFilterLogsErr(err error)
func (*MockEthClient) SetFilterLogsReturnLogs ¶
func (client *MockEthClient) SetFilterLogsReturnLogs(logs []types.Log)
func (*MockEthClient) SetHeaderByNumberErr ¶
func (client *MockEthClient) SetHeaderByNumberErr(err error)
func (*MockEthClient) SetHeaderByNumberReturnHeader ¶
func (client *MockEthClient) SetHeaderByNumberReturnHeader(header *types.Header)
func (*MockEthClient) SetHeaderByNumbersReturnHeader ¶
func (client *MockEthClient) SetHeaderByNumbersReturnHeader(headers []*types.Header)
func (*MockEthClient) SetTransactionReceiptErr ¶
func (client *MockEthClient) SetTransactionReceiptErr(err error)
func (*MockEthClient) SetTransactionReceipts ¶
func (client *MockEthClient) SetTransactionReceipts(receipts []*types.Receipt)
func (*MockEthClient) SetTransactionSenderErr ¶
func (client *MockEthClient) SetTransactionSenderErr(err error)
func (*MockEthClient) TransactionReceipt ¶
func (*MockEthClient) TransactionSender ¶
type MockEthereumDatabase ¶
type MockEthereumDatabase struct {
// contains filtered or unexported fields
}
func NewMockEthereumDatabase ¶
func NewMockEthereumDatabase() *MockEthereumDatabase
func (*MockEthereumDatabase) AssertGetBlockCalledWith ¶
func (med *MockEthereumDatabase) AssertGetBlockCalledWith(hash []byte, blockNumber int64)
func (*MockEthereumDatabase) AssertGetBlockHashCalledWith ¶
func (med *MockEthereumDatabase) AssertGetBlockHashCalledWith(blockNumber int64)
func (*MockEthereumDatabase) AssertGetBlockReceiptsCalledWith ¶
func (med *MockEthereumDatabase) AssertGetBlockReceiptsCalledWith(blockHash []byte, blockNumber int64)
func (*MockEthereumDatabase) GetBlock ¶
func (med *MockEthereumDatabase) GetBlock(hash []byte, blockNumber int64) *types.Block
func (*MockEthereumDatabase) GetBlockHash ¶
func (med *MockEthereumDatabase) GetBlockHash(blockNumber int64) []byte
func (*MockEthereumDatabase) GetBlockReceipts ¶
func (med *MockEthereumDatabase) GetBlockReceipts(blockHash []byte, blockNumber int64) types.Receipts
func (*MockEthereumDatabase) GetHeadBlockNumber ¶
func (med *MockEthereumDatabase) GetHeadBlockNumber() int64
func (*MockEthereumDatabase) SetReturnBlock ¶
func (med *MockEthereumDatabase) SetReturnBlock(block *types.Block)
func (*MockEthereumDatabase) SetReturnHash ¶
func (med *MockEthereumDatabase) SetReturnHash(hash []byte)
func (*MockEthereumDatabase) SetReturnReceipts ¶
func (med *MockEthereumDatabase) SetReturnReceipts(receipts types.Receipts)
type MockFilterRepository ¶
type MockFilterRepository struct { }
func (*MockFilterRepository) CreateFilter ¶
func (*MockFilterRepository) CreateFilter(filter filters.LogFilter) error
type MockFsReader ¶
type MockFsReader struct {
// contains filtered or unexported fields
}
func NewMockFsReader ¶
func NewMockFsReader() *MockFsReader
func (*MockFsReader) AssertReadCalledWith ¶
func (mfr *MockFsReader) AssertReadCalledWith(path string)
func (*MockFsReader) SetReturnBytes ¶
func (mfr *MockFsReader) SetReturnBytes(returnBytes []byte)
func (*MockFsReader) SetReturnErr ¶
func (mfr *MockFsReader) SetReturnErr(err error)
type MockFullSyncBlockRetriever ¶ added in v0.0.2
type MockFullSyncBlockRetriever struct { FirstBlock int64 FirstBlockErr error MostRecentBlock int64 }
func (*MockFullSyncBlockRetriever) RetrieveFirstBlock ¶ added in v0.0.2
func (retriever *MockFullSyncBlockRetriever) RetrieveFirstBlock(contractAddr string) (int64, error)
func (*MockFullSyncBlockRetriever) RetrieveMostRecentBlock ¶ added in v0.0.2
func (retriever *MockFullSyncBlockRetriever) RetrieveMostRecentBlock() (int64, error)
type MockHeaderRepository ¶
type MockHeaderRepository struct { CreateTransactionsCalled bool CreateTransactionsError error GetHeaderPassedBlockNumber int64 // contains filtered or unexported fields }
func NewMockHeaderRepository ¶
func NewMockHeaderRepository() *MockHeaderRepository
func (*MockHeaderRepository) AssertCreateOrUpdateHeaderCallCountAndPassedBlockNumbers ¶
func (repository *MockHeaderRepository) AssertCreateOrUpdateHeaderCallCountAndPassedBlockNumbers(times int, blockNumbers []int64)
func (*MockHeaderRepository) CreateOrUpdateHeader ¶
func (repository *MockHeaderRepository) CreateOrUpdateHeader(header core.Header) (int64, error)
func (*MockHeaderRepository) CreateTransactions ¶
func (repository *MockHeaderRepository) CreateTransactions(headerID int64, transactions []core.TransactionModel) error
func (*MockHeaderRepository) GetHeader ¶
func (repository *MockHeaderRepository) GetHeader(blockNumber int64) (core.Header, error)
func (*MockHeaderRepository) MissingBlockNumbers ¶
func (repository *MockHeaderRepository) MissingBlockNumbers(startingBlockNumber, endingBlockNumber int64, nodeID string) ([]int64, error)
func (*MockHeaderRepository) SetCreateOrUpdateHeaderReturnErr ¶
func (repository *MockHeaderRepository) SetCreateOrUpdateHeaderReturnErr(err error)
func (*MockHeaderRepository) SetCreateOrUpdateHeaderReturnID ¶
func (repository *MockHeaderRepository) SetCreateOrUpdateHeaderReturnID(id int64)
func (*MockHeaderRepository) SetGetHeaderError ¶
func (repository *MockHeaderRepository) SetGetHeaderError(err error)
func (*MockHeaderRepository) SetGetHeaderReturnBlockHash ¶
func (repository *MockHeaderRepository) SetGetHeaderReturnBlockHash(hash string)
func (*MockHeaderRepository) SetMissingBlockNumbers ¶
func (repository *MockHeaderRepository) SetMissingBlockNumbers(blockNumbers []int64)
type MockHeaderSyncBlockRetriever ¶ added in v0.0.2
func (*MockHeaderSyncBlockRetriever) RetrieveFirstBlock ¶ added in v0.0.2
func (retriever *MockHeaderSyncBlockRetriever) RetrieveFirstBlock() (int64, error)
func (*MockHeaderSyncBlockRetriever) RetrieveMostRecentBlock ¶ added in v0.0.2
func (retriever *MockHeaderSyncBlockRetriever) RetrieveMostRecentBlock() (int64, error)
type MockHeaderSyncHeaderRepository ¶ added in v0.0.2
type MockHeaderSyncHeaderRepository struct { }
func (*MockHeaderSyncHeaderRepository) AddCheckColumn ¶ added in v0.0.2
func (*MockHeaderSyncHeaderRepository) AddCheckColumn(id string) error
func (*MockHeaderSyncHeaderRepository) AddCheckColumns ¶ added in v0.0.2
func (*MockHeaderSyncHeaderRepository) AddCheckColumns(ids []string) error
func (*MockHeaderSyncHeaderRepository) CheckCache ¶ added in v0.0.2
func (*MockHeaderSyncHeaderRepository) CheckCache(key string) (interface{}, bool)
func (*MockHeaderSyncHeaderRepository) MarkHeaderChecked ¶ added in v0.0.2
func (*MockHeaderSyncHeaderRepository) MarkHeaderChecked(headerID int64, eventID string) error
func (*MockHeaderSyncHeaderRepository) MarkHeaderCheckedForAll ¶ added in v0.0.2
func (*MockHeaderSyncHeaderRepository) MarkHeaderCheckedForAll(headerID int64, ids []string) error
func (*MockHeaderSyncHeaderRepository) MarkHeadersCheckedForAll ¶ added in v0.0.2
func (*MockHeaderSyncHeaderRepository) MarkHeadersCheckedForAll(headers []core.Header, ids []string) error
func (*MockHeaderSyncHeaderRepository) MissingHeaders ¶ added in v0.0.2
func (*MockHeaderSyncHeaderRepository) MissingHeadersForAll ¶ added in v0.0.2
func (*MockHeaderSyncHeaderRepository) MissingMethodsCheckedEventsIntersection ¶ added in v0.0.2
type MockLevelDatabaseReader ¶
type MockLevelDatabaseReader struct {
// contains filtered or unexported fields
}
func NewMockLevelDatabaseReader ¶
func NewMockLevelDatabaseReader() *MockLevelDatabaseReader
func (*MockLevelDatabaseReader) AssertGetBlockCalledWith ¶
func (mldr *MockLevelDatabaseReader) AssertGetBlockCalledWith(hash common.Hash, number uint64)
func (*MockLevelDatabaseReader) AssertGetBlockNumberCalledWith ¶
func (mldr *MockLevelDatabaseReader) AssertGetBlockNumberCalledWith(hash common.Hash)
func (*MockLevelDatabaseReader) AssertGetBlockReceiptsCalledWith ¶
func (mldr *MockLevelDatabaseReader) AssertGetBlockReceiptsCalledWith(hash common.Hash, number uint64)
func (*MockLevelDatabaseReader) AssertGetCanonicalHashCalledWith ¶
func (mldr *MockLevelDatabaseReader) AssertGetCanonicalHashCalledWith(number uint64)
func (*MockLevelDatabaseReader) AssertGetHeadBlockHashCalled ¶
func (mldr *MockLevelDatabaseReader) AssertGetHeadBlockHashCalled()
func (*MockLevelDatabaseReader) GetBlockNumber ¶
func (mldr *MockLevelDatabaseReader) GetBlockNumber(hash common.Hash) *uint64
func (*MockLevelDatabaseReader) GetBlockReceipts ¶
func (*MockLevelDatabaseReader) GetCanonicalHash ¶
func (mldr *MockLevelDatabaseReader) GetCanonicalHash(number uint64) common.Hash
func (*MockLevelDatabaseReader) GetHeadBlockHash ¶
func (mldr *MockLevelDatabaseReader) GetHeadBlockHash() common.Hash
func (*MockLevelDatabaseReader) SetGetCanonicalHashReturnHash ¶
func (mldr *MockLevelDatabaseReader) SetGetCanonicalHashReturnHash(hash common.Hash)
func (*MockLevelDatabaseReader) SetHeadBlockHashReturnHash ¶
func (mldr *MockLevelDatabaseReader) SetHeadBlockHashReturnHash(hash common.Hash)
func (*MockLevelDatabaseReader) SetReturnBlock ¶
func (mldr *MockLevelDatabaseReader) SetReturnBlock(block *types.Block)
func (*MockLevelDatabaseReader) SetReturnBlockNumber ¶
func (mldr *MockLevelDatabaseReader) SetReturnBlockNumber(n uint64)
func (*MockLevelDatabaseReader) SetReturnReceipts ¶
func (mldr *MockLevelDatabaseReader) SetReturnReceipts(receipts types.Receipts)
type MockParser ¶
func (*MockParser) Abi ¶
func (parser *MockParser) Abi() string
func (*MockParser) GetEvents ¶
func (parser *MockParser) GetEvents(wanted []string) map[string]types.Event
func (*MockParser) GetMethods ¶
func (*MockParser) GetMethods(wanted []string) []types.Method
func (*MockParser) GetSelectMethods ¶
func (*MockParser) GetSelectMethods(wanted []string) []types.Method
func (*MockParser) Parse ¶
func (*MockParser) Parse(contractAddr string) error
func (*MockParser) ParseAbiStr ¶
func (m *MockParser) ParseAbiStr(abiStr string) error
func (*MockParser) ParsedAbi ¶
func (*MockParser) ParsedAbi() abi.ABI
type MockPoller ¶
type MockPoller struct {
ContractName string
}
func (*MockPoller) FetchContractData ¶
func (poller *MockPoller) FetchContractData(contractAbi, contractAddress, method string, methodArgs []interface{}, result interface{}, blockNumber int64) error
func (*MockPoller) PollContract ¶
func (*MockPoller) PollContract(con contract.Contract, lastBlock int64) error
func (*MockPoller) PollContractAt ¶
func (*MockPoller) PollContractAt(con contract.Contract, blockNumber int64) error
type MockReceiptRepository ¶
type MockReceiptRepository struct {
// contains filtered or unexported fields
}
func NewMockReceiptRepository ¶
func NewMockReceiptRepository() *MockReceiptRepository
func (*MockReceiptRepository) AssertCreateReceiptsAndLogsCalledWith ¶
func (mrr *MockReceiptRepository) AssertCreateReceiptsAndLogsCalledWith(blockId int64, receipts []core.Receipt)
func (*MockReceiptRepository) AssertCreateReceiptsAndLogsNotCalled ¶
func (mrr *MockReceiptRepository) AssertCreateReceiptsAndLogsNotCalled()
func (*MockReceiptRepository) CreateReceipt ¶
func (*MockReceiptRepository) CreateReceiptsAndLogs ¶
func (mrr *MockReceiptRepository) CreateReceiptsAndLogs(blockId int64, receipts []core.Receipt) error
func (*MockReceiptRepository) GetReceipt ¶
func (mrr *MockReceiptRepository) GetReceipt(txHash string) (core.Receipt, error)
func (*MockReceiptRepository) SetCreateReceiptsAndLogsReturnErr ¶
func (mrr *MockReceiptRepository) SetCreateReceiptsAndLogsReturnErr(err error)
type MockRpcClient ¶
type MockRpcClient struct {
// contains filtered or unexported fields
}
func NewMockRpcClient ¶
func NewMockRpcClient() *MockRpcClient
func (*MockRpcClient) AssertBatchCalledWith ¶
func (client *MockRpcClient) AssertBatchCalledWith(method string, lengthOfBatch int)
func (*MockRpcClient) AssertCallContextCalledWith ¶
func (client *MockRpcClient) AssertCallContextCalledWith(ctx context.Context, result interface{}, method string)
func (*MockRpcClient) BatchCall ¶
func (client *MockRpcClient) BatchCall(batch []client.BatchElem) error
func (*MockRpcClient) CallContext ¶
func (client *MockRpcClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
func (*MockRpcClient) IpcPath ¶
func (client *MockRpcClient) IpcPath() string
func (*MockRpcClient) SetCallContextErr ¶
func (client *MockRpcClient) SetCallContextErr(err error)
func (*MockRpcClient) SetIpcPath ¶
func (client *MockRpcClient) SetIpcPath(ipcPath string)
func (*MockRpcClient) SetReturnPOAHeader ¶
func (client *MockRpcClient) SetReturnPOAHeader(header core.POAHeader)
func (*MockRpcClient) SetReturnPOAHeaders ¶
func (client *MockRpcClient) SetReturnPOAHeaders(headers []core.POAHeader)
func (*MockRpcClient) SetReturnPOWHeaders ¶
func (client *MockRpcClient) SetReturnPOWHeaders(headers []*types.Header)
func (*MockRpcClient) SetSupporedModules ¶
func (client *MockRpcClient) SetSupporedModules(supportedModules map[string]string)
func (*MockRpcClient) SupportedModules ¶
func (client *MockRpcClient) SupportedModules() (map[string]string, error)
type MockTailer ¶
func NewMockTailer ¶
func NewMockTailer() *MockTailer
type MockTransactionConverter ¶
type MockTransactionConverter struct { ConvertHeaderTransactionIndexToIntCalled bool ConvertBlockTransactionsToCoreCalled bool ConvertBlockTransactionsToCorePassedBlock *types.Block }
func NewMockTransactionConverter ¶
func NewMockTransactionConverter() *MockTransactionConverter
func (*MockTransactionConverter) ConvertBlockTransactionsToCore ¶
func (converter *MockTransactionConverter) ConvertBlockTransactionsToCore(gethBlock *types.Block) ([]core.TransactionModel, error)
func (*MockTransactionConverter) ConvertRpcTransactionsToModels ¶
func (converter *MockTransactionConverter) ConvertRpcTransactionsToModels(transactions []core.RpcTransaction) ([]core.TransactionModel, error)
type MockTransactionSyncer ¶
func (*MockTransactionSyncer) SyncTransactions ¶
func (syncer *MockTransactionSyncer) SyncTransactions(headerID int64, logs []types.Log) error
Source Files ¶
- data.go
- mock_block_repository.go
- mock_blockchain.go
- mock_crypto_parser.go
- mock_eth_client.go
- mock_ethereum_database.go
- mock_filter_repository.go
- mock_fs_reader.go
- mock_full_sync_block_retriever.go
- mock_header_repository.go
- mock_header_sync_block_retriever.go
- mock_header_sync_header_repository.go
- mock_level_database_reader.go
- mock_parser.go
- mock_poller.go
- mock_receipt_repository.go
- mock_rpc_client.go
- mock_tailer.go
- mock_transaction_converter.go
- mock_transaction_syncer.go
Click to show internal directories.
Click to hide internal directories.