Documentation ¶
Index ¶
- Constants
- type Blockchain
- type PriceCorpus
- type PriceFeeder
- type Reserve
- type Runner
- type StatusMonitor
- func (self *StatusMonitor) ConcurrentlyGetStatus(bc Blockchain) map[string]string
- func (self *StatusMonitor) GetOneStatus(tx *types.Transaction, bc Blockchain, data *sync.Map, wg *sync.WaitGroup)
- func (self *StatusMonitor) GetStatus(bc Blockchain) (st string, tx *types.Transaction, err error)
- func (self *StatusMonitor) GetTxByHash(hash string) *types.Transaction
- func (self *StatusMonitor) PushTx(tx *types.Transaction) error
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blockchain ¶
type PriceCorpus ¶
type PriceFeeder ¶
type PriceFeeder struct {
// contains filtered or unexported fields
}
func NewPriceFeeder ¶
func NewPriceFeeder(runner Runner, reserve Reserve, prices PriceCorpus) *PriceFeeder
func (*PriceFeeder) EnsureFeedPrice ¶
func (self *PriceFeeder) EnsureFeedPrice()
func (*PriceFeeder) MonitorAndRetry ¶
func (self *PriceFeeder) MonitorAndRetry(tx *types.Transaction) error
func (*PriceFeeder) Run ¶
func (self *PriceFeeder) Run()
func (*PriceFeeder) Stop ¶
func (self *PriceFeeder) Stop()
func (*PriceFeeder) TryFeedingPrice ¶
func (self *PriceFeeder) TryFeedingPrice() (*types.Transaction, error)
type Reserve ¶
type Reserve interface { SetPriceFeed(gasPrice *big.Int, blockNumber *big.Int, nonce *big.Int, ask1KDigix *big.Int, bid1KDigix *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) TxStatus(common.Hash) (status string, blockno uint64, err error) Rebroadcast(tx *types.Transaction) (*types.Transaction, error) }
type StatusMonitor ¶
type StatusMonitor struct {
// contains filtered or unexported fields
}
StatusMonitor is not thread safe
func NewStatusMonitor ¶
func NewStatusMonitor(initTx *types.Transaction) *StatusMonitor
func (*StatusMonitor) ConcurrentlyGetStatus ¶
func (self *StatusMonitor) ConcurrentlyGetStatus(bc Blockchain) map[string]string
func (*StatusMonitor) GetOneStatus ¶
func (self *StatusMonitor) GetOneStatus(tx *types.Transaction, bc Blockchain, data *sync.Map, wg *sync.WaitGroup)
func (*StatusMonitor) GetStatus ¶
func (self *StatusMonitor) GetStatus(bc Blockchain) (st string, tx *types.Transaction, err error)
GetStatus query statuses of all txs, it returns: 1. mined: if one of the txs is mined 2. failed: if one of the txs is failed 3. lost: if not in the case of 1 nor 2 and the last tx is not found 4. pending: if not in the case of 1 nor 2 nor 3 and the last tx is pending
func (*StatusMonitor) GetTxByHash ¶
func (self *StatusMonitor) GetTxByHash(hash string) *types.Transaction
func (*StatusMonitor) PushTx ¶
func (self *StatusMonitor) PushTx(tx *types.Transaction) error
Click to show internal directories.
Click to hide internal directories.