mempooltests

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestMemoryReleaseMaxMemoryIncreaseFactor = 1.20
)

Variables

This section is empty.

Functions

func NewStateReference

func NewStateReference(referencedStateID iotago.Identifier, stateType mempool.StateType) mempool.StateReference

func TestAll

func TestAll(t *testing.T, frameworkProvider func(*testing.T) *TestFramework)

func TestInvalidTransaction

func TestInvalidTransaction(t *testing.T, tf *TestFramework)

func TestProcessTransaction

func TestProcessTransaction(t *testing.T, tf *TestFramework)

func TestProcessTransactionWithReadOnlyInputs

func TestProcessTransactionWithReadOnlyInputs(t *testing.T, tf *TestFramework)

func TestProcessTransactionsOutOfOrder

func TestProcessTransactionsOutOfOrder(t *testing.T, tf *TestFramework)

func TestSetTransactionOrphanage

func TestSetTransactionOrphanage(t *testing.T, tf *TestFramework)

func TestSetTxOrphanageMultipleAttachments

func TestSetTxOrphanageMultipleAttachments(t *testing.T, tf *TestFramework)

func TestSpendPropagation

func TestSpendPropagation(t *testing.T, tf *TestFramework)

func TestStoreAttachmentInEvictedSlot

func TestStoreAttachmentInEvictedSlot(t *testing.T, tf *TestFramework)

Types

type SignedTransaction

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

func NewSignedTransaction

func NewSignedTransaction(transaction mempool.Transaction) *SignedTransaction

func (*SignedTransaction) ID

func (*SignedTransaction) String

func (s *SignedTransaction) String() string

type TestFramework

type TestFramework struct {
	Instance mempool.MemPool[vote.MockedRank]
	SpendDAG spenddag.SpendDAG[iotago.TransactionID, mempool.StateID, vote.MockedRank]
	// contains filtered or unexported fields
}

func (*TestFramework) AssertStateDiff

func (t *TestFramework) AssertStateDiff(slot iotago.SlotIndex, spentOutputAliases, createdOutputAliases, transactionAliases []string)

func (*TestFramework) AttachTransaction

func (t *TestFramework) AttachTransaction(signedTransactionAlias, transactionAlias, blockAlias string, slot iotago.SlotIndex) error

func (*TestFramework) AttachTransactions

func (t *TestFramework) AttachTransactions(transactionAlias ...string) error

func (*TestFramework) BlockID

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

func (*TestFramework) Cleanup

func (t *TestFramework) Cleanup()

func (*TestFramework) CommitSlot

func (t *TestFramework) CommitSlot(slot iotago.SlotIndex)

func (*TestFramework) CreateSignedTransaction

func (t *TestFramework) CreateSignedTransaction(transactionAlias string, referencedStates []string, outputCount uint16, invalid ...bool)

func (*TestFramework) CreateTransaction

func (t *TestFramework) CreateTransaction(alias string, referencedStates []string, outputCount uint16, invalid ...bool)

func (*TestFramework) InjectState

func (t *TestFramework) InjectState(alias string, state mempool.State)

func (*TestFramework) MarkAttachmentIncluded

func (t *TestFramework) MarkAttachmentIncluded(alias string) bool

func (*TestFramework) OutputStateMetadata

func (t *TestFramework) OutputStateMetadata(alias string) (mempool.StateMetadata, error)

func (*TestFramework) RequireAccepted

func (t *TestFramework) RequireAccepted(transactionAliases map[string]bool)

func (*TestFramework) RequireAttachmentsEvicted

func (t *TestFramework) RequireAttachmentsEvicted(attachmentAliases map[string]bool)

func (*TestFramework) RequireBooked

func (t *TestFramework) RequireBooked(transactionAliases ...string)

func (*TestFramework) RequireInvalid

func (t *TestFramework) RequireInvalid(transactionAliases ...string)

func (*TestFramework) RequireSpenderIDs

func (t *TestFramework) RequireSpenderIDs(spendMapping map[string][]string)

func (*TestFramework) RequireTransactionsEvicted

func (t *TestFramework) RequireTransactionsEvicted(transactionAliases map[string]bool)

func (*TestFramework) SignedTransactionFromTransaction

func (t *TestFramework) SignedTransactionFromTransaction(signedTransactionAlias string, transactionAlias string)

func (*TestFramework) SignedTransactionID

func (t *TestFramework) SignedTransactionID(alias string) iotago.SignedTransactionID

func (*TestFramework) StateID

func (t *TestFramework) StateID(alias string) mempool.StateID

func (*TestFramework) TransactionID

func (t *TestFramework) TransactionID(alias string) iotago.TransactionID

func (*TestFramework) TransactionMetadata

func (t *TestFramework) TransactionMetadata(alias string) (mempool.TransactionMetadata, bool)

func (*TestFramework) TransactionMetadataByAttachment

func (t *TestFramework) TransactionMetadataByAttachment(alias string) (mempool.TransactionMetadata, bool)

func (*TestFramework) WaitChildren

func (t *TestFramework) WaitChildren()

type Transaction

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

func NewTransaction

func NewTransaction(outputCount uint16, inputs ...mempool.StateReference) *Transaction

func (*Transaction) ID

func (*Transaction) Inputs

func (t *Transaction) Inputs() ([]mempool.StateReference, error)

func (*Transaction) String

func (t *Transaction) String() string

type VM

type VM struct{}

func (*VM) Execute

func (V *VM) Execute(_ context.Context, transaction mempool.Transaction) (outputs []mempool.State, err error)

func (*VM) Inputs

func (V *VM) Inputs(transaction mempool.Transaction) ([]mempool.StateReference, error)

func (*VM) ValidateSignatures

func (V *VM) ValidateSignatures(_ mempool.SignedTransaction, _ []mempool.State) (executionContext context.Context, err error)

Jump to

Keyboard shortcuts

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