repositories

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: 9 Imported by: 0

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

func (repository HeaderRepository) CreateReceiptInTx(tx *sqlx.Tx, headerID, transactionID int64, receipt core.Receipt) (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 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 ReceiptRepository

type ReceiptRepository struct {
	*postgres.DB
}

func (ReceiptRepository) CreateReceipt

func (receiptRepository ReceiptRepository) CreateReceipt(blockId int64, receipt core.Receipt) (int64, error)

func (ReceiptRepository) CreateReceiptsAndLogs

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

func (ReceiptRepository) GetReceipt

func (receiptRepository ReceiptRepository) GetReceipt(txHash string) (core.Receipt, 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