Documentation ¶
Overview ¶
Package blocks is a generated GoMock package.
Index ¶
- Constants
- Variables
- func RegisterApricotBlockTypes(targetCodec codec.Registry) error
- func RegisterBanffBlockTypes(targetCodec codec.Registry) error
- type ApricotAbortBlock
- func (b *ApricotAbortBlock) AccumulatedFee(ids.ID) uint64
- func (b *ApricotAbortBlock) FeeFromAChain() uint64
- func (b *ApricotAbortBlock) FeeFromDChain() uint64
- func (b *ApricotAbortBlock) FeeFromOChain(ids.ID) uint64
- func (*ApricotAbortBlock) InitCtx(*snow.Context)
- func (*ApricotAbortBlock) Txs() []*txs.Tx
- func (b *ApricotAbortBlock) Visit(v Visitor) error
- type ApricotAtomicBlock
- func (b *ApricotAtomicBlock) AccumulatedFee(ids.ID) uint64
- func (b *ApricotAtomicBlock) FeeFromAChain() uint64
- func (b *ApricotAtomicBlock) FeeFromDChain() uint64
- func (b *ApricotAtomicBlock) FeeFromOChain(ids.ID) uint64
- func (b *ApricotAtomicBlock) InitCtx(ctx *snow.Context)
- func (b *ApricotAtomicBlock) Txs() []*txs.Tx
- func (b *ApricotAtomicBlock) Visit(v Visitor) error
- type ApricotCommitBlock
- func (b *ApricotCommitBlock) AccumulatedFee(ids.ID) uint64
- func (b *ApricotCommitBlock) FeeFromAChain() uint64
- func (b *ApricotCommitBlock) FeeFromDChain() uint64
- func (b *ApricotCommitBlock) FeeFromOChain(ids.ID) uint64
- func (*ApricotCommitBlock) InitCtx(*snow.Context)
- func (*ApricotCommitBlock) Txs() []*txs.Tx
- func (b *ApricotCommitBlock) Visit(v Visitor) error
- type ApricotProposalBlock
- func (b *ApricotProposalBlock) AccumulatedFee(assetID ids.ID) uint64
- func (b *ApricotProposalBlock) FeeFromAChain() uint64
- func (b *ApricotProposalBlock) FeeFromDChain() uint64
- func (b *ApricotProposalBlock) FeeFromOChain(assetID ids.ID) uint64
- func (b *ApricotProposalBlock) InitCtx(ctx *snow.Context)
- func (b *ApricotProposalBlock) Txs() []*txs.Tx
- func (b *ApricotProposalBlock) Visit(v Visitor) error
- type ApricotStandardBlock
- func (b *ApricotStandardBlock) AccumulatedFee(assetID ids.ID) uint64
- func (b *ApricotStandardBlock) FeeFromAChain() uint64
- func (b *ApricotStandardBlock) FeeFromDChain() uint64
- func (b *ApricotStandardBlock) FeeFromOChain(assetID ids.ID) uint64
- func (b *ApricotStandardBlock) InitCtx(ctx *snow.Context)
- func (b *ApricotStandardBlock) Txs() []*txs.Tx
- func (b *ApricotStandardBlock) Visit(v Visitor) error
- type BanffAbortBlock
- type BanffBlock
- type BanffCommitBlock
- type BanffProposalBlock
- type BanffStandardBlock
- type Block
- type CommonBlock
- type MockBlock
- func (m *MockBlock) AccumulatedFee(arg0 ids.ID) uint64
- func (m *MockBlock) Bytes() []byte
- func (m *MockBlock) EXPECT() *MockBlockMockRecorder
- func (m *MockBlock) FeeFromAChain() uint64
- func (m *MockBlock) FeeFromDChain() uint64
- func (m *MockBlock) FeeFromOChain(arg0 ids.ID) uint64
- func (m *MockBlock) Height() uint64
- func (m *MockBlock) ID() ids.ID
- func (m *MockBlock) InitCtx(arg0 *snow.Context)
- func (m *MockBlock) Parent() ids.ID
- func (m *MockBlock) Txs() []*txs.Tx
- func (m *MockBlock) Visit(arg0 Visitor) error
- type MockBlockMockRecorder
- func (mr *MockBlockMockRecorder) AccumulatedFee(arg0 interface{}) *gomock.Call
- func (mr *MockBlockMockRecorder) Bytes() *gomock.Call
- func (mr *MockBlockMockRecorder) FeeFromAChain() *gomock.Call
- func (mr *MockBlockMockRecorder) FeeFromDChain() *gomock.Call
- func (mr *MockBlockMockRecorder) FeeFromOChain(arg0 interface{}) *gomock.Call
- func (mr *MockBlockMockRecorder) Height() *gomock.Call
- func (mr *MockBlockMockRecorder) ID() *gomock.Call
- func (mr *MockBlockMockRecorder) InitCtx(arg0 interface{}) *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 ¶
const Version = txs.Version
Version is the current default codec version
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 ¶
RegisterApricotBlockTypes allows registering relevant type of blocks package in the right sequence. Following repackaging of omegavm package, a few subpackage-level codecs were introduced, each handling serialization of specific types.
func RegisterBanffBlockTypes ¶
Types ¶
type ApricotAbortBlock ¶
type ApricotAbortBlock struct {
CommonBlock `serialize:"true"`
}
func NewApricotAbortBlock ¶
func NewApricotAbortBlock( parentID ids.ID, height uint64, ) (*ApricotAbortBlock, error)
NewApricotAbortBlock is kept for testing purposes only. Following Banff activation and subsequent code cleanup, Apricot Abort blocks should be only verified (upon bootstrap), never created anymore
func (*ApricotAbortBlock) AccumulatedFee ¶
func (b *ApricotAbortBlock) AccumulatedFee(ids.ID) uint64
func (*ApricotAbortBlock) FeeFromAChain ¶
func (b *ApricotAbortBlock) FeeFromAChain() uint64
func (*ApricotAbortBlock) FeeFromDChain ¶
func (b *ApricotAbortBlock) FeeFromDChain() uint64
func (*ApricotAbortBlock) FeeFromOChain ¶
func (b *ApricotAbortBlock) FeeFromOChain(ids.ID) uint64
func (*ApricotAbortBlock) InitCtx ¶
func (*ApricotAbortBlock) InitCtx(*snow.Context)
func (*ApricotAbortBlock) Txs ¶
func (*ApricotAbortBlock) Txs() []*txs.Tx
func (*ApricotAbortBlock) Visit ¶
func (b *ApricotAbortBlock) Visit(v Visitor) error
type ApricotAtomicBlock ¶
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 ¶
func (*ApricotAtomicBlock) AccumulatedFee ¶
func (b *ApricotAtomicBlock) AccumulatedFee(ids.ID) uint64
func (*ApricotAtomicBlock) FeeFromAChain ¶
func (b *ApricotAtomicBlock) FeeFromAChain() uint64
func (*ApricotAtomicBlock) FeeFromDChain ¶
func (b *ApricotAtomicBlock) FeeFromDChain() uint64
func (*ApricotAtomicBlock) FeeFromOChain ¶
func (b *ApricotAtomicBlock) FeeFromOChain(ids.ID) uint64
func (*ApricotAtomicBlock) InitCtx ¶
func (b *ApricotAtomicBlock) InitCtx(ctx *snow.Context)
func (*ApricotAtomicBlock) Txs ¶
func (b *ApricotAtomicBlock) Txs() []*txs.Tx
func (*ApricotAtomicBlock) Visit ¶
func (b *ApricotAtomicBlock) Visit(v Visitor) error
type ApricotCommitBlock ¶
type ApricotCommitBlock struct {
CommonBlock `serialize:"true"`
}
func NewApricotCommitBlock ¶
func NewApricotCommitBlock( parentID ids.ID, height uint64, ) (*ApricotCommitBlock, error)
func (*ApricotCommitBlock) AccumulatedFee ¶
func (b *ApricotCommitBlock) AccumulatedFee(ids.ID) uint64
func (*ApricotCommitBlock) FeeFromAChain ¶
func (b *ApricotCommitBlock) FeeFromAChain() uint64
func (*ApricotCommitBlock) FeeFromDChain ¶
func (b *ApricotCommitBlock) FeeFromDChain() uint64
func (*ApricotCommitBlock) FeeFromOChain ¶
func (b *ApricotCommitBlock) FeeFromOChain(ids.ID) uint64
func (*ApricotCommitBlock) InitCtx ¶
func (*ApricotCommitBlock) InitCtx(*snow.Context)
func (*ApricotCommitBlock) Txs ¶
func (*ApricotCommitBlock) Txs() []*txs.Tx
func (*ApricotCommitBlock) Visit ¶
func (b *ApricotCommitBlock) Visit(v Visitor) error
type ApricotProposalBlock ¶
type ApricotProposalBlock struct { CommonBlock `serialize:"true"` Tx *txs.Tx `serialize:"true" json:"tx"` FeeAChain uint64 `serialize:"true" json:"feeFromAChain"` FeeDChain uint64 `serialize:"true" json:"feeFromDChain"` }
func NewApricotProposalBlock ¶
func NewApricotProposalBlock( parentID ids.ID, height uint64, tx *txs.Tx, ) (*ApricotProposalBlock, error)
NewApricotProposalBlock is kept for testing purposes only. Following Banff activation and subsequent code cleanup, Apricot Proposal blocks should be only verified (upon bootstrap), never created anymore
func (*ApricotProposalBlock) AccumulatedFee ¶
func (b *ApricotProposalBlock) AccumulatedFee(assetID ids.ID) uint64
func (*ApricotProposalBlock) FeeFromAChain ¶
func (b *ApricotProposalBlock) FeeFromAChain() uint64
func (*ApricotProposalBlock) FeeFromDChain ¶
func (b *ApricotProposalBlock) FeeFromDChain() uint64
func (*ApricotProposalBlock) FeeFromOChain ¶
func (b *ApricotProposalBlock) FeeFromOChain(assetID ids.ID) uint64
func (*ApricotProposalBlock) InitCtx ¶
func (b *ApricotProposalBlock) InitCtx(ctx *snow.Context)
func (*ApricotProposalBlock) Txs ¶
func (b *ApricotProposalBlock) Txs() []*txs.Tx
func (*ApricotProposalBlock) Visit ¶
func (b *ApricotProposalBlock) Visit(v Visitor) error
type ApricotStandardBlock ¶
type ApricotStandardBlock struct { CommonBlock `serialize:"true"` Transactions []*txs.Tx `serialize:"true" json:"txs"` FeeAChain uint64 `serialize:"true" json:"feeFromAChain"` FeeDChain uint64 `serialize:"true" json:"feeFromDChain"` }
func NewApricotStandardBlock ¶
func NewApricotStandardBlock( parentID ids.ID, height uint64, txs []*txs.Tx, ) (*ApricotStandardBlock, error)
NewApricotStandardBlock is kept for testing purposes only. Following Banff activation and subsequent code cleanup, Apricot Standard blocks should be only verified (upon bootstrap), never created anymore
func (*ApricotStandardBlock) AccumulatedFee ¶
func (b *ApricotStandardBlock) AccumulatedFee(assetID ids.ID) uint64
func (*ApricotStandardBlock) FeeFromAChain ¶
func (b *ApricotStandardBlock) FeeFromAChain() uint64
func (*ApricotStandardBlock) FeeFromDChain ¶
func (b *ApricotStandardBlock) FeeFromDChain() uint64
func (*ApricotStandardBlock) FeeFromOChain ¶
func (b *ApricotStandardBlock) FeeFromOChain(assetID ids.ID) uint64
func (*ApricotStandardBlock) InitCtx ¶
func (b *ApricotStandardBlock) InitCtx(ctx *snow.Context)
func (*ApricotStandardBlock) Txs ¶
func (b *ApricotStandardBlock) Txs() []*txs.Tx
func (*ApricotStandardBlock) Visit ¶
func (b *ApricotStandardBlock) Visit(v Visitor) error
type BanffAbortBlock ¶
type BanffAbortBlock struct { Time uint64 `serialize:"true" json:"time"` ApricotAbortBlock `serialize:"true"` }
func NewBanffAbortBlock ¶
func (*BanffAbortBlock) Timestamp ¶
func (b *BanffAbortBlock) Timestamp() time.Time
func (*BanffAbortBlock) Visit ¶
func (b *BanffAbortBlock) Visit(v Visitor) error
type BanffBlock ¶
type BanffCommitBlock ¶
type BanffCommitBlock struct { Time uint64 `serialize:"true" json:"time"` ApricotCommitBlock `serialize:"true"` }
func NewBanffCommitBlock ¶
func (*BanffCommitBlock) Timestamp ¶
func (b *BanffCommitBlock) Timestamp() time.Time
func (*BanffCommitBlock) Visit ¶
func (b *BanffCommitBlock) Visit(v Visitor) error
type BanffProposalBlock ¶
type BanffProposalBlock 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 NewBanffProposalBlock ¶
func (*BanffProposalBlock) FeeFromOChain ¶
func (b *BanffProposalBlock) FeeFromOChain(assetID ids.ID) uint64
func (*BanffProposalBlock) InitCtx ¶
func (b *BanffProposalBlock) InitCtx(ctx *snow.Context)
func (*BanffProposalBlock) Timestamp ¶
func (b *BanffProposalBlock) Timestamp() time.Time
func (*BanffProposalBlock) Visit ¶
func (b *BanffProposalBlock) Visit(v Visitor) error
type BanffStandardBlock ¶
type BanffStandardBlock struct { Time uint64 `serialize:"true" json:"time"` ApricotStandardBlock `serialize:"true"` }
func NewBanffStandardBlock ¶
func (*BanffStandardBlock) Timestamp ¶
func (b *BanffStandardBlock) Timestamp() time.Time
func (*BanffStandardBlock) Visit ¶
func (b *BanffStandardBlock) Visit(v Visitor) error
type Block ¶
type Block interface { snow.ContextInitializable 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 FeeFromOChain(ids.ID) uint64 FeeFromAChain() uint64 FeeFromDChain() uint64 AccumulatedFee(ids.ID) uint64 // contains filtered or unexported methods }
Block defines the common stateless interface for all blocks
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) AccumulatedFee ¶
AccumulatedFee 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) FeeFromAChain ¶
FeeFromAChain mocks base method.
func (*MockBlock) FeeFromDChain ¶
FeeFromDChain mocks base method.
func (*MockBlock) FeeFromOChain ¶
FeeFromOChain mocks base method.
type MockBlockMockRecorder ¶
type MockBlockMockRecorder struct {
// contains filtered or unexported fields
}
MockBlockMockRecorder is the mock recorder for MockBlock.
func (*MockBlockMockRecorder) AccumulatedFee ¶
func (mr *MockBlockMockRecorder) AccumulatedFee(arg0 interface{}) *gomock.Call
AccumulatedFee indicates an expected call of AccumulatedFee.
func (*MockBlockMockRecorder) Bytes ¶
func (mr *MockBlockMockRecorder) Bytes() *gomock.Call
Bytes indicates an expected call of Bytes.
func (*MockBlockMockRecorder) FeeFromAChain ¶
func (mr *MockBlockMockRecorder) FeeFromAChain() *gomock.Call
FeeFromAChain indicates an expected call of FeeFromAChain.
func (*MockBlockMockRecorder) FeeFromDChain ¶
func (mr *MockBlockMockRecorder) FeeFromDChain() *gomock.Call
FeeFromDChain indicates an expected call of FeeFromDChain.
func (*MockBlockMockRecorder) FeeFromOChain ¶
func (mr *MockBlockMockRecorder) FeeFromOChain(arg0 interface{}) *gomock.Call
FeeFromOChain indicates an expected call of FeeFromOChain.
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 interface{}) *gomock.Call
InitCtx indicates an expected call of InitCtx.
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 { BanffAbortBlock(*BanffAbortBlock) error BanffCommitBlock(*BanffCommitBlock) error BanffProposalBlock(*BanffProposalBlock) error BanffStandardBlock(*BanffStandardBlock) error ApricotAbortBlock(*ApricotAbortBlock) error ApricotCommitBlock(*ApricotCommitBlock) error ApricotProposalBlock(*ApricotProposalBlock) error ApricotStandardBlock(*ApricotStandardBlock) error ApricotAtomicBlock(*ApricotAtomicBlock) error }