mocks

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FakeTransformerConfig = transformer.EventTransformerConfig{
	TransformerName:   "FakeTransformer",
	ContractAddresses: []string{"FakeAddress"},
	Topic:             "FakeTopic",
}

Functions

This section is empty.

Types

type MockConverter

type MockConverter struct {
	ToEntitiesError         error
	PassedContractAddresses []string
	ToModelsError           error

	ContractAbi             string
	LogsToConvert           []types.Log
	EntitiesToConvert       []interface{}
	EntitiesToReturn        []interface{}
	ModelsToReturn          []interface{}
	ToEntitiesCalledCounter int
	ToModelsCalledCounter   int
	// contains filtered or unexported fields
}

func (*MockConverter) SetToEntityConverterError

func (converter *MockConverter) SetToEntityConverterError(err error)

func (*MockConverter) SetToModelConverterError

func (c *MockConverter) SetToModelConverterError(err error)

func (*MockConverter) ToEntities

func (converter *MockConverter) ToEntities(contractAbi string, ethLogs []types.Log) ([]interface{}, error)

func (*MockConverter) ToModels

func (converter *MockConverter) ToModels(entities []interface{}) ([]interface{}, error)

type MockEventTransformer added in v0.2.2

type MockEventTransformer struct {
	ExecuteWasCalled bool
	ExecuteError     error
	PassedLogs       []types.Log
	PassedHeader     core.Header
	// contains filtered or unexported fields
}

func (*MockEventTransformer) Execute added in v0.2.2

func (mh *MockEventTransformer) Execute(logs []types.Log, header core.Header) error

func (*MockEventTransformer) FakeEventTransformerInitializer added in v0.2.2

func (mh *MockEventTransformer) FakeEventTransformerInitializer(db *postgres.DB) transformer.EventTransformer

func (*MockEventTransformer) GetConfig added in v0.2.2

func (*MockEventTransformer) SetEventTransformerConfig added in v0.2.2

func (mh *MockEventTransformer) SetEventTransformerConfig(config transformer.EventTransformerConfig)

type MockLogFetcher

type MockLogFetcher struct {
	FetchedContractAddresses [][]common.Address
	FetchedTopics            [][]common.Hash
	FetchedBlocks            []int64

	FetchedLogs     []types.Log
	SetBcCalled     bool
	FetchLogsCalled bool
	// contains filtered or unexported fields
}

func (*MockLogFetcher) FetchLogs

func (mlf *MockLogFetcher) FetchLogs(contractAddresses []common.Address, topics []common.Hash, header core.Header) ([]types.Log, error)

func (*MockLogFetcher) SetBC

func (mlf *MockLogFetcher) SetBC(bc core.BlockChain)

func (*MockLogFetcher) SetFetchedLogs

func (mlf *MockLogFetcher) SetFetchedLogs(logs []types.Log)

func (*MockLogFetcher) SetFetcherError

func (mlf *MockLogFetcher) SetFetcherError(err error)

type MockLogNoteConverter

type MockLogNoteConverter struct {
	PassedLogs            []types.Log
	ToModelsCalledCounter int
	// contains filtered or unexported fields
}

func (*MockLogNoteConverter) SetConverterError

func (converter *MockLogNoteConverter) SetConverterError(e error)

func (*MockLogNoteConverter) SetReturnModels

func (converter *MockLogNoteConverter) SetReturnModels(models []interface{})

func (*MockLogNoteConverter) ToModels

func (converter *MockLogNoteConverter) ToModels(ethLogs []types.Log) ([]interface{}, error)

type MockMappings

type MockMappings struct {
	Metadata     utils.StorageValueMetadata
	LookupCalled bool
	LookupErr    error
}

func (*MockMappings) Lookup

func (mappings *MockMappings) Lookup(key common.Hash) (utils.StorageValueMetadata, error)

func (*MockMappings) SetDB

func (*MockMappings) SetDB(db *postgres.DB)

type MockRepository

type MockRepository struct {
	MarkHeaderCheckedPassedHeaderIDs []int64
	CreatedHeaderIds                 []int64

	PassedHeaderID      int64
	PassedModels        []interface{}
	SetDbCalled         bool
	CreateCalledCounter int
	// contains filtered or unexported fields
}

func (*MockRepository) AssertMarkHeaderCheckedCalledWith

func (repository *MockRepository) AssertMarkHeaderCheckedCalledWith(i int64)

func (*MockRepository) AssertMarkHeaderCheckedNotCalled

func (repository *MockRepository) AssertMarkHeaderCheckedNotCalled()

func (*MockRepository) Create

func (repository *MockRepository) Create(headerID int64, models []interface{}) error

func (*MockRepository) MarkHeaderChecked

func (repository *MockRepository) MarkHeaderChecked(headerID int64) error

func (*MockRepository) SetCreateError

func (repository *MockRepository) SetCreateError(e error)

func (*MockRepository) SetDB

func (repository *MockRepository) SetDB(db *postgres.DB)

func (*MockRepository) SetMarkHeaderCheckedError

func (repository *MockRepository) SetMarkHeaderCheckedError(e error)

type MockStorageRepository

type MockStorageRepository struct {
	CreateErr         error
	PassedBlockNumber int
	PassedBlockHash   string
	PassedMetadata    utils.StorageValueMetadata
	PassedValue       interface{}
}

func (*MockStorageRepository) Create

func (repository *MockStorageRepository) Create(blockNumber int, blockHash string, metadata utils.StorageValueMetadata, value interface{}) error

func (*MockStorageRepository) SetDB

func (*MockStorageRepository) SetDB(db *postgres.DB)

type MockStorageTransformer

type MockStorageTransformer struct {
	Address    common.Address
	ExecuteErr error
	PassedRow  utils.StorageDiffRow
}

func (*MockStorageTransformer) ContractAddress

func (transformer *MockStorageTransformer) ContractAddress() common.Address

func (*MockStorageTransformer) Execute

func (transformer *MockStorageTransformer) Execute(row utils.StorageDiffRow) error

func (*MockStorageTransformer) FakeTransformerInitializer

func (transformer *MockStorageTransformer) FakeTransformerInitializer(db *postgres.DB) transformer.StorageTransformer

Jump to

Keyboard shortcuts

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