exec_context

package
v0.5.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockExecutionContext

func NewMockExecutionContext(options ...TestOption) txtypes.ExecutionContext

Types

type MockExecContext

type MockExecContext struct {
	Tx            *types.TransactionOrder
	Unit          *state.Unit
	RootTrustBase types.RootTrustBase
	RoundNumber   uint64
	GasRemaining  uint64
	// contains filtered or unexported fields
}

func (*MockExecContext) CalculateCost

func (m *MockExecContext) CalculateCost() uint64

func (*MockExecContext) CurrentRound

func (m *MockExecContext) CurrentRound() uint64

func (*MockExecContext) GasAvailable

func (m *MockExecContext) GasAvailable() uint64

func (*MockExecContext) GetData

func (m *MockExecContext) GetData() []byte

func (*MockExecContext) GetUnit

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

func (*MockExecContext) SetData

func (m *MockExecContext) SetData(data []byte)

func (*MockExecContext) SpendGas

func (m *MockExecContext) SpendGas(gas uint64) error

func (*MockExecContext) TransactionOrder

func (m *MockExecContext) TransactionOrder() (*types.TransactionOrder, error)

func (*MockExecContext) TrustBase

func (m *MockExecContext) TrustBase(epoch uint64) (types.RootTrustBase, error)

type TestOption

type TestOption func(*MockExecContext)

func WithCurrentRound

func WithCurrentRound(round uint64) TestOption

func WithData

func WithData(data []byte) TestOption

func WithErr

func WithErr(err error) TestOption

func WithUnit

func WithUnit(unit *state.Unit) TestOption

Jump to

Keyboard shortcuts

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