Documentation ¶
Index ¶
- func Add(db sql.Executor, tx *types.Transaction, received time.Time) 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 Apply(db sql.Executor, tid types.TransactionID, lid types.LayerID, bid types.BlockID) (int, error)
- func DiscardByAcctNonce(db sql.Executor, applied types.TransactionID, lid types.LayerID, ...) error
- func DiscardNonceBelow(db sql.Executor, address types.Address, nonce uint64) 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 GetAllPending(db sql.Executor) ([]*types.MeshTransaction, error)
- func GetAppliedLayer(db sql.Executor, tid types.TransactionID) (types.LayerID, error)
- func GetBlob(db sql.Executor, id types.TransactionID) (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 SetNextLayer(db sql.Executor, id types.TransactionID, lid types.LayerID) (types.LayerID, types.BlockID, error)
- func UndoLayers(db sql.Executor, from types.LayerID) ([]types.TransactionID, error)
- func UpdateIfBetter(db sql.Executor, tid types.TransactionID, lid types.LayerID, bid types.BlockID) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 Apply ¶
func Apply(db sql.Executor, tid types.TransactionID, lid types.LayerID, bid types.BlockID) (int, error)
Apply updates the applied field to `applied` for a transaction, along with the layer and block it is applied with.
func DiscardByAcctNonce ¶
func DiscardByAcctNonce(db sql.Executor, applied types.TransactionID, lid types.LayerID, addr types.Address, nonce uint64) error
DiscardByAcctNonce sets the applied field to `stateDiscarded` and layer to `lid` for transactions with addr and nonce.
func DiscardNonceBelow ¶
DiscardNonceBelow sets the applied field to `stateDiscarded` for transactions with nonce lower than specified.
func Get ¶
func Get(db sql.Executor, id types.TransactionID) (tx *types.MeshTransaction, err error)
Get gets a transaction from database.
func GetAcctPendingFromNonce ¶
func GetAcctPendingFromNonce(db sql.Executor, address types.Address, from uint64) ([]*types.MeshTransaction, error)
GetAcctPendingFromNonce get all pending transactions with nonce <= `from` for the given address.
func GetAllPending ¶
func GetAllPending(db sql.Executor) ([]*types.MeshTransaction, error)
GetAllPending get all transactions that are not yet applied.
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 SetNextLayer ¶
func SetNextLayer(db sql.Executor, id types.TransactionID, lid types.LayerID) (types.LayerID, types.BlockID, error)
SetNextLayer gets the layer a transaction appears in after the given layer.
func UndoLayers ¶
UndoLayers unset all transactions to `statePending` from `from` layer to the max layer with applied transactions.
Types ¶
This section is empty.