backend

package
v0.0.0-...-d7cfa30 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package backend is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// Processor gets the current block processor.
	Processor() *processor.BlockProcessor

	// ChainConfig gets the current chain config.
	ChainConfig() *params.ChainConfig

	// Blockchain gets the blockchain instance.
	Blockchain() blockchain.Blockchain

	// StateArchive gets the state archive instance.
	StateArchive() worldstate.LayeredWorldStateArchive

	// ImportBlock process and import a block.
	ImportBlock(ctx context.Context, blk *types.Block, prvBlk *types.Block) error

	// ImportBlocks import a list of blocks.
	ImportBlocks(ctx context.Context, blks []*types.Block) error

	// SetSafeTag sets the safe tag.
	SetSafeTag(ctx context.Context, safe common.Hash)

	// SetFinalizedTag sets the finalized tag.
	SetFinalizedTag(ctx context.Context, finalized common.Hash)

	// DebugDestructStateChild is used to destruct a state child.
	// Note: This should ONLY be called for debug purpose.
	DebugDestructStateChild(height uint64, root common.Hash, child common.Hash) error

	// DebugForceProcessBlock is used to force process a block.
	// Note: This should ONLY be called for debug purpose.
	DebugForceProcessBlock(ctx context.Context, blk *types.Block) error

	// SubscribeChainHeadEvent registers a subscription of ChainHeadEvent.
	SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription

	// Shutdown safely shuts the backend down.
	Shutdown()
}

func NewBackendImpl

func NewBackendImpl(
	blkProcessor *processor.BlockProcessor,
	chainConfig *params.ChainConfig,
	bc blockchain.Blockchain,
	sa worldstate.LayeredWorldStateArchive) Backend

NewBackendImpl creates a new backend.

type BackendImpl

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

BackendImpl implements Backend.

func (*BackendImpl) Blockchain

func (b *BackendImpl) Blockchain() blockchain.Blockchain

Blockchain gets the blockchain instance.

func (*BackendImpl) ChainConfig

func (b *BackendImpl) ChainConfig() *params.ChainConfig

ChainConfig gets the current chain config.

func (*BackendImpl) DebugDestructStateChild

func (b *BackendImpl) DebugDestructStateChild(height uint64, root common.Hash, child common.Hash) error

DebugDestructStateChild is used to destruct a state child. Note: This should ONLY be called for debug purpose.

func (*BackendImpl) DebugForceProcessBlock

func (b *BackendImpl) DebugForceProcessBlock(ctx context.Context, blk *types.Block) error

DebugForceProcessBlock is used to force process a block. Note: This should ONLY be called for debug purpose.

func (*BackendImpl) ImportBlock

func (b *BackendImpl) ImportBlock(ctx context.Context, blk *types.Block, prvBlk *types.Block) error

ImportBlock process and import a block.

func (*BackendImpl) ImportBlocks

func (b *BackendImpl) ImportBlocks(ctx context.Context, blks []*types.Block) error

ImportBlocks import a list of blocks.

func (*BackendImpl) Processor

func (b *BackendImpl) Processor() *processor.BlockProcessor

Processor gets the current block processor.

func (*BackendImpl) SetFinalizedTag

func (b *BackendImpl) SetFinalizedTag(ctx context.Context, finalized common.Hash)

SetFinalizedTag sets the finalized tag.

func (*BackendImpl) SetSafeTag

func (b *BackendImpl) SetSafeTag(ctx context.Context, safe common.Hash)

SetSafeTag sets the safe tag.

func (*BackendImpl) Shutdown

func (b *BackendImpl) Shutdown()

Shutdown safely shuts the backend down.

func (*BackendImpl) StateArchive

StateArchive gets the state archive instance.

func (*BackendImpl) SubscribeChainHeadEvent

func (b *BackendImpl) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription

SubscribeChainHeadEvent registers a subscription of ChainHeadEvent.

type MockBackend

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

MockBackend is a mock of Backend interface.

func NewMockBackend

func NewMockBackend(ctrl *gomock.Controller) *MockBackend

NewMockBackend creates a new mock instance.

func (*MockBackend) Blockchain

func (m *MockBackend) Blockchain() blockchain.Blockchain

Blockchain mocks base method.

func (*MockBackend) ChainConfig

func (m *MockBackend) ChainConfig() *params.ChainConfig

ChainConfig mocks base method.

func (*MockBackend) DebugDestructStateChild

func (m *MockBackend) DebugDestructStateChild(height uint64, root, child common.Hash) error

DebugDestructStateChild mocks base method.

func (*MockBackend) DebugForceProcessBlock

func (m *MockBackend) DebugForceProcessBlock(ctx context.Context, blk *types.Block) error

DebugForceProcessBlock mocks base method.

func (*MockBackend) EXPECT

func (m *MockBackend) EXPECT() *MockBackendMockRecorder

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

func (*MockBackend) ImportBlock

func (m *MockBackend) ImportBlock(ctx context.Context, blk, prvBlk *types.Block) error

ImportBlock mocks base method.

func (*MockBackend) ImportBlocks

func (m *MockBackend) ImportBlocks(ctx context.Context, blks []*types.Block) error

ImportBlocks mocks base method.

func (*MockBackend) Processor

func (m *MockBackend) Processor() *processor.BlockProcessor

Processor mocks base method.

func (*MockBackend) SetFinalizedTag

func (m *MockBackend) SetFinalizedTag(ctx context.Context, finalized common.Hash)

SetFinalizedTag mocks base method.

func (*MockBackend) SetSafeTag

func (m *MockBackend) SetSafeTag(ctx context.Context, safe common.Hash)

SetSafeTag mocks base method.

func (*MockBackend) Shutdown

func (m *MockBackend) Shutdown()

Shutdown mocks base method.

func (*MockBackend) StateArchive

StateArchive mocks base method.

func (*MockBackend) SubscribeChainHeadEvent

func (m *MockBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription

SubscribeChainHeadEvent mocks base method.

type MockBackendMockRecorder

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

MockBackendMockRecorder is the mock recorder for MockBackend.

func (*MockBackendMockRecorder) Blockchain

func (mr *MockBackendMockRecorder) Blockchain() *gomock.Call

Blockchain indicates an expected call of Blockchain.

func (*MockBackendMockRecorder) ChainConfig

func (mr *MockBackendMockRecorder) ChainConfig() *gomock.Call

ChainConfig indicates an expected call of ChainConfig.

func (*MockBackendMockRecorder) DebugDestructStateChild

func (mr *MockBackendMockRecorder) DebugDestructStateChild(height, root, child any) *gomock.Call

DebugDestructStateChild indicates an expected call of DebugDestructStateChild.

func (*MockBackendMockRecorder) DebugForceProcessBlock

func (mr *MockBackendMockRecorder) DebugForceProcessBlock(ctx, blk any) *gomock.Call

DebugForceProcessBlock indicates an expected call of DebugForceProcessBlock.

func (*MockBackendMockRecorder) ImportBlock

func (mr *MockBackendMockRecorder) ImportBlock(ctx, blk, prvBlk any) *gomock.Call

ImportBlock indicates an expected call of ImportBlock.

func (*MockBackendMockRecorder) ImportBlocks

func (mr *MockBackendMockRecorder) ImportBlocks(ctx, blks any) *gomock.Call

ImportBlocks indicates an expected call of ImportBlocks.

func (*MockBackendMockRecorder) Processor

func (mr *MockBackendMockRecorder) Processor() *gomock.Call

Processor indicates an expected call of Processor.

func (*MockBackendMockRecorder) SetFinalizedTag

func (mr *MockBackendMockRecorder) SetFinalizedTag(ctx, finalized any) *gomock.Call

SetFinalizedTag indicates an expected call of SetFinalizedTag.

func (*MockBackendMockRecorder) SetSafeTag

func (mr *MockBackendMockRecorder) SetSafeTag(ctx, safe any) *gomock.Call

SetSafeTag indicates an expected call of SetSafeTag.

func (*MockBackendMockRecorder) Shutdown

func (mr *MockBackendMockRecorder) Shutdown() *gomock.Call

Shutdown indicates an expected call of Shutdown.

func (*MockBackendMockRecorder) StateArchive

func (mr *MockBackendMockRecorder) StateArchive() *gomock.Call

StateArchive indicates an expected call of StateArchive.

func (*MockBackendMockRecorder) SubscribeChainHeadEvent

func (mr *MockBackendMockRecorder) SubscribeChainHeadEvent(ch any) *gomock.Call

SubscribeChainHeadEvent indicates an expected call of SubscribeChainHeadEvent.

Jump to

Keyboard shortcuts

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