Documentation ¶
Index ¶
- func NewMockExecutionContext(options ...TestOption) txtypes.ExecutionContext
- type MockExecContext
- func (m *MockExecContext) CalculateCost() uint64
- func (m *MockExecContext) CurrentRound() uint64
- func (m *MockExecContext) GasAvailable() uint64
- func (m *MockExecContext) GetData() []byte
- func (m *MockExecContext) GetUnit(id types.UnitID, committed bool) (*state.Unit, error)
- func (m *MockExecContext) SetData(data []byte)
- func (m *MockExecContext) SpendGas(gas uint64) error
- func (m *MockExecContext) TransactionOrder() (*types.TransactionOrder, error)
- func (m *MockExecContext) TrustBase(epoch uint64) (types.RootTrustBase, error)
- type TestOption
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) 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
Click to show internal directories.
Click to hide internal directories.