Documentation ¶
Index ¶
- type ITxStore
- type LevelDbTxStore
- func (store *LevelDbTxStore) Clear() (err error)
- func (store *LevelDbTxStore) GetFirstTransaction() (tx *TimestampedTransaction, err error)
- func (store *LevelDbTxStore) ListTransactions() (txs []*TimestampedTransaction, err error)
- func (store *LevelDbTxStore) RemoveTransactionsLessThanNonce(nonce uint64) (err error)
- func (store *LevelDbTxStore) SaveTransaction(tx *types.Transaction) (err error)
- func (store *LevelDbTxStore) UpdateTransactionByNonce(tx *types.Transaction) (err error)
- type MemoryTxStore
- func (store *MemoryTxStore) Clear() (err error)
- func (store *MemoryTxStore) Close() (err error)
- func (store *MemoryTxStore) GetFirstTransaction() (tx *TimestampedTransaction, err error)
- func (store *MemoryTxStore) ListTransactions() (txs []*TimestampedTransaction, err error)
- func (store *MemoryTxStore) RemoveTransactionsLessThanNonce(nonce uint64) (err error)
- func (store *MemoryTxStore) SaveTransaction(tx *types.Transaction) (err error)
- func (store *MemoryTxStore) UpdateTransactionByNonce(tx *types.Transaction) (err error)
- type TimestampedTransaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ITxStore ¶
type ITxStore interface { ListTransactions() (txs []*TimestampedTransaction, err error) GetFirstTransaction() (tx *TimestampedTransaction, err error) SaveTransaction(tx *types.Transaction) (err error) UpdateTransactionByNonce(tx *types.Transaction) (err error) RemoveTransactionsLessThanNonce(nonce uint64) (err error) Clear() (err error) Close() (err error) }
type LevelDbTxStore ¶
func NewLevelDbTxStore ¶
func NewLevelDbTxStore(file string, clk clock.Clock) (store *LevelDbTxStore, err error)
func (*LevelDbTxStore) Clear ¶
func (store *LevelDbTxStore) Clear() (err error)
Clear removes all transactions stored
func (*LevelDbTxStore) GetFirstTransaction ¶
func (store *LevelDbTxStore) GetFirstTransaction() (tx *TimestampedTransaction, err error)
GetFirstTransaction returns transaction with lowest nonce
func (*LevelDbTxStore) ListTransactions ¶
func (store *LevelDbTxStore) ListTransactions() (txs []*TimestampedTransaction, err error)
ListTransactions returns all transactions on the store, useful for testing
func (*LevelDbTxStore) RemoveTransactionsLessThanNonce ¶
func (store *LevelDbTxStore) RemoveTransactionsLessThanNonce(nonce uint64) (err error)
RemoveTransactionsLessThanNonce removes all transactions with nonce values up to the specified value inclusive
func (*LevelDbTxStore) SaveTransaction ¶
func (store *LevelDbTxStore) SaveTransaction(tx *types.Transaction) (err error)
SaveTransaction dates and stores transaction sorted by ascending nonce
func (*LevelDbTxStore) UpdateTransactionByNonce ¶
func (store *LevelDbTxStore) UpdateTransactionByNonce(tx *types.Transaction) (err error)
UpdateTransactionByNonce updates a transaction given its nonce, returns error if tx with same nonce does not exist
type MemoryTxStore ¶
type MemoryTxStore struct {
// contains filtered or unexported fields
}
func NewMemoryTxStore ¶
func NewMemoryTxStore(clk clock.Clock) *MemoryTxStore
func (*MemoryTxStore) Clear ¶
func (store *MemoryTxStore) Clear() (err error)
Clear removes all transactions stored
func (*MemoryTxStore) Close ¶
func (store *MemoryTxStore) Close() (err error)
func (*MemoryTxStore) GetFirstTransaction ¶
func (store *MemoryTxStore) GetFirstTransaction() (tx *TimestampedTransaction, err error)
GetFirstTransaction returns transaction with lowest nonce
func (*MemoryTxStore) ListTransactions ¶
func (store *MemoryTxStore) ListTransactions() (txs []*TimestampedTransaction, err error)
ListTransactions returns all transactions on the store, useful for testing
func (*MemoryTxStore) RemoveTransactionsLessThanNonce ¶
func (store *MemoryTxStore) RemoveTransactionsLessThanNonce(nonce uint64) (err error)
RemoveTransactionsLessThanNonce removes all transactions with nonce values up to the specified value inclusive
func (*MemoryTxStore) SaveTransaction ¶
func (store *MemoryTxStore) SaveTransaction(tx *types.Transaction) (err error)
SaveTransaction dates and stores transaction sorted by ascending nonce
func (*MemoryTxStore) UpdateTransactionByNonce ¶
func (store *MemoryTxStore) UpdateTransactionByNonce(tx *types.Transaction) (err error)
UpdateTransactionByNonce updates a transaction given its nonce, returns error if tx with same nonce does not exist
type TimestampedTransaction ¶
type TimestampedTransaction struct { *types.Transaction Timestamp int64 }
func DecodeTimestampedTransaction ¶
func DecodeTimestampedTransaction(bytes []byte) (*TimestampedTransaction, error)
func (*TimestampedTransaction) Encode ¶
func (tx *TimestampedTransaction) Encode() ([]byte, error)