tendermint

package
v0.0.0-...-fa14253 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TMStore

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

TMStore is a Store implementation using Tendermint tm-db

func NewTMStore

func NewTMStore(db tmDB.DB) *TMStore

NewTMStore creates a new TMStore

func (*TMStore) AddOrUpdateAttempt

func (store *TMStore) AddOrUpdateAttempt(tx *models.Tx, attempt *models.TxAttempt) error

AddOrUpdateAttempt adds a new attempt or updates an existing attempt assuming only the state, NOT the gas price, has changed. In case of an addition, the list of attempts are sorted by gas price.

func (*TMStore) AddTx

func (store *TMStore) AddTx(
	txID uuid.UUID,
	fromAddress common.Address,
	toAddress common.Address,
	encodedPayload []byte,
	value *big.Int,
	gasLimit uint64,
	maxGasPrice *big.Int,
) error

func (*TMStore) Chain

func (store *TMStore) Chain(hash common.Hash, lookback int64) (*models.Head, error)

Chain returns the chain of heads starting at hash and up to lookback parents.

func (*TMStore) DeleteJob

func (store *TMStore) DeleteJob(jobID uuid.UUID) error

func (*TMStore) DeleteTxAttempt

func (store *TMStore) DeleteTxAttempt(id uuid.UUID) error

func (*TMStore) DeleteTxReceipt

func (store *TMStore) DeleteTxReceipt(id uuid.UUID) error

func (*TMStore) FirstHead

func (store *TMStore) FirstHead() (*models.Head, error)

FirstHead returns the head with the lowest number. Only for testing.

func (*TMStore) GetAccount

func (store *TMStore) GetAccount(fromAddress common.Address) (*models.Account, error)

func (*TMStore) GetAccounts

func (store *TMStore) GetAccounts() ([]*models.Account, error)

func (*TMStore) GetAttemptsForTx

func (store *TMStore) GetAttemptsForTx(tx *models.Tx) ([]*models.TxAttempt, error)

func (*TMStore) GetInProgressAttempts

func (store *TMStore) GetInProgressAttempts(address common.Address) ([]*models.TxAttempt, error)

func (*TMStore) GetInProgressTx

func (store *TMStore) GetInProgressTx(fromAddress common.Address) (*models.Tx, error)

func (*TMStore) GetJob

func (store *TMStore) GetJob(jobID uuid.UUID) (*models.Job, error)

func (*TMStore) GetNextNonce

func (store *TMStore) GetNextNonce(address common.Address) (int64, error)

func (*TMStore) GetNextUnstartedTx

func (store *TMStore) GetNextUnstartedTx(fromAddress common.Address) (*models.Tx, error)

func (*TMStore) GetTx

func (store *TMStore) GetTx(id uuid.UUID) (*models.Tx, error)

func (*TMStore) GetTxAttempt

func (store *TMStore) GetTxAttempt(id uuid.UUID) (*models.TxAttempt, error)

func (*TMStore) GetTxReceipt

func (store *TMStore) GetTxReceipt(id uuid.UUID) (*models.TxReceipt, error)

func (*TMStore) GetTxsConfirmedAtOrAboveBlockHeight

func (store *TMStore) GetTxsConfirmedAtOrAboveBlockHeight(blockNum int64) ([]*models.Tx, error)

func (*TMStore) GetTxsRequiringNewAttempt

func (store *TMStore) GetTxsRequiringNewAttempt(
	address common.Address,
	blockNum int64,
	gasBumpThreshold int64,
	depth int,
) ([]*models.Tx, error)

func (*TMStore) GetTxsRequiringReceiptFetch

func (store *TMStore) GetTxsRequiringReceiptFetch() ([]*models.Tx, error)

func (*TMStore) GetUnhandledJobIDs

func (store *TMStore) GetUnhandledJobIDs() ([]uuid.UUID, error)

func (*TMStore) HeadByHash

func (store *TMStore) HeadByHash(hash common.Hash) (*models.Head, error)

HeadByHash fetches the head with the given hash from the db, returns nil if none exists.

func (*TMStore) InsertHead

func (store *TMStore) InsertHead(head *models.Head) error

InsertHead inserts a block head

func (*TMStore) IsTxConfirmedAtOrBeforeBlockNumber

func (store *TMStore) IsTxConfirmedAtOrBeforeBlockNumber(txID uuid.UUID, blockNumber int64) (bool, error)

func (*TMStore) LastHead

func (store *TMStore) LastHead() (*models.Head, error)

LastHead returns the head with the highest number. In the case of ties (e.g. due to re-org) it returns the most recently seen head entry.

func (*TMStore) MarkConfirmedMissingReceipt

func (store *TMStore) MarkConfirmedMissingReceipt() error

func (*TMStore) MarkOldTxsMissingReceiptAsErrored

func (store *TMStore) MarkOldTxsMissingReceiptAsErrored(cutoff int64) error

func (*TMStore) PutAccount

func (store *TMStore) PutAccount(account *models.Account) error

func (*TMStore) PutJob

func (store *TMStore) PutJob(job *models.Job) error

func (*TMStore) PutTx

func (store *TMStore) PutTx(tx *models.Tx) error

func (*TMStore) PutTxAttempt

func (store *TMStore) PutTxAttempt(attempt *models.TxAttempt) error

func (*TMStore) PutTxReceipt

func (store *TMStore) PutTxReceipt(receipt *models.TxReceipt) error

func (*TMStore) ReplaceAttempt

func (store *TMStore) ReplaceAttempt(tx *models.Tx, oldAttempt *models.TxAttempt, newAttempt *models.TxAttempt) error

ReplaceAttempt removes an existing attempt and adds a new attempt with a different ID. Sorts the new list of attempts by gas price.

func (*TMStore) SetBroadcastBeforeBlockNum

func (store *TMStore) SetBroadcastBeforeBlockNum(blockNum int64) error

func (*TMStore) SetNextNonce

func (store *TMStore) SetNextNonce(address common.Address, nextNonce int64) error

func (*TMStore) TrimOldHeads

func (store *TMStore) TrimOldHeads(depth int64) error

TrimOldHeads deletes "depth" number of heads such that only the top N block numbers remain.

Jump to

Keyboard shortcuts

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