executor

package
v1.10.0-tahoe Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Overview

Package executor is a generated GoMock package.

Index

Constants

View Source
const SyncBound = 10 * time.Second

Variables

View Source
var (
	ErrUnexpectedMerkleRoot        = errors.New("unexpected merkle root")
	ErrTimestampBeyondSyncBound    = errors.New("proposed timestamp is too far in the future relative to local time")
	ErrEmptyBlock                  = errors.New("block contains no transactions")
	ErrChildBlockEarlierThanParent = errors.New("proposed timestamp before current chain time")
	ErrConflictingBlockTxs         = errors.New("block contains conflicting transactions")
	ErrIncorrectHeight             = errors.New("block has incorrect height")
	ErrBlockNotFound               = errors.New("block not found")
)
View Source
var (
	ErrChainNotSynced       = errors.New("chain not synced")
	ErrConflictingParentTxs = errors.New("block contains a transaction that conflicts with a transaction in a parent block")
)

Functions

This section is empty.

Types

type Block

type Block struct {
	blocks.Block
	// contains filtered or unexported fields
}

Exported for testing in avm package.

func (*Block) Accept

func (b *Block) Accept(context.Context) error

func (*Block) Reject

func (b *Block) Reject(context.Context) error

func (*Block) Status

func (b *Block) Status() choices.Status

func (*Block) Verify

func (b *Block) Verify(context.Context) error

type Manager

type Manager interface {
	states.Versions

	// Returns the ID of the most recently accepted block.
	LastAccepted() ids.ID

	SetPreference(blkID ids.ID)
	Preferred() ids.ID

	GetBlock(blkID ids.ID) (snowman.Block, error)
	GetStatelessBlock(blkID ids.ID) (blocks.Block, error)
	NewBlock(blocks.Block) snowman.Block

	// VerifyTx verifies that the transaction can be issued based on the
	// currently preferred state.
	VerifyTx(tx *txs.Tx) error

	// VerifyUniqueInputs verifies that the inputs are not duplicated in the
	// provided blk or any of its ancestors pinned in memory.
	VerifyUniqueInputs(blkID ids.ID, inputs set.Set[ids.ID]) error
}

func NewManager

func NewManager(
	mempool mempool.Mempool,
	metrics metrics.Metrics,
	state states.State,
	backend *executor.Backend,
	clk *mockable.Clock,
	onAccept func(*txs.Tx) error,
) Manager

type MockManager

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

MockManager is a mock of Manager interface.

func NewMockManager

func NewMockManager(ctrl *gomock.Controller) *MockManager

NewMockManager creates a new mock instance.

func (*MockManager) EXPECT

func (m *MockManager) EXPECT() *MockManagerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockManager) GetBlock

func (m *MockManager) GetBlock(arg0 ids.ID) (snowman.Block, error)

GetBlock mocks base method.

func (*MockManager) GetState

func (m *MockManager) GetState(arg0 ids.ID) (states.Chain, bool)

GetState mocks base method.

func (*MockManager) GetStatelessBlock

func (m *MockManager) GetStatelessBlock(arg0 ids.ID) (blocks.Block, error)

GetStatelessBlock mocks base method.

func (*MockManager) LastAccepted

func (m *MockManager) LastAccepted() ids.ID

LastAccepted mocks base method.

func (*MockManager) NewBlock

func (m *MockManager) NewBlock(arg0 blocks.Block) snowman.Block

NewBlock mocks base method.

func (*MockManager) Preferred

func (m *MockManager) Preferred() ids.ID

Preferred mocks base method.

func (*MockManager) SetPreference

func (m *MockManager) SetPreference(arg0 ids.ID)

SetPreference mocks base method.

func (*MockManager) VerifyTx

func (m *MockManager) VerifyTx(arg0 *txs.Tx) error

VerifyTx mocks base method.

func (*MockManager) VerifyUniqueInputs

func (m *MockManager) VerifyUniqueInputs(arg0 ids.ID, arg1 set.Set[ids.ID]) error

VerifyUniqueInputs mocks base method.

type MockManagerMockRecorder

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

MockManagerMockRecorder is the mock recorder for MockManager.

func (*MockManagerMockRecorder) GetBlock

func (mr *MockManagerMockRecorder) GetBlock(arg0 interface{}) *gomock.Call

GetBlock indicates an expected call of GetBlock.

func (*MockManagerMockRecorder) GetState

func (mr *MockManagerMockRecorder) GetState(arg0 interface{}) *gomock.Call

GetState indicates an expected call of GetState.

func (*MockManagerMockRecorder) GetStatelessBlock

func (mr *MockManagerMockRecorder) GetStatelessBlock(arg0 interface{}) *gomock.Call

GetStatelessBlock indicates an expected call of GetStatelessBlock.

func (*MockManagerMockRecorder) LastAccepted

func (mr *MockManagerMockRecorder) LastAccepted() *gomock.Call

LastAccepted indicates an expected call of LastAccepted.

func (*MockManagerMockRecorder) NewBlock

func (mr *MockManagerMockRecorder) NewBlock(arg0 interface{}) *gomock.Call

NewBlock indicates an expected call of NewBlock.

func (*MockManagerMockRecorder) Preferred

func (mr *MockManagerMockRecorder) Preferred() *gomock.Call

Preferred indicates an expected call of Preferred.

func (*MockManagerMockRecorder) SetPreference

func (mr *MockManagerMockRecorder) SetPreference(arg0 interface{}) *gomock.Call

SetPreference indicates an expected call of SetPreference.

func (*MockManagerMockRecorder) VerifyTx

func (mr *MockManagerMockRecorder) VerifyTx(arg0 interface{}) *gomock.Call

VerifyTx indicates an expected call of VerifyTx.

func (*MockManagerMockRecorder) VerifyUniqueInputs

func (mr *MockManagerMockRecorder) VerifyUniqueInputs(arg0, arg1 interface{}) *gomock.Call

VerifyUniqueInputs indicates an expected call of VerifyUniqueInputs.

Jump to

Keyboard shortcuts

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