blockmock

package
v1.22.65 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package blockmock provides mock implementations for testing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockBlock

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

MockBlock provides a mock implementation for testing

func NewMockBlock

func NewMockBlock(id []byte, height uint64, parent []byte) *MockBlock

NewMockBlock creates a new mock block

func (*MockBlock) Accept

func (m *MockBlock) Accept(ctx context.Context) error

Accept marks the block as accepted

func (*MockBlock) Bytes

func (m *MockBlock) Bytes() []byte

Bytes returns the block bytes

func (*MockBlock) Height

func (m *MockBlock) Height() uint64

Height returns the block height

func (*MockBlock) ID

func (m *MockBlock) ID() []byte

ID returns the block ID

func (*MockBlock) Parent

func (m *MockBlock) Parent() []byte

Parent returns the parent block ID

func (*MockBlock) Reject

func (m *MockBlock) Reject(ctx context.Context) error

Reject marks the block as rejected

func (*MockBlock) Status

func (m *MockBlock) Status() int

Status returns the block status

func (*MockBlock) Timestamp

func (m *MockBlock) Timestamp() time.Time

Timestamp returns the block timestamp

Jump to

Keyboard shortcuts

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