block

package
v1.10.8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package block is a generated GoMock package.

Index

Constants

View Source
const CodecVersion = txs.CodecVersion

CodecVersion is the current default codec version

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block interface {
	snow.ContextInitializable

	ID() ids.ID
	Parent() ids.ID
	Height() uint64
	// Timestamp that this block was created at
	Timestamp() time.Time
	MerkleRoot() ids.ID
	Bytes() []byte

	// Txs returns the transactions contained in the block
	Txs() []*txs.Tx
	// contains filtered or unexported methods
}

Block defines the common stateless interface for all blocks

type MockBlock

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

MockBlock is a mock of Block interface.

func NewMockBlock

func NewMockBlock(ctrl *gomock.Controller) *MockBlock

NewMockBlock creates a new mock instance.

func (*MockBlock) Bytes

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

Bytes mocks base method.

func (*MockBlock) EXPECT

func (m *MockBlock) EXPECT() *MockBlockMockRecorder

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

func (*MockBlock) Height

func (m *MockBlock) Height() uint64

Height mocks base method.

func (*MockBlock) ID

func (m *MockBlock) ID() ids.ID

ID mocks base method.

func (*MockBlock) InitCtx

func (m *MockBlock) InitCtx(arg0 *snow.Context)

InitCtx mocks base method.

func (*MockBlock) MerkleRoot

func (m *MockBlock) MerkleRoot() ids.ID

MerkleRoot mocks base method.

func (*MockBlock) Parent

func (m *MockBlock) Parent() ids.ID

Parent mocks base method.

func (*MockBlock) Timestamp

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

Timestamp mocks base method.

func (*MockBlock) Txs

func (m *MockBlock) Txs() []*txs.Tx

Txs mocks base method.

type MockBlockMockRecorder

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

MockBlockMockRecorder is the mock recorder for MockBlock.

func (*MockBlockMockRecorder) Bytes

func (mr *MockBlockMockRecorder) Bytes() *gomock.Call

Bytes indicates an expected call of Bytes.

func (*MockBlockMockRecorder) Height

func (mr *MockBlockMockRecorder) Height() *gomock.Call

Height indicates an expected call of Height.

func (*MockBlockMockRecorder) ID

func (mr *MockBlockMockRecorder) ID() *gomock.Call

ID indicates an expected call of ID.

func (*MockBlockMockRecorder) InitCtx

func (mr *MockBlockMockRecorder) InitCtx(arg0 any) *gomock.Call

InitCtx indicates an expected call of InitCtx.

func (*MockBlockMockRecorder) MerkleRoot

func (mr *MockBlockMockRecorder) MerkleRoot() *gomock.Call

MerkleRoot indicates an expected call of MerkleRoot.

func (*MockBlockMockRecorder) Parent

func (mr *MockBlockMockRecorder) Parent() *gomock.Call

Parent indicates an expected call of Parent.

func (*MockBlockMockRecorder) Timestamp

func (mr *MockBlockMockRecorder) Timestamp() *gomock.Call

Timestamp indicates an expected call of Timestamp.

func (*MockBlockMockRecorder) Txs

func (mr *MockBlockMockRecorder) Txs() *gomock.Call

Txs indicates an expected call of Txs.

type Parser

type Parser interface {
	txs.Parser

	ParseBlock(bytes []byte) (Block, error)
	ParseGenesisBlock(bytes []byte) (Block, error)
}

func NewCustomParser

func NewCustomParser(
	typeToFxIndex map[reflect.Type]int,
	clock *mockable.Clock,
	log logging.Logger,
	fxs []fxs.Fx,
) (Parser, error)

func NewParser

func NewParser(fxs []fxs.Fx) (Parser, error)

type StandardBlock

type StandardBlock struct {
	// parent's ID
	PrntID ids.ID `serialize:"true" json:"parentID"`
	// This block's height. The genesis block is at height 0.
	Hght uint64 `serialize:"true" json:"height"`
	Time uint64 `serialize:"true" json:"time"`
	Root ids.ID `serialize:"true" json:"merkleRoot"`
	// List of transactions contained in this block.
	Transactions []*txs.Tx `serialize:"true" json:"txs"`

	BlockID ids.ID `json:"id"`
	// contains filtered or unexported fields
}

func NewStandardBlock

func NewStandardBlock(
	parentID ids.ID,
	height uint64,
	timestamp time.Time,
	txs []*txs.Tx,
	cm codec.Manager,
) (*StandardBlock, error)

func (*StandardBlock) Bytes

func (b *StandardBlock) Bytes() []byte

func (*StandardBlock) Height

func (b *StandardBlock) Height() uint64

func (*StandardBlock) ID

func (b *StandardBlock) ID() ids.ID

func (*StandardBlock) InitCtx

func (b *StandardBlock) InitCtx(ctx *snow.Context)

func (*StandardBlock) MerkleRoot

func (b *StandardBlock) MerkleRoot() ids.ID

func (*StandardBlock) Parent

func (b *StandardBlock) Parent() ids.ID

func (*StandardBlock) Timestamp

func (b *StandardBlock) Timestamp() time.Time

func (*StandardBlock) Txs

func (b *StandardBlock) Txs() []*txs.Tx

Directories

Path Synopsis
Package executor is a generated GoMock package.
Package executor is a generated GoMock package.

Jump to

Keyboard shortcuts

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