Run NodesReferencevmsplatformvm

block

Package block is a generated GoMock package.

import "github.com/luxfi/node/vms/platformvm/block"

Package block is a generated GoMock package.

Types

AbortBlock

AbortBlock is the canonical P-Chain abort outcome of a ProposalBlock. It carries a timestamp and no txs; the struct is the zap buffer.

func NewAbortBlock(
	timestamp time.Time,
	parentID ids.ID,
	height uint64,
) (*AbortBlock, error)
func (b AbortBlock) Bytes() []byte
func (*AbortBlock) DecisionTxs() []*txs.Tx
func (b AbortBlock) Height() uint64
func (b AbortBlock) ID() ids.ID
func (b AbortBlock) InitRuntime(rt *runtime.Runtime)
func (b AbortBlock) Parent() ids.ID
func (b AbortBlock) Timestamp() time.Time
func (b *AbortBlock) Visit(v Visitor) error

Block

Block is the common stateless interface for all P-chain blocks. Every block is a single native-ZAP object; there is no codec and no initialize step — the bytes are authoritative and blocks are built by New*Block or read by Parse, both of which bind ID = hash(bytes).

func Parse(b []byte) (Block, error)

CommitBlock

CommitBlock is the canonical P-Chain commit outcome of a ProposalBlock. It carries a timestamp and no txs; the struct is the zap buffer.

func NewCommitBlock(
	timestamp time.Time,
	parentID ids.ID,
	height uint64,
) (*CommitBlock, error)
func (b CommitBlock) Bytes() []byte
func (*CommitBlock) DecisionTxs() []*txs.Tx
func (b CommitBlock) Height() uint64
func (b CommitBlock) ID() ids.ID
func (b CommitBlock) InitRuntime(rt *runtime.Runtime)
func (b CommitBlock) Parent() ids.ID
func (b CommitBlock) Timestamp() time.Time
func (b *CommitBlock) Visit(v Visitor) error

MockBlock

MockBlock is a mock of Block interface.

func NewMockBlock(ctrl *gomock.Controller) *MockBlock
func (m *MockBlock) Bytes() []byte
func (m *MockBlock) DecisionTxs() []*txs.Tx
func (m *MockBlock) EXPECT() *MockBlockMockRecorder
func (m *MockBlock) Height() uint64
func (m *MockBlock) ID() ids.ID
func (m *MockBlock) InitRuntime(rt *runtime.Runtime)
func (m *MockBlock) Parent() ids.ID
func (m *MockBlock) Visit(visitor Visitor) error

MockBlockMockRecorder

MockBlockMockRecorder is the mock recorder for MockBlock.

func (mr *MockBlockMockRecorder) Bytes() *gomock.Call
func (mr *MockBlockMockRecorder) DecisionTxs() *gomock.Call
func (mr *MockBlockMockRecorder) Height() *gomock.Call
func (mr *MockBlockMockRecorder) ID() *gomock.Call
func (mr *MockBlockMockRecorder) InitRuntime(rt any) *gomock.Call
func (mr *MockBlockMockRecorder) Parent() *gomock.Call
func (mr *MockBlockMockRecorder) Visit(visitor any) *gomock.Call

ProposalBlock

ProposalBlock is the canonical P-Chain proposal block. It carries a per-block timestamp, a tail of decision txs (stored as the u32 length list + blob), and a single proposal Tx that commits atomically with them.

func NewProposalBlock(
	timestamp time.Time,
	parentID ids.ID,
	height uint64,
	proposalTx *txs.Tx,
	decisionTxs []*txs.Tx,
) (*ProposalBlock, error)
func (b ProposalBlock) Bytes() []byte
func (b *ProposalBlock) DecisionTxs() []*txs.Tx
func (b ProposalBlock) Height() uint64
func (b ProposalBlock) ID() ids.ID
func (b ProposalBlock) InitRuntime(rt *runtime.Runtime)
func (b ProposalBlock) Parent() ids.ID
func (b ProposalBlock) Timestamp() time.Time
func (b *ProposalBlock) Tx() *txs.Tx
func (b *ProposalBlock) Visit(v Visitor) error

RuntimeInitializable

RuntimeInitializable binds a runtime into a block's embedded txs.

StandardBlock

StandardBlock is the canonical P-Chain standard block. It carries a per-block timestamp and an ordered list of decision txs, stored as a u32 length list + concatenated tx blob in the zap buffer.

func NewStandardBlock(
	timestamp time.Time,
	parentID ids.ID,
	height uint64,
	txs []*txs.Tx,
) (*StandardBlock, error)
func (b StandardBlock) Bytes() []byte
func (b *StandardBlock) DecisionTxs() []*txs.Tx
func (b StandardBlock) Height() uint64
func (b StandardBlock) ID() ids.ID
func (b StandardBlock) InitRuntime(rt *runtime.Runtime)
func (b StandardBlock) Parent() ids.ID
func (b StandardBlock) Timestamp() time.Time
func (b *StandardBlock) Visit(v Visitor) error

TimestampedBlock

TimestampedBlock is a Block that carries a per-block timestamp. Every canonical P-chain block kind is timestamped.

Visitor

Visitor dispatches by the canonical P-Chain block type. Under carries a timestamp and is one of the four canonical kinds.