workflows

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: GPL-3.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAvailableBalanceValue = errors.New("invalid available balance value")

ErrInvalidAvailableBalanceValue signals that an invalid available balance value was provided

View Source
var ErrInvalidTransactionValue = errors.New("invalid transaction value")

ErrInvalidTransactionValue signals that an invalid transaction value was provided

View Source
var ErrNilLastProcessedNonceHandler = errors.New("nil last processed nonce handler")

ErrNilLastProcessedNonceHandler signals that a nil last processed nonce handler was provided

View Source
var ErrNilMinimumBalance = errors.New("nil minimum balance")

ErrNilMinimumBalance signals that a nil minimum balance was provided

View Source
var ErrNilProxy = errors.New("nil proxy")

ErrNilProxy signals that a nil proxy has been provided

View Source
var ErrNilTrackableAddressesProvider = errors.New("nil trackable address provider")

ErrNilTrackableAddressesProvider signals that a nil trackable address provider was used

View Source
var ErrNilTransactionInteractor = errors.New("nil transaction interactor")

ErrNilTransactionInteractor signals that a nil transaction interactor was provided

Functions

func NewMoveBalanceHandler

func NewMoveBalanceHandler(args MoveBalanceHandlerArgs) (*moveBalanceHandler, error)

NewMoveBalanceHandler creates a new instance of the moveBalanceHandler struct

func NewWalletTracker

func NewWalletTracker(args WalletTrackerArgs) (*walletTracker, error)

NewWalletTracker will create a new walletTracker instance. It automatically starts an inner processLoop go routine that can be stopped by calling the Close method

Types

type LastProcessedNonceHandler

type LastProcessedNonceHandler interface {
	ProcessedNonce(nonce uint64)
	GetLastProcessedNonce() uint64
	IsInterfaceNil() bool
}

LastProcessedNonceHandler will keep track of the last processed hyper block nonce. fraction of hyper blocks sets after an application restart

type MoveBalanceHandlerArgs

type MoveBalanceHandlerArgs struct {
	Proxy                      ProxyHandler
	TxInteractor               TransactionInteractor
	ReceiverAddress            string
	TrackableAddressesProvider TrackableAddressesProvider
	MinimumBalance             *big.Int
}

MoveBalanceHandlerArgs is the argument DTO for the NewMoveBalanceHandler constructor function

type ProxyHandler

type ProxyHandler interface {
	GetLatestHyperBlockNonce(ctx context.Context) (uint64, error)
	GetHyperBlockByNonce(ctx context.Context, nonce uint64) (*data.HyperBlock, error)
	GetDefaultTransactionArguments(ctx context.Context, address erdgoCore.AddressHandler, networkConfigs *data.NetworkConfig) (data.ArgCreateTransaction, error)
	GetNetworkConfig(ctx context.Context) (*data.NetworkConfig, error)
	IsInterfaceNil() bool
}

ProxyHandler defines the behavior of a proxy handler that can process requests

type TrackableAddressesProvider

type TrackableAddressesProvider interface {
	IsTrackableAddresses(addressAsBech32 string) bool
	PrivateKeyOfBech32Address(addressAsBech32 string) []byte
	IsInterfaceNil() bool
}

TrackableAddressesProvider defines the behavior for a component that can determine if one address is tracked or not

type TransactionInteractor

type TransactionInteractor interface {
	AddTransaction(tx *data.Transaction)
	ApplySignatureAndGenerateTx(cryptoHolder erdgoCore.CryptoComponentsHolder, arg data.ArgCreateTransaction) (*data.Transaction, error)
	IsInterfaceNil() bool
}

TransactionInteractor defines the transaction interactor behavior used in workflows

type WalletTrackerArgs

type WalletTrackerArgs struct {
	TrackableAddressesProvider TrackableAddressesProvider
	Proxy                      ProxyHandler
	NonceHandler               LastProcessedNonceHandler
	CheckInterval              time.Duration
	MinimumBalance             *big.Int
}

WalletTrackerArgs is the argument DTO for the NewWalletTracker constructor function

Jump to

Keyboard shortcuts

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