repositories

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: AGPL-3.0 Imports: 11 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBlockExists = errors.New("Won't add block that already exists.")
View Source
var ErrValidHeaderExists = errors.New("valid header already exists")

Functions

This section is empty.

Types

type AddressRepository added in v0.0.6

type AddressRepository struct{}

func (AddressRepository) GetAddressById added in v0.0.6

func (AddressRepository) GetAddressById(db *postgres.DB, id int64) (string, error)

func (AddressRepository) GetOrCreateAddress added in v0.0.6

func (AddressRepository) GetOrCreateAddress(db *postgres.DB, address string) (int64, error)

func (AddressRepository) GetOrCreateAddressInTransaction added in v0.0.6

func (AddressRepository) GetOrCreateAddressInTransaction(tx *sqlx.Tx, address string) (int64, error)

type BlockRepository

type BlockRepository struct {
	// contains filtered or unexported fields
}

func NewBlockRepository

func NewBlockRepository(database *postgres.DB) *BlockRepository

func (BlockRepository) CreateOrUpdateBlock

func (blockRepository BlockRepository) CreateOrUpdateBlock(block core.Block) (int64, error)

func (BlockRepository) GetBlock

func (blockRepository BlockRepository) GetBlock(blockNumber int64) (core.Block, error)

func (BlockRepository) LoadTransactions

func (blockRepository BlockRepository) LoadTransactions(transactionRows *sqlx.Rows) []core.TransactionModel

func (BlockRepository) MissingBlockNumbers

func (blockRepository BlockRepository) MissingBlockNumbers(startingBlockNumber int64, highestBlockNumber int64, nodeId string) []int64

func (BlockRepository) SetBlocksStatus

func (blockRepository BlockRepository) SetBlocksStatus(chainHead int64) error

type ContractRepository

type ContractRepository struct {
	*postgres.DB
}

func (ContractRepository) ContractExists

func (contractRepository ContractRepository) ContractExists(contractHash string) (bool, error)

func (ContractRepository) CreateContract

func (contractRepository ContractRepository) CreateContract(contract core.Contract) error

func (ContractRepository) GetContract

func (contractRepository ContractRepository) GetContract(contractHash string) (core.Contract, error)

type DBLogFilter

type DBLogFilter struct {
	ID int
	*filters.LogFilter
	Topics DBTopics
}

type DBTopics

type DBTopics []*string

func (*DBTopics) Scan

func (t *DBTopics) Scan(src interface{}) error

type FilterRepository

type FilterRepository struct {
	*postgres.DB
}

func (FilterRepository) CreateFilter

func (filterRepository FilterRepository) CreateFilter(query filters.LogFilter) error

func (FilterRepository) GetFilter

func (filterRepository FilterRepository) GetFilter(name string) (filters.LogFilter, error)

type FullSyncReceiptRepository added in v0.0.6

type FullSyncReceiptRepository struct {
	*postgres.DB
}

func (FullSyncReceiptRepository) CreateFullSyncReceiptInTx added in v0.0.6

func (FullSyncReceiptRepository) CreateFullSyncReceiptInTx(blockId int64, receipt core.Receipt, tx *sqlx.Tx) (int64, error)

func (FullSyncReceiptRepository) CreateReceiptsAndLogs added in v0.0.6

func (receiptRepository FullSyncReceiptRepository) CreateReceiptsAndLogs(blockId int64, receipts []core.Receipt) error

func (FullSyncReceiptRepository) GetFullSyncReceipt added in v0.0.6

func (receiptRepository FullSyncReceiptRepository) GetFullSyncReceipt(txHash string) (core.Receipt, error)

type HeaderRepository

type HeaderRepository struct {
	// contains filtered or unexported fields
}

func NewHeaderRepository

func NewHeaderRepository(database *postgres.DB) HeaderRepository

func (HeaderRepository) CreateOrUpdateHeader

func (repository HeaderRepository) CreateOrUpdateHeader(header core.Header) (int64, error)

func (HeaderRepository) CreateTransactionInTx

func (repository HeaderRepository) CreateTransactionInTx(tx *sqlx.Tx, headerID int64, transaction core.TransactionModel) (int64, error)

func (HeaderRepository) CreateTransactions

func (repository HeaderRepository) CreateTransactions(headerID int64, transactions []core.TransactionModel) error

func (HeaderRepository) GetHeader

func (repository HeaderRepository) GetHeader(blockNumber int64) (core.Header, error)

func (HeaderRepository) MissingBlockNumbers

func (repository HeaderRepository) MissingBlockNumbers(startingBlockNumber, endingBlockNumber int64, nodeID string) ([]int64, error)

type HeaderSyncReceiptRepository added in v0.0.6

type HeaderSyncReceiptRepository struct{}

func (HeaderSyncReceiptRepository) CreateHeaderSyncReceiptInTx added in v0.0.6

func (HeaderSyncReceiptRepository) CreateHeaderSyncReceiptInTx(headerID, transactionID int64, receipt core.Receipt, tx *sqlx.Tx) (int64, error)

type LogRepository

type LogRepository struct {
	*postgres.DB
}

func (LogRepository) CreateLogs

func (logRepository LogRepository) CreateLogs(lgs []core.Log, receiptId int64) error

func (LogRepository) GetLogs

func (logRepository LogRepository) GetLogs(address string, blockNumber int64) ([]core.Log, error)

type WatchedEventRepository

type WatchedEventRepository struct {
	*postgres.DB
}

func (WatchedEventRepository) GetWatchedEvents

func (watchedEventRepository WatchedEventRepository) GetWatchedEvents(name string) ([]*core.WatchedEvent, error)

Jump to

Keyboard shortcuts

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