Documentation
¶
Overview ¶
Package block is a generated GoMock package.
Index ¶
- Constants
- Variables
- func RegisterBlockTypes(targetCodec linearcodec.Codec) error
- func RegisterGenesisType(val interface{}) error
- type AbortBlock
- type Block
- type CommitBlock
- type CommonBlock
- type MockBlock
- func (m *MockBlock) Bytes() []byte
- 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) Txs() []*txs.Tx
- func (m *MockBlock) Visit(visitor Visitor) error
- type MockBlockMockRecorder
- func (mr *MockBlockMockRecorder) Bytes() *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) Txs() *gomock.Call
- func (mr *MockBlockMockRecorder) Visit(visitor any) *gomock.Call
- type ProposalBlock
- type RuntimeInitializable
- type StandardBlock
- type TimestampedBlock
- type Visitor
Constants ¶
const CodecVersion = txs.CodecVersion
Variables ¶
var ( // GenesisCodec allows blocks of larger than usual size to be parsed. // While this gives flexibility in accommodating large genesis blocks // it must not be used to parse new, unverified blocks which instead // must be processed by Codec. GenesisCodec codec.Manager Codec codec.Manager )
Functions ¶
func RegisterBlockTypes ¶ added in v1.27.0
func RegisterBlockTypes(targetCodec linearcodec.Codec) error
RegisterBlockTypes registers the canonical block type IDs. There is exactly one type per block kind: StandardBlock, ProposalBlock, CommitBlock, AbortBlock. Tx types come from txs.RegisterTypes.
func RegisterGenesisType ¶ added in v1.16.56
func RegisterGenesisType(val interface{}) error
RegisterGenesisType registers a type with the GenesisCodec. This is used by other packages (e.g. state) to register types that are only ever encountered in genesis bytes.
Types ¶
type AbortBlock ¶ added in v1.27.0
type AbortBlock struct {
Time uint64 `serialize:"true" json:"time"`
CommonBlock `serialize:"true"`
}
AbortBlock is the canonical P-Chain abort outcome of a ProposalBlock.
func NewAbortBlock ¶ added in v1.27.0
func (*AbortBlock) InitRuntime ¶ added in v1.27.0
func (*AbortBlock) InitRuntime(*runtime.Runtime)
func (*AbortBlock) Initialize ¶ added in v1.27.0
func (*AbortBlock) Initialize(context.Context) error
func (*AbortBlock) Timestamp ¶ added in v1.27.0
func (b *AbortBlock) Timestamp() time.Time
func (*AbortBlock) Txs ¶ added in v1.27.0
func (*AbortBlock) Txs() []*txs.Tx
func (*AbortBlock) Visit ¶ added in v1.27.0
func (b *AbortBlock) Visit(v Visitor) error
type Block ¶
type Block interface {
RuntimeInitializable
ID() ids.ID
Parent() ids.ID
Bytes() []byte
Height() uint64
// Txs returns list of transactions contained in the block
Txs() []*txs.Tx
// Visit calls [visitor] with this block's concrete type
Visit(visitor Visitor) error
// contains filtered or unexported methods
}
Block defines the common stateless interface for all blocks
type CommitBlock ¶ added in v1.27.0
type CommitBlock struct {
Time uint64 `serialize:"true" json:"time"`
CommonBlock `serialize:"true"`
}
CommitBlock is the canonical P-Chain commit outcome of a ProposalBlock.
func NewCommitBlock ¶ added in v1.27.0
func (*CommitBlock) InitRuntime ¶ added in v1.27.0
func (*CommitBlock) InitRuntime(*runtime.Runtime)
func (*CommitBlock) Initialize ¶ added in v1.27.0
func (*CommitBlock) Initialize(context.Context) error
func (*CommitBlock) Timestamp ¶ added in v1.27.0
func (b *CommitBlock) Timestamp() time.Time
func (*CommitBlock) Txs ¶ added in v1.27.0
func (*CommitBlock) Txs() []*txs.Tx
func (*CommitBlock) Visit ¶ added in v1.27.0
func (b *CommitBlock) Visit(v Visitor) error
type CommonBlock ¶
type CommonBlock 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"`
BlockID ids.ID `json:"id"`
// contains filtered or unexported fields
}
CommonBlock contains fields and methods common to all blocks in this VM.
func (*CommonBlock) Bytes ¶
func (b *CommonBlock) Bytes() []byte
func (*CommonBlock) Height ¶
func (b *CommonBlock) Height() uint64
func (*CommonBlock) ID ¶
func (b *CommonBlock) ID() ids.ID
func (*CommonBlock) Parent ¶
func (b *CommonBlock) Parent() ids.ID
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) EXPECT ¶
func (m *MockBlock) EXPECT() *MockBlockMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockBlock) InitRuntime ¶ added in v1.22.87
InitRuntime 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) InitRuntime ¶ added in v1.22.87
func (mr *MockBlockMockRecorder) InitRuntime(rt any) *gomock.Call
InitRuntime indicates an expected call of InitRuntime.
func (*MockBlockMockRecorder) Parent ¶
func (mr *MockBlockMockRecorder) Parent() *gomock.Call
Parent indicates an expected call of Parent.
func (*MockBlockMockRecorder) Txs ¶
func (mr *MockBlockMockRecorder) Txs() *gomock.Call
Txs indicates an expected call of Txs.
type ProposalBlock ¶ added in v1.27.0
type ProposalBlock struct {
Time uint64 `serialize:"true" json:"time"`
Transactions []*txs.Tx `serialize:"true" json:"txs"`
CommonBlock `serialize:"true"`
Tx *txs.Tx `serialize:"true" json:"tx"`
}
ProposalBlock is the canonical P-Chain proposal block. It carries a per-block timestamp, a single proposal Tx, and a tail of decision Txs that commit atomically with the proposal outcome.
func NewProposalBlock ¶ added in v1.27.0
func (*ProposalBlock) InitRuntime ¶ added in v1.27.0
func (b *ProposalBlock) InitRuntime(rt *runtime.Runtime)
func (*ProposalBlock) Initialize ¶ added in v1.27.0
func (*ProposalBlock) Initialize(context.Context) error
func (*ProposalBlock) Timestamp ¶ added in v1.27.0
func (b *ProposalBlock) Timestamp() time.Time
func (*ProposalBlock) Txs ¶ added in v1.27.0
func (b *ProposalBlock) Txs() []*txs.Tx
func (*ProposalBlock) Visit ¶ added in v1.27.0
func (b *ProposalBlock) Visit(v Visitor) error
type RuntimeInitializable ¶ added in v1.22.87
RuntimeInitializable defines the interface for initializing context
type StandardBlock ¶ added in v1.27.0
type StandardBlock struct {
Time uint64 `serialize:"true" json:"time"`
CommonBlock `serialize:"true"`
Transactions []*txs.Tx `serialize:"true" json:"txs"`
}
StandardBlock is the canonical P-Chain standard block. It carries a per-block timestamp (advance-all-implicitly removed the separate AdvanceTimeTx flow) and an ordered list of decision txs.
func NewStandardBlock ¶ added in v1.27.0
func (*StandardBlock) InitRuntime ¶ added in v1.27.0
func (b *StandardBlock) InitRuntime(rt *runtime.Runtime)
func (*StandardBlock) Initialize ¶ added in v1.27.0
func (*StandardBlock) Initialize(context.Context) error
func (*StandardBlock) Timestamp ¶ added in v1.27.0
func (b *StandardBlock) Timestamp() time.Time
func (*StandardBlock) Txs ¶ added in v1.27.0
func (b *StandardBlock) Txs() []*txs.Tx
func (*StandardBlock) Visit ¶ added in v1.27.0
func (b *StandardBlock) Visit(v Visitor) error
type TimestampedBlock ¶ added in v1.27.0
type Visitor ¶
type Visitor interface {
AbortBlock(*AbortBlock) error
CommitBlock(*CommitBlock) error
ProposalBlock(*ProposalBlock) error
StandardBlock(*StandardBlock) error
}
Visitor dispatches by the canonical P-Chain block type. Under carries a timestamp and is one of the four canonical kinds.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package executor is a generated GoMock package.
|
Package executor is a generated GoMock package. |
|
executormock
Package executormock is a generated GoMock package.
|
Package executormock is a generated GoMock package. |