fakes

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

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 GetFakeHeader(blockNumber int64) core.Header

func GetFakeHeaderWithTimestamp added in v0.0.2

func GetFakeHeaderWithTimestamp(timestamp, blockNumber int64) core.Header

func GetFakeTransaction

func GetFakeTransaction(hash string, receipt core.Receipt) core.TransactionModel

func GetFakeUncle

func GetFakeUncle(hash, reward string) core.Uncle

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 (chain *MockBlockChain) CallContract(contractHash string, input []byte, blockNumber *big.Int) ([]byte, error)

func (*MockBlockChain) FetchContractData

func (blockChain *MockBlockChain) FetchContractData(abiJSON string, address string, method string, methodArgs []interface{}, result interface{}, blockNumber int64) error

func (*MockBlockChain) GetAccountBalance

func (blockChain *MockBlockChain) GetAccountBalance(address common.Address, blockNumber *big.Int) (*big.Int, error)

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) GetLogs

func (chain *MockBlockChain) GetLogs(contract core.Contract, startingBlockNumber, endingBlockNumber *big.Int) ([]core.Log, error)

func (*MockBlockChain) GetTransactions

func (chain *MockBlockChain) GetTransactions(transactionHashes []common.Hash) ([]core.TransactionModel, error)

func (*MockBlockChain) LastBlock

func (chain *MockBlockChain) LastBlock() (*big.Int, 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 (client *MockEthClient) AssertBalanceAtCalled(ctx context.Context, account common.Address, blockNumber *big.Int)

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) BalanceAt

func (client *MockEthClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)

func (*MockEthClient) BatchCall

func (client *MockEthClient) BatchCall(batch []client.BatchElem) error

func (*MockEthClient) BlockByNumber

func (client *MockEthClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)

func (*MockEthClient) CallContract

func (client *MockEthClient) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)

func (*MockEthClient) FilterLogs

func (client *MockEthClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)

func (*MockEthClient) HeaderByNumber

func (client *MockEthClient) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)

func (*MockEthClient) HeaderByNumbers

func (client *MockEthClient) HeaderByNumbers(numbers []*big.Int) ([]*types.Header, error)

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 (client *MockEthClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)

func (*MockEthClient) TransactionSender

func (client *MockEthClient) TransactionSender(ctx context.Context, tx *types.Transaction, block common.Hash, index uint) (common.Address, error)

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

func (*MockFilterRepository) GetFilter

func (*MockFilterRepository) GetFilter(name string) (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) Read

func (mfr *MockFsReader) Read(path string) ([]byte, error)

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

type MockHeaderSyncBlockRetriever struct {
	FirstBlock    int64
	FirstBlockErr error
}

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) MissingHeaders(startingBlockNumber int64, endingBlockNumber int64, eventID string) ([]core.Header, error)

func (*MockHeaderSyncHeaderRepository) MissingHeadersForAll added in v0.0.2

func (*MockHeaderSyncHeaderRepository) MissingHeadersForAll(startingBlockNumber, endingBlockNumber int64, ids []string) ([]core.Header, error)

func (*MockHeaderSyncHeaderRepository) MissingMethodsCheckedEventsIntersection added in v0.0.2

func (*MockHeaderSyncHeaderRepository) MissingMethodsCheckedEventsIntersection(startingBlockNumber, endingBlockNumber int64, methodIds, eventIds []string) ([]core.Header, error)

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) GetBlock

func (mldr *MockLevelDatabaseReader) GetBlock(hash common.Hash, number uint64) *types.Block

func (*MockLevelDatabaseReader) GetBlockNumber

func (mldr *MockLevelDatabaseReader) GetBlockNumber(hash common.Hash) *uint64

func (*MockLevelDatabaseReader) GetBlockReceipts

func (mldr *MockLevelDatabaseReader) GetBlockReceipts(hash common.Hash, number uint64) types.Receipts

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

type MockParser struct {
	AbiToReturn string
	EventName   string
	Event       types.Event
}

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 (mrr *MockReceiptRepository) CreateReceipt(blockId int64, receipt core.Receipt) (int64, error)

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

type MockTailer struct {
	Lines   chan *tail.Line
	TailErr error
}

func NewMockTailer

func NewMockTailer() *MockTailer

func (*MockTailer) Tail

func (mock *MockTailer) Tail() (*tail.Tail, error)

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

type MockTransactionSyncer struct {
	SyncTransactionsCalled bool
	SyncTransactionsError  error
}

func (*MockTransactionSyncer) SyncTransactions

func (syncer *MockTransactionSyncer) SyncTransactions(headerID int64, logs []types.Log) error

Jump to

Keyboard shortcuts

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