Documentation
¶
Index ¶
- func Compress(txList []byte) ([]byte, error)
- func Decompress(compressedTxList []byte) ([]byte, error)
- func EncodeAndCompressTxList(txs types.Transactions) ([]byte, error)
- func EtherToWei(ether float64) (*big.Int, error)
- func GWeiToWei(gwei float64) (*big.Int, error)
- func IsNil(i interface{}) bool
- func LoadEnv()
- func Min[T constraints.Integer](a, b T) T
- func RandUint32(max *big.Int) uint32
- func RandUint64(max *big.Int) uint64
- func WeiToEther(wei *big.Int) *big.Float
- func WeiToGWei(wei *big.Int) *big.Float
- type TxMgrSelector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decompress ¶
Decompress decompresses the given txList bytes using zlib.
func EncodeAndCompressTxList ¶
func EncodeAndCompressTxList(txs types.Transactions) ([]byte, error)
EncodeAndCompressTxList encodes and compresses the given transactions list using RLP encoding followed by zlib compression.
func EtherToWei ¶
EtherToWei converts ether value to wei value.
func WeiToEther ¶
WeiToEther converts wei value to ether value.
Types ¶
type TxMgrSelector ¶
type TxMgrSelector struct {
// contains filtered or unexported fields
}
TxMgrSelector is responsible for selecting the correct transaction manager, it will choose the transaction manager for a private mempool if it is available and works well, otherwise it will choose the normal transaction manager.
func NewTxMgrSelector ¶
func NewTxMgrSelector( txMgr txmgr.TxManager, privateTxMgr txmgr.TxManager, privateTxMgrRetryInterval *time.Duration, ) *TxMgrSelector
NewTxMgrSelector creates a new TxMgrSelector instance.
func (*TxMgrSelector) PrivateTxMgr ¶
func (s *TxMgrSelector) PrivateTxMgr() txmgr.TxManager
PrivateTxMgr returns the private transaction manager.
func (*TxMgrSelector) RecordPrivateTxMgrFailed ¶
func (s *TxMgrSelector) RecordPrivateTxMgrFailed()
RecordPrivateTxMgrFailed records the time when the private transaction manager has failed.
func (*TxMgrSelector) Select ¶
func (s *TxMgrSelector) Select() (txmgr.TxManager, bool)
Select selects a transaction manager based on the current state.
func (*TxMgrSelector) TxMgr ¶
func (s *TxMgrSelector) TxMgr() txmgr.TxManager
TxMgrmethod returns the inner transaction manager.