Documentation
¶
Overview ¶
Package block implements block structure for the DEX VM.
Index ¶
- Variables
- type Block
- func (b *Block) Accept(ctx context.Context) error
- func (b *Block) Bytes() []byte
- func (b *Block) Height() uint64
- func (b *Block) ID() ids.ID
- func (b *Block) Parent() ids.ID
- func (b *Block) Producer() ids.NodeID
- func (b *Block) Reject(ctx context.Context) error
- func (b *Block) SetStatus(status Status)
- func (b *Block) StateRoot() ids.ID
- func (b *Block) Status() Status
- func (b *Block) Timestamp() time.Time
- func (b *Block) TimestampNano() int64
- func (b *Block) Transactions() []txs.Tx
- func (b *Block) TxCount() int
- func (b *Block) TxRoot() ids.ID
- func (b *Block) Verify(ctx context.Context) error
- type BlockParser
- type Builder
- type Status
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBlockTooLarge = errors.New("block exceeds maximum size") ErrTooManyTxs = errors.New("block contains too many transactions") ErrInvalidBlockTime = errors.New("invalid block timestamp") ErrInvalidParent = errors.New("invalid parent block") ErrBlockNotVerified = errors.New("block not verified") )
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
Block represents a block in the DEX VM.
func NewBlock ¶
func NewBlock( parentID ids.ID, height uint64, timestamp int64, transactions []txs.Tx, producer ids.NodeID, ) *Block
NewBlock creates a new block.
func (*Block) TimestampNano ¶
TimestampNano returns the block timestamp in nanoseconds.
func (*Block) Transactions ¶
Transactions returns the transactions in the block.
type BlockParser ¶
type BlockParser struct {
// contains filtered or unexported fields
}
BlockParser parses blocks from bytes.
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder builds new blocks.
func NewBuilder ¶
func NewBuilder(parentID ids.ID, height uint64, maxBlockSize uint64, maxTxsPerBlock uint32) *Builder
NewBuilder creates a new block builder.
func (*Builder) CurrentSize ¶
CurrentSize returns the current block size.
Click to show internal directories.
Click to hide internal directories.