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() []bytefunc (*AbortBlock) DecisionTxs() []*txs.Txfunc (b AbortBlock) Height() uint64func (b AbortBlock) ID() ids.IDfunc (b AbortBlock) InitRuntime(rt *runtime.Runtime)func (b AbortBlock) Parent() ids.IDfunc (b AbortBlock) Timestamp() time.Timefunc (b *AbortBlock) Visit(v Visitor) errorBlock
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() []bytefunc (*CommitBlock) DecisionTxs() []*txs.Txfunc (b CommitBlock) Height() uint64func (b CommitBlock) ID() ids.IDfunc (b CommitBlock) InitRuntime(rt *runtime.Runtime)func (b CommitBlock) Parent() ids.IDfunc (b CommitBlock) Timestamp() time.Timefunc (b *CommitBlock) Visit(v Visitor) errorMockBlock
MockBlock is a mock of Block interface.
func NewMockBlock(ctrl *gomock.Controller) *MockBlockfunc (m *MockBlock) Bytes() []bytefunc (m *MockBlock) DecisionTxs() []*txs.Txfunc (m *MockBlock) EXPECT() *MockBlockMockRecorderfunc (m *MockBlock) Height() uint64func (m *MockBlock) ID() ids.IDfunc (m *MockBlock) InitRuntime(rt *runtime.Runtime)func (m *MockBlock) Parent() ids.IDfunc (m *MockBlock) Visit(visitor Visitor) errorMockBlockMockRecorder
MockBlockMockRecorder is the mock recorder for MockBlock.
func (mr *MockBlockMockRecorder) Bytes() *gomock.Callfunc (mr *MockBlockMockRecorder) DecisionTxs() *gomock.Callfunc (mr *MockBlockMockRecorder) Height() *gomock.Callfunc (mr *MockBlockMockRecorder) ID() *gomock.Callfunc (mr *MockBlockMockRecorder) InitRuntime(rt any) *gomock.Callfunc (mr *MockBlockMockRecorder) Parent() *gomock.Callfunc (mr *MockBlockMockRecorder) Visit(visitor any) *gomock.CallProposalBlock
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() []bytefunc (b *ProposalBlock) DecisionTxs() []*txs.Txfunc (b ProposalBlock) Height() uint64func (b ProposalBlock) ID() ids.IDfunc (b ProposalBlock) InitRuntime(rt *runtime.Runtime)func (b ProposalBlock) Parent() ids.IDfunc (b ProposalBlock) Timestamp() time.Timefunc (b *ProposalBlock) Tx() *txs.Txfunc (b *ProposalBlock) Visit(v Visitor) errorRuntimeInitializable
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() []bytefunc (b *StandardBlock) DecisionTxs() []*txs.Txfunc (b StandardBlock) Height() uint64func (b StandardBlock) ID() ids.IDfunc (b StandardBlock) InitRuntime(rt *runtime.Runtime)func (b StandardBlock) Parent() ids.IDfunc (b StandardBlock) Timestamp() time.Timefunc (b *StandardBlock) Visit(v Visitor) errorTimestampedBlock
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.