Documentation
¶
Overview ¶
Package blocks is a generated GoMock package.
Index ¶
- Constants
- type Block
- 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) InitCtx(arg0 *snow.Context)
- func (m *MockBlock) MerkleRoot() ids.ID
- func (m *MockBlock) Parent() ids.ID
- func (m *MockBlock) Timestamp() time.Time
- func (m *MockBlock) Txs() []*txs.Tx
- type MockBlockMockRecorder
- func (mr *MockBlockMockRecorder) Bytes() *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) MerkleRoot() *gomock.Call
- func (mr *MockBlockMockRecorder) Parent() *gomock.Call
- func (mr *MockBlockMockRecorder) Timestamp() *gomock.Call
- func (mr *MockBlockMockRecorder) Txs() *gomock.Call
- type Parser
- type StandardBlock
- func (b *StandardBlock) Bytes() []byte
- func (b *StandardBlock) Height() uint64
- func (b *StandardBlock) ID() ids.ID
- func (b *StandardBlock) InitCtx(ctx *snow.Context)
- func (b *StandardBlock) MerkleRoot() ids.ID
- func (b *StandardBlock) Parent() ids.ID
- func (b *StandardBlock) Timestamp() time.Time
- func (b *StandardBlock) Txs() []*txs.Tx
Constants ¶
const CodecVersion = txs.CodecVersion
CodecVersion is the current default codec version
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block interface {
snow.ContextInitializable
ID() ids.ID
Parent() ids.ID
Height() uint64
// Timestamp that this block was created at
Timestamp() time.Time
MerkleRoot() ids.ID
Bytes() []byte
// Txs returns the transactions contained in the block
Txs() []*txs.Tx
// contains filtered or unexported methods
}
Block defines the common stateless interface for all blocks
type MockBlock ¶ added in v1.9.12
type MockBlock struct {
// contains filtered or unexported fields
}
MockBlock is a mock of Block interface.
func NewMockBlock ¶ added in v1.9.12
func NewMockBlock(ctrl *gomock.Controller) *MockBlock
NewMockBlock creates a new mock instance.
func (*MockBlock) EXPECT ¶ added in v1.9.12
func (m *MockBlock) EXPECT() *MockBlockMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockBlock) MerkleRoot ¶ added in v1.9.12
MerkleRoot mocks base method.
type MockBlockMockRecorder ¶ added in v1.9.12
type MockBlockMockRecorder struct {
// contains filtered or unexported fields
}
MockBlockMockRecorder is the mock recorder for MockBlock.
func (*MockBlockMockRecorder) Bytes ¶ added in v1.9.12
func (mr *MockBlockMockRecorder) Bytes() *gomock.Call
Bytes indicates an expected call of Bytes.
func (*MockBlockMockRecorder) Height ¶ added in v1.9.12
func (mr *MockBlockMockRecorder) Height() *gomock.Call
Height indicates an expected call of Height.
func (*MockBlockMockRecorder) ID ¶ added in v1.9.12
func (mr *MockBlockMockRecorder) ID() *gomock.Call
ID indicates an expected call of ID.
func (*MockBlockMockRecorder) InitCtx ¶ added in v1.9.12
func (mr *MockBlockMockRecorder) InitCtx(arg0 interface{}) *gomock.Call
InitCtx indicates an expected call of InitCtx.
func (*MockBlockMockRecorder) MerkleRoot ¶ added in v1.9.12
func (mr *MockBlockMockRecorder) MerkleRoot() *gomock.Call
MerkleRoot indicates an expected call of MerkleRoot.
func (*MockBlockMockRecorder) Parent ¶ added in v1.9.12
func (mr *MockBlockMockRecorder) Parent() *gomock.Call
Parent indicates an expected call of Parent.
func (*MockBlockMockRecorder) Timestamp ¶ added in v1.9.12
func (mr *MockBlockMockRecorder) Timestamp() *gomock.Call
Timestamp indicates an expected call of Timestamp.
func (*MockBlockMockRecorder) Txs ¶ added in v1.9.12
func (mr *MockBlockMockRecorder) Txs() *gomock.Call
Txs indicates an expected call of Txs.
type Parser ¶
type Parser interface {
txs.Parser
ParseBlock(bytes []byte) (Block, error)
ParseGenesisBlock(bytes []byte) (Block, error)
InitializeBlock(block Block) error
InitializeGenesisBlock(block Block) error
}
func NewCustomParser ¶ added in v1.9.8
type StandardBlock ¶
type StandardBlock 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"`
Time uint64 `serialize:"true" json:"time"`
Root ids.ID `serialize:"true" json:"merkleRoot"`
// List of transactions contained in this block.
Transactions []*txs.Tx `serialize:"true" json:"txs"`
// contains filtered or unexported fields
}
func NewStandardBlock ¶
func (*StandardBlock) Bytes ¶
func (b *StandardBlock) Bytes() []byte
func (*StandardBlock) Height ¶
func (b *StandardBlock) Height() uint64
func (*StandardBlock) ID ¶
func (b *StandardBlock) ID() ids.ID
func (*StandardBlock) InitCtx ¶
func (b *StandardBlock) InitCtx(ctx *snow.Context)
func (*StandardBlock) MerkleRoot ¶ added in v1.9.12
func (b *StandardBlock) MerkleRoot() ids.ID
func (*StandardBlock) Parent ¶
func (b *StandardBlock) Parent() ids.ID
func (*StandardBlock) Timestamp ¶
func (b *StandardBlock) Timestamp() time.Time
func (*StandardBlock) Txs ¶
func (b *StandardBlock) Txs() []*txs.Tx