Documentation ¶
Index ¶
- func Add(db sql.Executor, tx *types.Transaction, received time.Time) error
- func AddResult(db *sql.Tx, id types.TransactionID, rst *types.TransactionResult) error
- func AddToBlock(db sql.Executor, tid types.TransactionID, lid types.LayerID, bid types.BlockID) error
- func AddToProposal(db sql.Executor, tid types.TransactionID, lid types.LayerID, ...) error
- func AddressesWithPendingTransactions(db sql.Executor) ([]types.AddressNonce, error)
- func Get(db sql.Executor, id types.TransactionID) (tx *types.MeshTransaction, err error)
- func GetAcctPendingFromNonce(db sql.Executor, address types.Address, from uint64) ([]*types.MeshTransaction, error)
- func GetAppliedLayer(db sql.Executor, tid types.TransactionID) (types.LayerID, error)
- func GetBlob(db sql.Executor, id []byte) (buf []byte, err error)
- func GetByAddress(db sql.Executor, from, to types.LayerID, address types.Address) ([]*types.MeshTransaction, error)
- func Has(db sql.Executor, id types.TransactionID) (bool, error)
- func HasBlockTX(db sql.Executor, bid types.BlockID, tid types.TransactionID) (bool, error)
- func HasProposalTX(db sql.Executor, pid types.ProposalID, tid types.TransactionID) (bool, error)
- func IterateResults(db sql.Executor, filter ResultsFilter, ...) error
- func TransactionInBlock(db sql.Executor, id types.TransactionID, after types.LayerID) (types.BlockID, types.LayerID, error)
- func TransactionInProposal(db sql.Executor, id types.TransactionID, after types.LayerID) (types.LayerID, error)
- func UndoLayers(db *sql.Tx, from types.LayerID) error
- type ResultsFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddResult ¶
func AddResult(db *sql.Tx, id types.TransactionID, rst *types.TransactionResult) error
AddResult adds result for the transaction.
func AddToBlock ¶
func AddToBlock(db sql.Executor, tid types.TransactionID, lid types.LayerID, bid types.BlockID) error
AddToBlock associates a transaction with a block.
func AddToProposal ¶
func AddToProposal(db sql.Executor, tid types.TransactionID, lid types.LayerID, pid types.ProposalID) error
AddToProposal associates a transaction with a proposal.
func AddressesWithPendingTransactions ¶
func AddressesWithPendingTransactions(db sql.Executor) ([]types.AddressNonce, error)
AddressesWithPendingTransactions returns list of addresses with pending transactions. Query is expensive, meant to be used only on startup.
func Get ¶
func Get(db sql.Executor, id types.TransactionID) (tx *types.MeshTransaction, err error)
Get gets a transaction from database. Layer and Block fields are set if transaction was applied. If transaction is included, but not applied check references in proposals and blocks.
func GetAcctPendingFromNonce ¶
func GetAcctPendingFromNonce(db sql.Executor, address types.Address, from uint64) ([]*types.MeshTransaction, error)
GetAcctPendingFromNonce get all pending transactions with nonce after `from` for the given address.
func GetAppliedLayer ¶
GetAppliedLayer returns layer when transaction was applied.
func GetByAddress ¶
func GetByAddress(db sql.Executor, from, to types.LayerID, address types.Address) ([]*types.MeshTransaction, error)
GetByAddress finds all transactions for an address.
func HasBlockTX ¶
HasBlockTX returns true if the given transaction is included in the given block.
func HasProposalTX ¶
func HasProposalTX(db sql.Executor, pid types.ProposalID, tid types.TransactionID) (bool, error)
HasProposalTX returns true if the given transaction is included in the given proposal.
func IterateResults ¶
func IterateResults(db sql.Executor, filter ResultsFilter, fn func(*types.TransactionWithResult) bool) error
IterateResults allows to control iteration by the output of `fn`.
func TransactionInBlock ¶
func TransactionInBlock(db sql.Executor, id types.TransactionID, after types.LayerID) (types.BlockID, types.LayerID, error)
TransactionInBlock returns lowest layer and id of the block where tx is included after the specified layer.
Types ¶
type ResultsFilter ¶
type ResultsFilter struct { Address *types.Address Start, End *types.LayerID TID *types.TransactionID }
ResultsFilter applies filter on transaction results query.