testsuite

package
v0.5.3-rc3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestEnvironment

type TestEnvironment struct {

	// Milestones are the created milestones by the coordinator during the test.
	Milestones tangle.CachedBundles
	// contains filtered or unexported fields
}

TestEnvironment holds the state of the test environment.

func SetupTestEnvironment

func SetupTestEnvironment(testState *testing.T, initialBalances map[string]uint64, numberOfMilestones int, showConfirmationGraphs bool) *TestEnvironment

SetupTestEnvironment initializes a clean database with initial balances, configures a coordinator with a clean state, bootstraps the network and issues the first "numberOfMilestones" milestones.

func (*TestEnvironment) AssertAddressBalance

func (te *TestEnvironment) AssertAddressBalance(seed trinary.Trytes, index uint64, balance uint64)

AssertAddressBalance generates an address for the given seed and index and checks correct balance.

func (*TestEnvironment) AssertTotalSupplyStillValid

func (te *TestEnvironment) AssertTotalSupplyStillValid()

AssertTotalSupplyStillValid checks if the total supply in the database is still correct.

func (*TestEnvironment) AttachAndStoreBundle

func (te *TestEnvironment) AttachAndStoreBundle(trunk hornet.Hash, branch hornet.Hash, trytes []trinary.Trytes) *tangle.CachedBundle

AttachAndStoreBundle attaches the given bundle to the given trunk and branch and does the "Proof of Work" and stores it.

func (*TestEnvironment) CleanupTestEnvironment

func (te *TestEnvironment) CleanupTestEnvironment(removeTempDir bool)

CleanupTestEnvironment cleans up everything at the end of the test.

func (*TestEnvironment) IssueAndConfirmMilestoneOnTip

func (te *TestEnvironment) IssueAndConfirmMilestoneOnTip(tip hornet.Hash, createConfirmationGraph bool) *whiteflag.ConfirmedMilestoneStats

IssueAndConfirmMilestoneOnTip creates a milestone on top of a given tip.

func (*TestEnvironment) StoreBundle

func (te *TestEnvironment) StoreBundle(bndl bundle.Bundle, isMilestone bool) *tangle.CachedBundle

StoreBundle adds all transactions of the bundle to the storage layer and solidifies them.

func (*TestEnvironment) VerifyLMI

func (te *TestEnvironment) VerifyLMI(index milestone.Index)

VerifyLMI checks if the latest milestone index is equal to the given milestone index.

func (*TestEnvironment) VerifyLSMI

func (te *TestEnvironment) VerifyLSMI(index milestone.Index)

VerifyLSMI checks if the latest solid milestone index is equal to the given milestone index.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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