tester

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// InactiveFailureLookbackWindow is the size of each window to check
	// for missing ops. If a block with missing ops is not found in this
	// window, another window is created with the preceding
	// InactiveFailureLookbackWindow blocks (this process continues
	// until the client halts the search or the block is found).
	InactiveFailureLookbackWindow = 250

	// PeriodicLoggingFrequency is the frequency that stats are printed
	// to the terminal.
	//
	// TODO: make configurable
	PeriodicLoggingFrequency = 10 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConstructionTester

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

ConstructionTester coordinates the `check:construction` test.

func InitializeConstruction

func InitializeConstruction(
	ctx context.Context,
	config *configuration.Configuration,
	network *types.NetworkIdentifier,
	onlineFetcher *fetcher.Fetcher,
	cancel context.CancelFunc,
) (*ConstructionTester, error)

InitializeConstruction initiates the construction API tester.

func (*ConstructionTester) CloseDatabase

func (t *ConstructionTester) CloseDatabase(ctx context.Context)

CloseDatabase closes the database used by ConstructionTester.

func (*ConstructionTester) PerformBroadcasts

func (t *ConstructionTester) PerformBroadcasts(ctx context.Context) error

PerformBroadcasts attempts to rebroadcast all pending transactions if the RebroadcastAll configuration is set to true.

func (*ConstructionTester) StartConstructor

func (t *ConstructionTester) StartConstructor(
	ctx context.Context,
) error

StartConstructor uses the tester's constructor to begin generating addresses and constructing transactions.

func (*ConstructionTester) StartPeriodicLogger

func (t *ConstructionTester) StartPeriodicLogger(
	ctx context.Context,
) error

StartPeriodicLogger prints out periodic stats about a run of `check:construction`.

func (*ConstructionTester) StartSyncer

func (t *ConstructionTester) StartSyncer(
	ctx context.Context,
	cancel context.CancelFunc,
) error

StartSyncer uses the tester's stateful syncer to compute balance changes and track transactions for confirmation on-chain.

type DataTester

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

DataTester coordinates the `check:data` test.

func InitializeData

func InitializeData(
	ctx context.Context,
	config *configuration.Configuration,
	network *types.NetworkIdentifier,
	fetcher *fetcher.Fetcher,
	cancel context.CancelFunc,
	genesisBlock *types.BlockIdentifier,
	interestingAccount *reconciler.AccountCurrency,
	signalReceived *bool,
) *DataTester

InitializeData returns a new *DataTester.

func (*DataTester) CloseDatabase

func (t *DataTester) CloseDatabase(ctx context.Context)

CloseDatabase closes the database used by DataTester.

func (*DataTester) FindMissingOps

func (t *DataTester) FindMissingOps(ctx context.Context, sigListeners []context.CancelFunc)

FindMissingOps logs the types.BlockIdentifier of a block that is missing balance-changing operations for a *reconciler.AccountCurrency.

func (*DataTester) HandleErr

func (t *DataTester) HandleErr(ctx context.Context, err error, sigListeners []context.CancelFunc)

HandleErr is called when `check:data` returns an error. If historical balance lookups are enabled, HandleErr will attempt to automatically find any missing balance-changing operations.

func (*DataTester) StartPeriodicLogger

func (t *DataTester) StartPeriodicLogger(
	ctx context.Context,
) error

StartPeriodicLogger prints out periodic stats about a run of `check:data`.

func (*DataTester) StartReconciler

func (t *DataTester) StartReconciler(
	ctx context.Context,
) error

StartReconciler starts the reconciler if reconciliation is enabled.

func (*DataTester) StartSyncing

func (t *DataTester) StartSyncing(
	ctx context.Context,
	startIndex int64,
	endIndex int64,
) error

StartSyncing syncs from startIndex to endIndex. If startIndex is -1, it will start from the last saved block. If endIndex is -1, it will sync continuously (or until an error).

func (*DataTester) WatchEndConditions

func (t *DataTester) WatchEndConditions(
	ctx context.Context,
	config *configuration.Configuration,
) error

WatchEndConditions starts go routines to watch the end conditions

Jump to

Keyboard shortcuts

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