Documentation ¶
Overview ¶
Package blocks is a generated GoMock package.
Index ¶
- Variables
- func RegisterApricotBlockTypes(targetCodec codec.Registry) error
- func RegisterBlueberryBlockTypes(targetCodec codec.Registry) error
- type ApricotAbortBlock
- type ApricotAtomicBlock
- type ApricotCommitBlock
- type ApricotProposalBlock
- type ApricotStandardBlock
- type Block
- type BlueberryAbortBlock
- type BlueberryBlock
- type BlueberryCommitBlock
- type BlueberryProposalBlock
- type BlueberryStandardBlock
- type CommonBlock
- type MockBlock
- type MockBlockMockRecorder
- func (mr *MockBlockMockRecorder) Bytes() *gomock.Call
- func (mr *MockBlockMockRecorder) Height() *gomock.Call
- func (mr *MockBlockMockRecorder) ID() *gomock.Call
- func (mr *MockBlockMockRecorder) Parent() *gomock.Call
- func (mr *MockBlockMockRecorder) Txs() *gomock.Call
- func (mr *MockBlockMockRecorder) Visit(arg0 interface{}) *gomock.Call
- type Visitor
Constants ¶
This section is empty.
Variables ¶
var ( Codec codec.Manager GenesisCodec codec.Manager )
GenesisCode 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
Functions ¶
func RegisterApricotBlockTypes ¶ added in v1.8.0
RegisterApricotBlockTypes allows registering relevant type of blocks package in the right sequence. Following repackaging of platformvm package, a few subpackage-level codecs were introduced, each handling serialization of specific types.
func RegisterBlueberryBlockTypes ¶ added in v1.8.0
Types ¶
type ApricotAbortBlock ¶ added in v1.8.0
type ApricotAbortBlock struct {
CommonBlock `serialize:"true"`
}
func NewApricotAbortBlock ¶ added in v1.8.0
func NewApricotAbortBlock( parentID ids.ID, height uint64, ) (*ApricotAbortBlock, error)
func (*ApricotAbortBlock) Txs ¶ added in v1.8.0
func (*ApricotAbortBlock) Txs() []*txs.Tx
func (*ApricotAbortBlock) Visit ¶ added in v1.8.0
func (b *ApricotAbortBlock) Visit(v Visitor) error
type ApricotAtomicBlock ¶ added in v1.8.0
type ApricotAtomicBlock struct { CommonBlock `serialize:"true"` Tx *txs.Tx `serialize:"true" json:"tx"` }
ApricotAtomicBlock being accepted results in the atomic transaction contained in the block to be accepted and committed to the chain.
func NewApricotAtomicBlock ¶ added in v1.8.0
func (*ApricotAtomicBlock) Txs ¶ added in v1.8.0
func (b *ApricotAtomicBlock) Txs() []*txs.Tx
func (*ApricotAtomicBlock) Visit ¶ added in v1.8.0
func (b *ApricotAtomicBlock) Visit(v Visitor) error
type ApricotCommitBlock ¶ added in v1.8.0
type ApricotCommitBlock struct {
CommonBlock `serialize:"true"`
}
func NewApricotCommitBlock ¶ added in v1.8.0
func NewApricotCommitBlock( parentID ids.ID, height uint64, ) (*ApricotCommitBlock, error)
func (*ApricotCommitBlock) Txs ¶ added in v1.8.0
func (*ApricotCommitBlock) Txs() []*txs.Tx
func (*ApricotCommitBlock) Visit ¶ added in v1.8.0
func (b *ApricotCommitBlock) Visit(v Visitor) error
type ApricotProposalBlock ¶ added in v1.8.0
type ApricotProposalBlock struct { CommonBlock `serialize:"true"` Tx *txs.Tx `serialize:"true" json:"tx"` }
func NewApricotProposalBlock ¶ added in v1.8.0
func (*ApricotProposalBlock) Txs ¶ added in v1.8.0
func (b *ApricotProposalBlock) Txs() []*txs.Tx
func (*ApricotProposalBlock) Visit ¶ added in v1.8.0
func (b *ApricotProposalBlock) Visit(v Visitor) error
type ApricotStandardBlock ¶ added in v1.8.0
type ApricotStandardBlock struct { CommonBlock `serialize:"true"` Transactions []*txs.Tx `serialize:"true" json:"txs"` }
func NewApricotStandardBlock ¶ added in v1.8.0
func (*ApricotStandardBlock) Txs ¶ added in v1.8.0
func (b *ApricotStandardBlock) Txs() []*txs.Tx
func (*ApricotStandardBlock) Visit ¶ added in v1.8.0
func (b *ApricotStandardBlock) Visit(v Visitor) error
type Block ¶
type Block interface { 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 BlueberryAbortBlock ¶ added in v1.8.0
type BlueberryAbortBlock struct { Time uint64 `serialize:"true" json:"time"` ApricotAbortBlock `serialize:"true"` }
func NewBlueberryAbortBlock ¶ added in v1.8.0
func (*BlueberryAbortBlock) Timestamp ¶ added in v1.8.0
func (b *BlueberryAbortBlock) Timestamp() time.Time
func (*BlueberryAbortBlock) Visit ¶ added in v1.8.0
func (b *BlueberryAbortBlock) Visit(v Visitor) error
type BlueberryBlock ¶ added in v1.8.0
type BlueberryCommitBlock ¶ added in v1.8.0
type BlueberryCommitBlock struct { Time uint64 `serialize:"true" json:"time"` ApricotCommitBlock `serialize:"true"` }
func NewBlueberryCommitBlock ¶ added in v1.8.0
func (*BlueberryCommitBlock) Timestamp ¶ added in v1.8.0
func (b *BlueberryCommitBlock) Timestamp() time.Time
func (*BlueberryCommitBlock) Visit ¶ added in v1.8.0
func (b *BlueberryCommitBlock) Visit(v Visitor) error
type BlueberryProposalBlock ¶ added in v1.8.0
type BlueberryProposalBlock struct { Time uint64 `serialize:"true" json:"time"` // Transactions is currently unused. This is populated so that introducing // them in the future will not require a codec change. // // TODO: when Transactions is used, we must correctly verify and apply their // changes. Transactions []*txs.Tx `serialize:"true" json:"-"` ApricotProposalBlock `serialize:"true"` }
func NewBlueberryProposalBlock ¶ added in v1.8.0
func (*BlueberryProposalBlock) Timestamp ¶ added in v1.8.0
func (b *BlueberryProposalBlock) Timestamp() time.Time
func (*BlueberryProposalBlock) Visit ¶ added in v1.8.0
func (b *BlueberryProposalBlock) Visit(v Visitor) error
type BlueberryStandardBlock ¶ added in v1.8.0
type BlueberryStandardBlock struct { Time uint64 `serialize:"true" json:"time"` ApricotStandardBlock `serialize:"true"` }
func NewBlueberryStandardBlock ¶ added in v1.8.0
func (*BlueberryStandardBlock) Timestamp ¶ added in v1.8.0
func (b *BlueberryStandardBlock) Timestamp() time.Time
func (*BlueberryStandardBlock) Visit ¶ added in v1.8.0
func (b *BlueberryStandardBlock) 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"` // 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.
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) 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.
func (*MockBlockMockRecorder) Visit ¶
func (mr *MockBlockMockRecorder) Visit(arg0 interface{}) *gomock.Call
Visit indicates an expected call of Visit.
type Visitor ¶
type Visitor interface { BlueberryAbortBlock(*BlueberryAbortBlock) error BlueberryCommitBlock(*BlueberryCommitBlock) error BlueberryProposalBlock(*BlueberryProposalBlock) error BlueberryStandardBlock(*BlueberryStandardBlock) error ApricotAbortBlock(*ApricotAbortBlock) error ApricotCommitBlock(*ApricotCommitBlock) error ApricotProposalBlock(*ApricotProposalBlock) error ApricotStandardBlock(*ApricotStandardBlock) error ApricotAtomicBlock(*ApricotAtomicBlock) error }