spamoor

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRootWallet

func InitRootWallet(ctx context.Context, privkey string, client *txbuilder.Client, logger logrus.FieldLogger) (*txbuilder.Wallet, error)

Types

type ClientPool

type ClientPool struct {
	// contains filtered or unexported fields
}

func NewClientPool

func NewClientPool(ctx context.Context, rpcHosts []string, logger logrus.FieldLogger) *ClientPool

func (*ClientPool) GetAllClients

func (pool *ClientPool) GetAllClients() []*txbuilder.Client

func (*ClientPool) GetAllGoodClients

func (pool *ClientPool) GetAllGoodClients() []*txbuilder.Client

func (*ClientPool) GetClient

func (pool *ClientPool) GetClient(mode ClientSelectionMode, input int, group string) *txbuilder.Client

func (*ClientPool) PrepareClients

func (pool *ClientPool) PrepareClients() error

type ClientSelectionMode

type ClientSelectionMode uint8
var (
	SelectClientByIndex    ClientSelectionMode = 0
	SelectClientRandom     ClientSelectionMode = 1
	SelectClientRoundRobin ClientSelectionMode = 2
)

type WalletPool

type WalletPool struct {
	// contains filtered or unexported fields
}

func NewWalletPool

func NewWalletPool(ctx context.Context, logger logrus.FieldLogger, rootWallet *txbuilder.Wallet, clientPool *ClientPool, txpool *txbuilder.TxPool) *WalletPool

func (*WalletPool) AddWellKnownWallet added in v1.1.1

func (pool *WalletPool) AddWellKnownWallet(config *WellKnownWalletConfig)

func (*WalletPool) CheckChildWalletBalance

func (pool *WalletPool) CheckChildWalletBalance(childWallet *txbuilder.Wallet) (*types.Transaction, error)

func (*WalletPool) GetAllWallets

func (pool *WalletPool) GetAllWallets() []*txbuilder.Wallet

func (*WalletPool) GetClient

func (pool *WalletPool) GetClient(mode ClientSelectionMode, input int, group string) *txbuilder.Client

func (*WalletPool) GetClientPool

func (pool *WalletPool) GetClientPool() *ClientPool

func (*WalletPool) GetContext

func (pool *WalletPool) GetContext() context.Context

func (*WalletPool) GetRootWallet

func (pool *WalletPool) GetRootWallet() *txbuilder.Wallet

func (*WalletPool) GetTxPool

func (pool *WalletPool) GetTxPool() *txbuilder.TxPool

func (*WalletPool) GetWallet

func (pool *WalletPool) GetWallet(mode WalletSelectionMode, input int) *txbuilder.Wallet

func (*WalletPool) GetWalletCount

func (pool *WalletPool) GetWalletCount() uint64

func (*WalletPool) GetWalletName added in v1.1.1

func (pool *WalletPool) GetWalletName(address common.Address) string

func (*WalletPool) GetWellKnownWallet added in v1.1.1

func (pool *WalletPool) GetWellKnownWallet(name string) *txbuilder.Wallet

func (*WalletPool) LoadConfig

func (pool *WalletPool) LoadConfig(configYaml string) error

func (*WalletPool) MarshalConfig

func (pool *WalletPool) MarshalConfig() (string, error)

func (*WalletPool) PrepareWallets

func (pool *WalletPool) PrepareWallets(runFundings bool) error

func (*WalletPool) SendTxRange added in v1.1.1

func (pool *WalletPool) SendTxRange(txList []*types.Transaction, client *txbuilder.Client, wallet *txbuilder.Wallet, confirmCb func(tx *types.Transaction, receipt *types.Receipt, err error)) error

func (*WalletPool) SetRefillAmount

func (pool *WalletPool) SetRefillAmount(amount *uint256.Int)

func (*WalletPool) SetRefillBalance

func (pool *WalletPool) SetRefillBalance(balance *uint256.Int)

func (*WalletPool) SetRefillInterval

func (pool *WalletPool) SetRefillInterval(interval uint64)

func (*WalletPool) SetWalletCount

func (pool *WalletPool) SetWalletCount(count uint64)

func (*WalletPool) SetWalletSeed

func (pool *WalletPool) SetWalletSeed(seed string)

type WalletPoolConfig

type WalletPoolConfig struct {
	WalletCount    uint64       `yaml:"wallet_count,omitempty"`
	RefillAmount   *uint256.Int `yaml:"refill_amount"`
	RefillBalance  *uint256.Int `yaml:"refill_balance"`
	RefillInterval uint64       `yaml:"refill_interval"`
	WalletSeed     string       `yaml:"seed"`
}

func GetDefaultWalletConfig added in v1.1.1

func GetDefaultWalletConfig(scenarioName string) *WalletPoolConfig

type WalletSelectionMode

type WalletSelectionMode uint8
var (
	SelectWalletByIndex    WalletSelectionMode = 0
	SelectWalletRandom     WalletSelectionMode = 1
	SelectWalletRoundRobin WalletSelectionMode = 2
)

type WellKnownWalletConfig added in v1.1.1

type WellKnownWalletConfig struct {
	Name          string
	RefillAmount  *uint256.Int
	RefillBalance *uint256.Int
}

Jump to

Keyboard shortcuts

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