Versions in this module Expand all Collapse all v0 v0.2.2 May 2, 2020 Changes in this version type StateDB + GetTradableBalance func(addr common.Address, currentRound uint64) *big.Int v0.2.1 Nov 19, 2019 Changes in this version + var ErrInsufficientFunds = errors.New("insufficient funds for gas limit * price + value") + var ErrIsNotAPacker = errors.New("this transaction should be sent to a packer") + var ErrNonceTooLow = errors.New("nonce too low") + var ErrReplaceUnderpriced = errors.New("replacement element underpriced") + type BlockChain interface + CurrentBlock func() *types.Block + GetBlock func(hash common.Hash) *types.Block + GetChainID func() uint64 + GetGreedy func() uint8 + GetStateBeforeCacheHeight func(block *types.Block, cacheHeight uint8) (*state.StateDB, *types.Block, bool) + MinAvailablePackageHeight func() (uint64, error) + StateAt func(root common.Hash) (*state.StateDB, error) + SubscribeChainUpdateEvent func(ch chan<- types.ChainUpdateEvent) event.Subscription + type EleByNonce []Element + func (s EleByNonce) Len() int + func (s EleByNonce) Less(i, j int) bool + func (s EleByNonce) Swap(i, j int) + type EleByPrice []ElementWithFrom + func (s *EleByPrice) Pop() interface{} + func (s *EleByPrice) Push(x interface{}) + func (s EleByPrice) Len() int + func (s EleByPrice) Less(i, j int) bool + func (s EleByPrice) Swap(i, j int) + type EleList struct + func (l *EleList) Add(ele Element, priceBump uint64) (bool, Element) + func (l *EleList) Cap(threshold int) []Element + func (l *EleList) Empty() bool + func (l *EleList) Filter(filter func(Element) bool) []Element + func (l *EleList) Flatten() []Element + func (l *EleList) Forward(threshold uint64) []Element + func (l *EleList) Len() int + func (l *EleList) Overlaps(ele Element) bool + func (l *EleList) Remove(ele Element) (bool, []Element) + type Element interface + GasPrice func() *big.Int + Hash func() common.Hash + Nonce func() uint64 + type ElementWithFrom struct + From common.Address + type ElementsByPriceAndNonce struct + func NewElementsByPriceAndNonce(eles map[common.Address][]Element) *ElementsByPriceAndNonce + func (t *ElementsByPriceAndNonce) Peek() ElementWithFrom + func (t *ElementsByPriceAndNonce) Shift() + type Helper interface + Reset func(pool Pool, block *types.Block) + Sender func(ele Element) (common.Address, error) + Validate func(pool Pool, ele Element, currentState StateDB, chain BlockChain) error + type NewElemEvent struct + Ems []Element + type Pool interface + AddLocal func(ele Element) error + AddLocals func(eles []Element) []error + AddRemote func(ele Element) error + AddRemotes func(eles []Element) []error + AddUnsafe func(eles []Element, local bool) []error + Content func() map[common.Address][]Element + ContentForPack func() map[common.Address][]Element + Get func(hash common.Hash) Element + GetNonce func(from common.Address, ...) uint64 + GetStateBeforeCacheHeight func() (*state.StateDB, *types.Block, bool) + Locals func() []common.Address + StateUnsafe func() *state.ManagedState + Stats func() int + Stop func() + SubscribeNewElemEvent func(ch chan<- NewElemEvent) event.Subscription + func NewFakePool(startCleanTime int64, cleanPeriod int64, leftEleNumEachAddr int, helper Helper) Pool + func NewPool(conf config.PoolConfig, chain BlockChain, elemType reflect.Type, helper Helper) Pool + type StateDB interface + GetBalance func(addr common.Address) *big.Int