txpool

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxSize int `toml:"max_size"`
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) BasicCheck added in v0.15.0

func (conf *Config) BasicCheck() error

BasicCheck performs basic checks on the configuration.

type MockTxPool

type MockTxPool struct {
	Txs []*tx.Tx
}

MockTxPool is a testing mock.

func MockingTxPool

func MockingTxPool() *MockTxPool

func (*MockTxPool) AppendTx

func (m *MockTxPool) AppendTx(trx *tx.Tx) error

func (*MockTxPool) AppendTxAndBroadcast

func (m *MockTxPool) AppendTxAndBroadcast(trx *tx.Tx) error

func (*MockTxPool) HasTx

func (m *MockTxPool) HasTx(id tx.ID) bool

func (*MockTxPool) PendingTx

func (m *MockTxPool) PendingTx(id tx.ID) *tx.Tx

func (*MockTxPool) PrepareBlockTransactions

func (m *MockTxPool) PrepareBlockTransactions() block.Txs

func (*MockTxPool) QueryTx

func (m *MockTxPool) QueryTx(id tx.ID) *tx.Tx

func (*MockTxPool) RemoveTx

func (m *MockTxPool) RemoveTx(_ hash.Hash)

func (*MockTxPool) SetNewSandboxAndRecheck

func (m *MockTxPool) SetNewSandboxAndRecheck(_ sandbox.Sandbox)

func (*MockTxPool) Size

func (m *MockTxPool) Size() int

func (*MockTxPool) String added in v0.15.0

func (m *MockTxPool) String() string

type Reader

type Reader interface {
	PrepareBlockTransactions() block.Txs
	PendingTx(id tx.ID) *tx.Tx
	HasTx(id tx.ID) bool
	Size() int
}

type TxPool

type TxPool interface {
	Reader

	SetNewSandboxAndRecheck(sb sandbox.Sandbox)
	AppendTxAndBroadcast(trx *tx.Tx) error
	AppendTx(tx *tx.Tx) error
	RemoveTx(id tx.ID)
}

func NewTxPool

func NewTxPool(conf *Config, broadcastCh chan message.Message) TxPool

Jump to

Keyboard shortcuts

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