mocks

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FakeTransformerConfig = shared_t.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 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

	PassedStartingBlockNumber int64
	PassedEndingBlockNumber   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) MissingHeaders

func (repository *MockRepository) MissingHeaders(startingBlockNumber, endingBlockNumber int64) ([]core.Header, error)

func (*MockRepository) RecheckHeaders

func (repository *MockRepository) RecheckHeaders(startingBlockNumber, endingBlockNumber int64) ([]core.Header, error)

func (*MockRepository) SetAllHeaders

func (repository *MockRepository) SetAllHeaders(headers []core.Header)

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)

func (*MockRepository) SetMissingHeaders

func (repository *MockRepository) SetMissingHeaders(headers []core.Header)

func (*MockRepository) SetMissingHeadersError

func (repository *MockRepository) SetMissingHeadersError(e error)

type MockStorageQueue

type MockStorageQueue struct {
	AddCalled bool
	AddError  error
}

func (*MockStorageQueue) Add

func (queue *MockStorageQueue) Add(row utils.StorageDiffRow) 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

type MockTransformer

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

func (*MockTransformer) Execute

func (mh *MockTransformer) Execute(logs []types.Log, header core.Header, recheckHeaders constants.TransformerExecution) error

func (*MockTransformer) FakeTransformerInitializer

func (mh *MockTransformer) FakeTransformerInitializer(db *postgres.DB) shared_t.EventTransformer

func (*MockTransformer) GetConfig

func (*MockTransformer) SetTransformerConfig

func (mh *MockTransformer) SetTransformerConfig(config shared_t.EventTransformerConfig)

type MockWatcherRepository

type MockWatcherRepository struct {
	ReturnCheckedColumnNames    []string
	GetCheckedColumnNamesError  error
	GetCheckedColumnNamesCalled bool

	ReturnNotCheckedSQL       string
	CreateNotCheckedSQLCalled bool

	ReturnMissingHeaders []core.Header
	MissingHeadersError  error
	MissingHeadersCalled bool
}

func (*MockWatcherRepository) CreateNotCheckedSQL

func (repository *MockWatcherRepository) CreateNotCheckedSQL(boolColumns []string) string

func (*MockWatcherRepository) GetCheckedColumnNames

func (repository *MockWatcherRepository) GetCheckedColumnNames(db *postgres.DB) ([]string, error)

func (*MockWatcherRepository) MissingHeaders

func (repository *MockWatcherRepository) MissingHeaders(startingBlockNumber int64, endingBlockNumber int64, db *postgres.DB, notCheckedSQL string) ([]core.Header, error)

func (*MockWatcherRepository) SetCheckedColumnNames

func (repository *MockWatcherRepository) SetCheckedColumnNames(checkedColumnNames []string)

func (*MockWatcherRepository) SetMissingHeaders

func (repository *MockWatcherRepository) SetMissingHeaders(headers []core.Header)

func (*MockWatcherRepository) SetNotCheckedSQL

func (repository *MockWatcherRepository) SetNotCheckedSQL(notCheckedSql string)

Jump to

Keyboard shortcuts

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