testtxsystem

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CounterTxSystem

type CounterTxSystem struct {
	InitCount       uint64
	BeginBlockCount uint64
	EndBlockCount   uint64
	ExecuteCount    uint64
	RevertCount     uint64
	SummaryValue    uint64

	ExecuteCountDelta    uint64
	EndBlockCountDelta   uint64
	BeginBlockCountDelta uint64

	// setting this affects the state once EndBlock() is called
	EndBlockChangesState bool

	FixedState   txsystem.StateReader
	ErrorState   *ErrorState
	FeelessMode  bool
	ExecuteError error

	// fee charged for each tx
	Fee uint64
	// contains filtered or unexported fields
}

func (*CounterTxSystem) BeginBlock

func (m *CounterTxSystem) BeginBlock(nr uint64) error

func (*CounterTxSystem) Clone

func (m *CounterTxSystem) Clone() *CounterTxSystem

Returns a copy of the txSystem to be used for creating blocks without affecting the original

func (*CounterTxSystem) Commit

func (*CounterTxSystem) CommittedUC

func (m *CounterTxSystem) CommittedUC() *types.UnicityCertificate

func (*CounterTxSystem) EndBlock

func (m *CounterTxSystem) EndBlock() (*txsystem.StateSummary, error)

func (*CounterTxSystem) Execute

func (*CounterTxSystem) IsFeelessMode

func (m *CounterTxSystem) IsFeelessMode() bool

func (*CounterTxSystem) IsPermissionedMode

func (m *CounterTxSystem) IsPermissionedMode() bool

func (*CounterTxSystem) Revert

func (m *CounterTxSystem) Revert()

func (*CounterTxSystem) SerializeState

func (m *CounterTxSystem) SerializeState(w io.Writer) error

func (*CounterTxSystem) SetCommittedUC

func (m *CounterTxSystem) SetCommittedUC(committedUC *types.UnicityCertificate)

func (*CounterTxSystem) State

func (*CounterTxSystem) StateSize

func (m *CounterTxSystem) StateSize() (uint64, error)

func (*CounterTxSystem) StateSummary

func (m *CounterTxSystem) StateSummary() (*txsystem.StateSummary, error)

func (*CounterTxSystem) TypeID

type ErrorState

type ErrorState struct {
	txsystem.StateReader
	Err error
}

func (*ErrorState) Serialize

func (m *ErrorState) Serialize(writer io.Writer, committed bool, executedTransactions map[string]uint64) error

type MockState

type MockState struct {
	Err error
}

func (MockState) CreateIndex

func (m MockState) CreateIndex(state.KeyExtractor[string]) (state.Index[string], error)

func (MockState) CreateUnitStateProof

func (m MockState) CreateUnitStateProof(id types.UnitID, logIndex int) (*types.UnitStateProof, error)

func (MockState) GetUnit

func (m MockState) GetUnit(id types.UnitID, committed bool) (state.Unit, error)

func (MockState) GetUnits

func (m MockState) GetUnits(unitTypeID *uint32, pdr *types.PartitionDescriptionRecord) ([]types.UnitID, error)

func (MockState) Serialize

func (m MockState) Serialize(writer io.Writer, committed bool, executedTransactions map[string]uint64) error

Jump to

Keyboard shortcuts

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