testsuite

package
v1.0.0-alpha.13 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 39 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultWallet = "defaultWallet"
)

Variables

View Source
var (
	DefaultSlotDurationInSeconds uint8 = defaultProtocolParams.SlotDurationInSeconds()
	DefaultSlotsPerEpochExponent uint8 = defaultProtocolParams.SlotsPerEpochExponent()

	DefaultLivenessThresholdLowerBoundInSeconds uint16           = uint16(defaultProtocolParams.LivenessThresholdLowerBound().Seconds())
	DefaultLivenessThresholdUpperBoundInSeconds uint16           = uint16(defaultProtocolParams.LivenessThresholdUpperBound().Seconds())
	DefaultMinCommittableAge                    iotago.SlotIndex = defaultProtocolParams.MinCommittableAge()
	DefaultMaxCommittableAge                    iotago.SlotIndex = defaultProtocolParams.MaxCommittableAge()
	DefaultEpochNearingThreshold                iotago.SlotIndex = defaultProtocolParams.EpochNearingThreshold()

	DefaultMinReferenceManaCost iotago.Mana      = defaultProtocolParams.CongestionControlParameters().MinReferenceManaCost
	DefaultRMCIncrease          iotago.Mana      = defaultProtocolParams.CongestionControlParameters().Increase
	DefaultRMCDecrease          iotago.Mana      = defaultProtocolParams.CongestionControlParameters().Decrease
	DefaultRMCIncreaseThreshold iotago.WorkScore = defaultProtocolParams.CongestionControlParameters().IncreaseThreshold
	DefaultRMCDecreaseThreshold iotago.WorkScore = defaultProtocolParams.CongestionControlParameters().DecreaseThreshold
	DefaultSchedulerRate        iotago.WorkScore = defaultProtocolParams.CongestionControlParameters().SchedulerRate
	DefaultMaxBufferSize        uint32           = defaultProtocolParams.CongestionControlParameters().MaxBufferSize
	DefaultMaxValBufferSize     uint32           = defaultProtocolParams.CongestionControlParameters().MaxValidationBufferSize
)

Functions

func GenesisTimeWithOffsetBySlots

func GenesisTimeWithOffsetBySlots(slots iotago.SlotIndex, slotDurationInSeconds uint8) int64

func WithAccounts

func WithAccounts(accounts ...snapshotcreator.AccountDetails) options.Option[TestSuite]

func WithActiveRootBlocks

func WithActiveRootBlocks(blocks []*blocks.Block) options.Option[NodeState]

func WithChainManagerIsSolid

func WithChainManagerIsSolid() options.Option[NodeState]

func WithEqualStoredCommitmentAtIndex

func WithEqualStoredCommitmentAtIndex(slot iotago.SlotIndex) options.Option[NodeState]

func WithEvictedSlot

func WithEvictedSlot(slot iotago.SlotIndex) options.Option[NodeState]

func WithLatestCommitment

func WithLatestCommitment(commitment *iotago.Commitment) options.Option[NodeState]

func WithLatestCommitmentCumulativeWeight

func WithLatestCommitmentCumulativeWeight(cumulativeWeight uint64) options.Option[NodeState]

func WithLatestCommitmentSlotIndex

func WithLatestCommitmentSlotIndex(slot iotago.SlotIndex) options.Option[NodeState]

func WithLatestFinalizedSlot

func WithLatestFinalizedSlot(slot iotago.SlotIndex) options.Option[NodeState]

func WithLogger

func WithLogger(logger log.Logger) options.Option[TestSuite]

func WithMainChainID

func WithMainChainID(chainID iotago.CommitmentID) options.Option[NodeState]

func WithProtocolParameters

func WithProtocolParameters(protocolParameters iotago.ProtocolParameters) options.Option[NodeState]

func WithProtocolParametersOptions

func WithProtocolParametersOptions(protocolParameterOptions ...options.Option[iotago.V3ProtocolParameters]) options.Option[TestSuite]

func WithSnapshotImported

func WithSnapshotImported(snapshotImported bool) options.Option[NodeState]

func WithSnapshotOptions

func WithSnapshotOptions(snapshotOptions ...options.Option[snapshotcreator.Options]) options.Option[TestSuite]

func WithStorageCommitments

func WithStorageCommitments(commitments []*iotago.Commitment) options.Option[NodeState]

func WithStorageRootBlocks

func WithStorageRootBlocks(blocks []*blocks.Block) options.Option[NodeState]

func WithSybilProtectionCandidates

func WithSybilProtectionCandidates(epoch iotago.EpochIndex, candidates []iotago.AccountID) options.Option[NodeState]

func WithSybilProtectionCommittee

func WithSybilProtectionCommittee(epoch iotago.EpochIndex, committee []iotago.AccountID) options.Option[NodeState]

func WithSybilProtectionOnlineCommittee

func WithSybilProtectionOnlineCommittee(committee ...account.SeatIndex) options.Option[NodeState]

func WithTick

func WithTick(tick time.Duration) options.Option[TestSuite]

func WithWaitFor

func WithWaitFor(waitFor time.Duration) options.Option[TestSuite]

func WithWalletAmount

func WithWalletAmount(amount iotago.BaseToken) options.Option[WalletOptions]

func WithWalletBlockIssuanceCredits

func WithWalletBlockIssuanceCredits(blockIssuanceCredits iotago.BlockIssuanceCredits) options.Option[WalletOptions]

func WithWalletFixedCost

func WithWalletFixedCost(fixedCost iotago.Mana) options.Option[WalletOptions]

Types

type NodeState

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

type TestSuite

type TestSuite struct {
	Testing *testing.T

	Directory *utils.Directory

	API                      iotago.API
	ProtocolParameterOptions []options.Option[iotago.V3ProtocolParameters]
	// contains filtered or unexported fields
}

func NewTestSuite

func NewTestSuite(t *testing.T, opts ...options.Option[TestSuite]) *TestSuite

func (*TestSuite) AccountOutput

func (t *TestSuite) AccountOutput(alias string) *mock.OutputData

func (*TestSuite) AccountsOfNodes

func (t *TestSuite) AccountsOfNodes(names ...string) []iotago.AccountID

func (*TestSuite) AddDefaultWallet

func (t *TestSuite) AddDefaultWallet(node *mock.Node, walletOpts ...options.Option[WalletOptions]) *mock.Wallet

func (*TestSuite) AddGenesisAccount

func (t *TestSuite) AddGenesisAccount(accountDetails snapshotcreator.AccountDetails)

AddGenesisAccount adds an account the test suite in the genesis snapshot.

func (*TestSuite) AddGenesisWallet

func (t *TestSuite) AddGenesisWallet(name string, node *mock.Node, walletOpts ...options.Option[WalletOptions]) *mock.Wallet

AddGenesisWallet adds a wallet to the test suite with a block issuer in the genesis snapshot and access to the genesis seed. If no block issuance credits are provided, the wallet will be assigned half of the maximum block issuance credits.

func (*TestSuite) AddNode

func (t *TestSuite) AddNode(name string, walletOpts ...options.Option[WalletOptions]) *mock.Node

func (*TestSuite) AddNodeToPartition

func (t *TestSuite) AddNodeToPartition(name string, partition string, walletOpts ...options.Option[WalletOptions]) *mock.Node

func (*TestSuite) AddValidatorNode

func (t *TestSuite) AddValidatorNode(name string, walletOpts ...options.Option[WalletOptions]) *mock.Node

func (*TestSuite) AddValidatorNodeToPartition

func (t *TestSuite) AddValidatorNodeToPartition(name string, partition string, walletOpts ...options.Option[WalletOptions]) *mock.Node

func (*TestSuite) AddWallet

func (t *TestSuite) AddWallet(name string, node *mock.Node, accountID iotago.AccountID, keyManager ...*wallet.KeyManager) *mock.Wallet

func (*TestSuite) AssertAccountData

func (t *TestSuite) AssertAccountData(accountData *accounts.AccountData, nodes ...*mock.Node)

func (*TestSuite) AssertAccountDiff

func (t *TestSuite) AssertAccountDiff(accountID iotago.AccountID, index iotago.SlotIndex, accountDiff *model.AccountDiff, destroyed bool, nodes ...*mock.Node)

func (*TestSuite) AssertAccountStake

func (t *TestSuite) AssertAccountStake(accountID iotago.AccountID, validatorStake iotago.BaseToken, delegationStake iotago.BaseToken,
	nodes ...*mock.Node)

func (*TestSuite) AssertActiveRootBlocks

func (t *TestSuite) AssertActiveRootBlocks(expectedBlocks []*blocks.Block, nodes ...*mock.Node)

func (*TestSuite) AssertAttestationsForSlot

func (t *TestSuite) AssertAttestationsForSlot(slot iotago.SlotIndex, blocks []*blocks.Block, nodes ...*mock.Node)

func (*TestSuite) AssertBlock

func (t *TestSuite) AssertBlock(block *blocks.Block, client mock.Client) *iotago.Block

func (*TestSuite) AssertBlockFiltered

func (t *TestSuite) AssertBlockFiltered(blocks []*blocks.Block, reason error, node *mock.Node)

func (*TestSuite) AssertBlocksExist

func (t *TestSuite) AssertBlocksExist(blocks []*blocks.Block, expectedExist bool, clients ...mock.Client)

func (*TestSuite) AssertBlocksInCacheAccepted

func (t *TestSuite) AssertBlocksInCacheAccepted(expectedBlocks []*blocks.Block, expectedAccepted bool, nodes ...*mock.Node)

func (*TestSuite) AssertBlocksInCacheBooked

func (t *TestSuite) AssertBlocksInCacheBooked(expectedBlocks []*blocks.Block, expectedBooked bool, nodes ...*mock.Node)

func (*TestSuite) AssertBlocksInCacheConfirmed

func (t *TestSuite) AssertBlocksInCacheConfirmed(expectedBlocks []*blocks.Block, expectedConfirmed bool, nodes ...*mock.Node)

func (*TestSuite) AssertBlocksInCacheConflicts

func (t *TestSuite) AssertBlocksInCacheConflicts(blockConflicts map[*blocks.Block][]string, nodes ...*mock.Node)

func (*TestSuite) AssertBlocksInCacheInvalid

func (t *TestSuite) AssertBlocksInCacheInvalid(expectedBlocks []*blocks.Block, expectedInvalid bool, nodes ...*mock.Node)

func (*TestSuite) AssertBlocksInCachePreAccepted

func (t *TestSuite) AssertBlocksInCachePreAccepted(expectedBlocks []*blocks.Block, expectedPreAccepted bool, nodes ...*mock.Node)

func (*TestSuite) AssertBlocksInCachePreConfirmed

func (t *TestSuite) AssertBlocksInCachePreConfirmed(expectedBlocks []*blocks.Block, expectedPreConfirmed bool, nodes ...*mock.Node)

func (*TestSuite) AssertBlocksInCacheRootBlock

func (t *TestSuite) AssertBlocksInCacheRootBlock(expectedBlocks []*blocks.Block, expectedRootBlock bool, nodes ...*mock.Node)

func (*TestSuite) AssertBlocksInCacheScheduled

func (t *TestSuite) AssertBlocksInCacheScheduled(expectedBlocks []*blocks.Block, expectedScheduled bool, nodes ...*mock.Node)

func (*TestSuite) AssertCandidateEngineActivatedCount

func (t *TestSuite) AssertCandidateEngineActivatedCount(expectedCount int, nodes ...*mock.Node)

func (*TestSuite) AssertCommitmentSlotIndexExists

func (t *TestSuite) AssertCommitmentSlotIndexExists(slot iotago.SlotIndex, clients ...mock.Client)

func (*TestSuite) AssertCommitmentsAndChainsEvicted

func (t *TestSuite) AssertCommitmentsAndChainsEvicted(expectedEvictedSlot iotago.SlotIndex, nodes ...*mock.Node)

func (*TestSuite) AssertCommitmentsOnChain

func (t *TestSuite) AssertCommitmentsOnChain(expectedCommitments []*model.Commitment, expectedChainID iotago.CommitmentID, nodes ...*mock.Node)

func (*TestSuite) AssertCommitmentsOnChainAndChainHasCommitments

func (t *TestSuite) AssertCommitmentsOnChainAndChainHasCommitments(expectedCommitments []*model.Commitment, chainID iotago.CommitmentID, nodes ...*mock.Node)

func (*TestSuite) AssertCommitmentsOnEvictedChain

func (t *TestSuite) AssertCommitmentsOnEvictedChain(expectedCommitments []*model.Commitment, expectedOrphaned bool, nodes ...*mock.Node)

func (*TestSuite) AssertEpochVersions

func (t *TestSuite) AssertEpochVersions(epochVersions map[iotago.Version]iotago.EpochIndex, nodes ...*mock.Node)

func (*TestSuite) AssertEqualStoredCommitmentAtIndex

func (t *TestSuite) AssertEqualStoredCommitmentAtIndex(index iotago.SlotIndex, nodes ...*mock.Node)

func (*TestSuite) AssertEvictedSlot

func (t *TestSuite) AssertEvictedSlot(expectedIndex iotago.SlotIndex, nodes ...*mock.Node)

func (*TestSuite) AssertForkDetectedCount

func (t *TestSuite) AssertForkDetectedCount(expectedCount int, nodes ...*mock.Node)

func (*TestSuite) AssertLatestCommitment

func (t *TestSuite) AssertLatestCommitment(commitment *iotago.Commitment, nodes ...*mock.Node)

func (*TestSuite) AssertLatestCommitmentCumulativeWeight

func (t *TestSuite) AssertLatestCommitmentCumulativeWeight(cw uint64, nodes ...*mock.Node)

func (*TestSuite) AssertLatestCommitmentSlotIndex

func (t *TestSuite) AssertLatestCommitmentSlotIndex(slot iotago.SlotIndex, nodes ...*mock.Node)

func (*TestSuite) AssertLatestEngineCommitmentOnMainChain

func (t *TestSuite) AssertLatestEngineCommitmentOnMainChain(nodes ...*mock.Node)

func (*TestSuite) AssertLatestFinalizedSlot

func (t *TestSuite) AssertLatestFinalizedSlot(slot iotago.SlotIndex, nodes ...*mock.Node)

func (*TestSuite) AssertMainChain

func (t *TestSuite) AssertMainChain(expectedChainID iotago.CommitmentID, nodes ...*mock.Node)

func (*TestSuite) AssertMainEngineSwitchedCount

func (t *TestSuite) AssertMainEngineSwitchedCount(expectedCount int, nodes ...*mock.Node)

func (*TestSuite) AssertNodeState

func (t *TestSuite) AssertNodeState(nodes []*mock.Node, opts ...options.Option[NodeState])

func (*TestSuite) AssertProtocolParameters

func (t *TestSuite) AssertProtocolParameters(parameters iotago.ProtocolParameters, nodes ...*mock.Node)

func (*TestSuite) AssertPrunedUntil

func (t *TestSuite) AssertPrunedUntil(expectedStorage *types.Tuple[int, bool],
	expectedDecidedUpgrades *types.Tuple[int, bool],
	expectedPoolStats *types.Tuple[int, bool],
	expectedCommittee *types.Tuple[int, bool],
	expectedRewards *types.Tuple[int, bool], nodes ...*mock.Node)

func (*TestSuite) AssertReelectedCommitteeSeatIndices

func (t *TestSuite) AssertReelectedCommitteeSeatIndices(prevEpoch iotago.EpochIndex, newEpoch iotago.EpochIndex, nodes ...*mock.Node)

func (*TestSuite) AssertRetainerBlocksState

func (t *TestSuite) AssertRetainerBlocksState(expectedBlocks []*blocks.Block, expectedState api.BlockState, nodes ...*mock.Node)

func (*TestSuite) AssertSnapshotImported

func (t *TestSuite) AssertSnapshotImported(imported bool, nodes ...*mock.Node)

func (*TestSuite) AssertSpendersInCacheAcceptanceState

func (t *TestSuite) AssertSpendersInCacheAcceptanceState(expectedConflictAliases []string, expectedState acceptance.State, nodes ...*mock.Node)

func (*TestSuite) AssertStorageAccountDiffs

func (t *TestSuite) AssertStorageAccountDiffs(slot iotago.SlotIndex, accountDiffs map[iotago.AccountID]*model.AccountDiff, nodes ...*mock.Node)

func (*TestSuite) AssertStorageBlock

func (t *TestSuite) AssertStorageBlock(block *model.Block, node *mock.Node)

func (*TestSuite) AssertStorageBlockExist

func (t *TestSuite) AssertStorageBlockExist(block *model.Block, expectedExist bool, node *mock.Node)

func (*TestSuite) AssertStorageCommitmentBlockAccepted

func (t *TestSuite) AssertStorageCommitmentBlockAccepted(slot iotago.SlotIndex, blockID iotago.BlockID, expectedContains bool, nodes ...*mock.Node)

AssertStorageCommitmentBlockAccepted asserts that the given block ID has the expected containment status in the commitment identified by the given slot.

func (*TestSuite) AssertStorageCommitmentBlocks

func (t *TestSuite) AssertStorageCommitmentBlocks(slot iotago.SlotIndex, expectedBlocksBySlotCommitmentIDs map[iotago.CommitmentID]iotago.BlockIDs, nodes ...*mock.Node)

func (*TestSuite) AssertStorageCommitmentTransactionAccepted

func (t *TestSuite) AssertStorageCommitmentTransactionAccepted(slot iotago.SlotIndex, transactionID iotago.TransactionID, expectedContains bool, nodes ...*mock.Node)

AssertStorageCommitmentTransactionAccepted asserts that the given transaction ID has the expected containment status in the commitment identified by the given slot.

func (*TestSuite) AssertStorageCommitmentTransactions

func (t *TestSuite) AssertStorageCommitmentTransactions(slot iotago.SlotIndex, expectedTransactionIDs iotago.TransactionIDs, nodes ...*mock.Node)

AssertStorageCommitmentTransactions asserts that the given transactionIDs were included in the commitment identified by the given slot.

func (*TestSuite) AssertStorageCommitments

func (t *TestSuite) AssertStorageCommitments(commitments []*iotago.Commitment, nodes ...*mock.Node)

func (*TestSuite) AssertStorageRootBlocks

func (t *TestSuite) AssertStorageRootBlocks(blocks []*blocks.Block, nodes ...*mock.Node)

func (*TestSuite) AssertStrongTips

func (t *TestSuite) AssertStrongTips(expectedBlocks []*blocks.Block, nodes ...*mock.Node)

func (*TestSuite) AssertSybilProtectionCandidates

func (t *TestSuite) AssertSybilProtectionCandidates(epoch iotago.EpochIndex, expectedAccounts []iotago.AccountID, nodes ...*mock.Node)

func (*TestSuite) AssertSybilProtectionCommittee

func (t *TestSuite) AssertSybilProtectionCommittee(epoch iotago.EpochIndex, expectedAccounts []iotago.AccountID, nodes ...*mock.Node)

func (*TestSuite) AssertSybilProtectionOnlineCommittee

func (t *TestSuite) AssertSybilProtectionOnlineCommittee(expectedSeats []account.SeatIndex, nodes ...*mock.Node)

func (*TestSuite) AssertSybilProtectionRegisteredValidators

func (t *TestSuite) AssertSybilProtectionRegisteredValidators(epoch iotago.EpochIndex, expectedAccounts []string, nodes ...*mock.Node)

func (*TestSuite) AssertTransaction

func (t *TestSuite) AssertTransaction(transaction *iotago.Transaction, node *mock.Node) mempool.Transaction

func (*TestSuite) AssertTransactionFailure

func (t *TestSuite) AssertTransactionFailure(signedTxID iotago.SignedTransactionID, txFailureReason error, nodes ...*mock.Node)

func (*TestSuite) AssertTransactionInCacheConflicts

func (t *TestSuite) AssertTransactionInCacheConflicts(transactionConflicts map[*iotago.Transaction][]string, nodes ...*mock.Node)

func (*TestSuite) AssertTransactionsExist

func (t *TestSuite) AssertTransactionsExist(transactions []*iotago.Transaction, expectedExist bool, nodes ...*mock.Node)

func (*TestSuite) AssertTransactionsInCacheAccepted

func (t *TestSuite) AssertTransactionsInCacheAccepted(expectedTransactions []*iotago.Transaction, expectedFlag bool, nodes ...*mock.Node)

func (*TestSuite) AssertTransactionsInCacheBooked

func (t *TestSuite) AssertTransactionsInCacheBooked(expectedTransactions []*iotago.Transaction, expectedFlag bool, nodes ...*mock.Node)

func (*TestSuite) AssertTransactionsInCacheInvalid

func (t *TestSuite) AssertTransactionsInCacheInvalid(expectedTransactions []*iotago.Transaction, expectedFlag bool, nodes ...*mock.Node)

func (*TestSuite) AssertTransactionsInCacheOrphaned

func (t *TestSuite) AssertTransactionsInCacheOrphaned(expectedTransactions []*iotago.Transaction, expectedFlag bool, nodes ...*mock.Node)

func (*TestSuite) AssertTransactionsInCachePending

func (t *TestSuite) AssertTransactionsInCachePending(expectedTransactions []*iotago.Transaction, expectedFlag bool, nodes ...*mock.Node)

func (*TestSuite) AssertTransactionsInCacheRejected

func (t *TestSuite) AssertTransactionsInCacheRejected(expectedTransactions []*iotago.Transaction, expectedFlag bool, nodes ...*mock.Node)

func (*TestSuite) AssertUniqueCommitmentChain

func (t *TestSuite) AssertUniqueCommitmentChain(nodes ...*mock.Node)

func (*TestSuite) AssertVersionAndProtocolParameters

func (t *TestSuite) AssertVersionAndProtocolParameters(versionsAndProtocolParameters map[iotago.Version]iotago.ProtocolParameters, nodes ...*mock.Node)

func (*TestSuite) AssertVersionAndProtocolParametersHashes

func (t *TestSuite) AssertVersionAndProtocolParametersHashes(versionsAndProtocolParametersHashes map[iotago.Version]iotago.Identifier, nodes ...*mock.Node)

func (*TestSuite) Block

func (t *TestSuite) Block(alias string) *blocks.Block

Block returns the block with the given alias. Important to note that this blocks.Block is a placeholder and is thus not the same as the blocks.Block that is created by a node.

func (*TestSuite) BlockID

func (t *TestSuite) BlockID(alias string) iotago.BlockID

func (*TestSuite) BlockIDs

func (t *TestSuite) BlockIDs(aliases ...string) []iotago.BlockID

func (*TestSuite) BlockIDsWithPrefix

func (t *TestSuite) BlockIDsWithPrefix(prefix string) []iotago.BlockID

func (*TestSuite) BlockIssuersForNodes

func (t *TestSuite) BlockIssuersForNodes(nodes []*mock.Node) []*mock.BlockIssuer

BlockIssersForNodes returns a map of block issuers for each node. If the node is a validator, its block issuer is the validation block issuer. Else, it is the block issuer for the test suite.

func (*TestSuite) Blocks

func (t *TestSuite) Blocks(aliases ...string) []*blocks.Block

func (*TestSuite) BlocksWithPrefix

func (t *TestSuite) BlocksWithPrefix(prefix string) []*blocks.Block

func (*TestSuite) BlocksWithPrefixes

func (t *TestSuite) BlocksWithPrefixes(prefixes ...string) []*blocks.Block

func (*TestSuite) BlocksWithSuffix

func (t *TestSuite) BlocksWithSuffix(suffix string) []*blocks.Block

func (*TestSuite) BlocksWithSuffixes

func (t *TestSuite) BlocksWithSuffixes(suffixes ...string) []*blocks.Block

func (*TestSuite) ClientsForNodes

func (t *TestSuite) ClientsForNodes(nodes ...*mock.Node) []mock.Client

func (*TestSuite) CommitUntilSlot

func (t *TestSuite) CommitUntilSlot(slot iotago.SlotIndex, parents ...iotago.BlockID) []iotago.BlockID

func (*TestSuite) CommitmentOfMainEngine

func (t *TestSuite) CommitmentOfMainEngine(node *mock.Node, slot iotago.SlotIndex) *model.Commitment

func (*TestSuite) CommitmentsOfMainEngine

func (t *TestSuite) CommitmentsOfMainEngine(node *mock.Node, start, end iotago.SlotIndex) []*model.Commitment

func (*TestSuite) CurrentSlot

func (t *TestSuite) CurrentSlot() iotago.SlotIndex

func (*TestSuite) DefaultWallet

func (t *TestSuite) DefaultWallet() *mock.Wallet

func (*TestSuite) Eventually

func (t *TestSuite) Eventually(condition func() error)

Eventually asserts that given condition will be met in opts.waitFor time, periodically checking target function each opts.tick.

assert.Eventually(t, func() bool { return true; }, time.Second, 10*time.Millisecond)

func (*TestSuite) IssueBasicBlockWithOptions

func (t *TestSuite) IssueBasicBlockWithOptions(blockName string, wallet *mock.Wallet, payload iotago.Payload, blockOpts ...options.Option[mock.BlockHeaderParams]) (*blocks.Block, error)

func (*TestSuite) IssueBlocksAtEpoch

func (t *TestSuite) IssueBlocksAtEpoch(prefix string, epoch iotago.EpochIndex, rowsPerSlot int, initialParentsPrefix string, nodes []*mock.Node, waitForSlotsCommitted bool, useCommitmentAtMinCommittableAge bool) (allBlocksIssued []*blocks.Block, lastBlockRow []*blocks.Block)

func (*TestSuite) IssueBlocksAtSlots

func (t *TestSuite) IssueBlocksAtSlots(prefix string, slots []iotago.SlotIndex, rowsPerSlot int, initialParentsPrefix string, nodes []*mock.Node, waitForSlotsCommitted bool, useCommitmentAtMinCommittableAge bool) (allBlocksIssued []*blocks.Block, lastBlockRow []*blocks.Block)

func (*TestSuite) IssueCandidacyAnnouncementInSlot

func (t *TestSuite) IssueCandidacyAnnouncementInSlot(alias string, slot iotago.SlotIndex, parentsPrefixAlias string, wallet *mock.Wallet, issuingOptions ...options.Option[mock.BlockHeaderParams]) (*blocks.Block, error)

func (*TestSuite) IssueExistingBlock

func (t *TestSuite) IssueExistingBlock(blockName string, wallet *mock.Wallet) error

func (*TestSuite) IssueValidationBlockWithHeaderOptions

func (t *TestSuite) IssueValidationBlockWithHeaderOptions(blockName string, node *mock.Node, blockHeaderOpts ...options.Option[mock.BlockHeaderParams]) (*blocks.Block, error)

func (*TestSuite) IssueValidationBlockWithOptions

func (t *TestSuite) IssueValidationBlockWithOptions(blockName string, node *mock.Node, blockOpts ...options.Option[mock.ValidationBlockParams]) (*blocks.Block, error)

func (*TestSuite) MergePartitionsToMain

func (t *TestSuite) MergePartitionsToMain(partitions ...string)

func (*TestSuite) Node

func (t *TestSuite) Node(name string) *mock.Node

func (*TestSuite) Nodes

func (t *TestSuite) Nodes(names ...string) []*mock.Node

func (*TestSuite) RegisterBlock

func (t *TestSuite) RegisterBlock(blockName string, block *blocks.Block)

func (*TestSuite) RemoveNode

func (t *TestSuite) RemoveNode(name string)

func (*TestSuite) Run

func (t *TestSuite) Run(failOnBlockFiltered bool, nodesOptions ...map[string][]options.Option[protocol.Protocol])

func (*TestSuite) SeatOfNodes

func (t *TestSuite) SeatOfNodes(slot iotago.SlotIndex, names ...string) []account.SeatIndex

func (*TestSuite) SetAutomaticTransactionIssuingCounters

func (t *TestSuite) SetAutomaticTransactionIssuingCounters(partition string, newValue int)

func (*TestSuite) SetCurrentSlot

func (t *TestSuite) SetCurrentSlot(slot iotago.SlotIndex)

Update the global time of the test suite and all nodes and wallets.

func (*TestSuite) Shutdown

func (t *TestSuite) Shutdown()

func (*TestSuite) SlotsForEpoch

func (t *TestSuite) SlotsForEpoch(epoch iotago.EpochIndex) []iotago.SlotIndex

func (*TestSuite) SplitIntoPartitions

func (t *TestSuite) SplitIntoPartitions(partitions map[string][]*mock.Node)

func (*TestSuite) Validators

func (t *TestSuite) Validators() []*mock.Node

func (*TestSuite) Wait

func (t *TestSuite) Wait(nodes ...*mock.Node)

func (*TestSuite) WaitWithDelay

func (t *TestSuite) WaitWithDelay(delay time.Duration, nodes ...*mock.Node)

func (*TestSuite) Wallet

func (t *TestSuite) Wallet(name string) *mock.Wallet

type WalletOptions

type WalletOptions struct {
	Amount               iotago.BaseToken
	FixedCost            iotago.Mana
	BlockIssuanceCredits iotago.BlockIssuanceCredits
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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