types

package
v0.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlobIdentifiersMerkleRoot

func BlobIdentifiersMerkleRoot(blobs []*BlobIdentifier) crypto.Hash

Types

type BlobIdentifier

type BlobIdentifier struct {
	Height     uint64
	Commitment crypto.Hash
}

func BlobIdentifierFromBytes

func BlobIdentifierFromBytes(b []byte) *BlobIdentifier

func BlobIdentifierFromProto

func BlobIdentifierFromProto(proto *pbPrimitivesV1.BlobIdentifier) *BlobIdentifier

func BlobIdentifierFromString

func BlobIdentifierFromString(encoded string) (*BlobIdentifier, error)

func BlobIdentifierFromURL

func BlobIdentifierFromURL(url string) (*BlobIdentifier, error)

func (*BlobIdentifier) Bytes

func (b *BlobIdentifier) Bytes() []byte

func (*BlobIdentifier) ID

func (b *BlobIdentifier) ID() string

func (*BlobIdentifier) Proto

func (*BlobIdentifier) String

func (b *BlobIdentifier) String() string

func (*BlobIdentifier) URL

func (b *BlobIdentifier) URL() string

type Block

type Block struct {
	Header *BlockHeader
	Body   *BlockBody
}

func BlockFromBytes

func BlockFromBytes(b []byte) *Block

func BlockFromProto

func BlockFromProto(pbBlock *pbRollupV1.Block) *Block

func NewBlock

func NewBlock(dirs []*BlobIdentifier, files []*BlobIdentifier, chunks []*BlobIdentifier) *Block

func NewBlockFromHeader

func NewBlockFromHeader(header *BlockHeader, dirs []*BlobIdentifier, files []*BlobIdentifier, chunks []*BlobIdentifier) *Block

func (*Block) Bytes

func (b *Block) Bytes() []byte

func (*Block) Hash

func (b *Block) Hash() crypto.Hash

func (*Block) Height

func (b *Block) Height() uint64

func (*Block) Proto

func (b *Block) Proto() *pbRollupV1.Block

type BlockBody

type BlockBody struct {
	Dirs   []*BlobIdentifier
	Files  []*BlobIdentifier
	Chunks []*BlobIdentifier
}

func BlockBodyFromBytes

func BlockBodyFromBytes(b []byte) *BlockBody

func BlockBodyFromProto

func BlockBodyFromProto(pbBody *pbRollupV1.BlockBody) *BlockBody

func (*BlockBody) Bytes

func (bb *BlockBody) Bytes() []byte

func (*BlockBody) Proto

func (bb *BlockBody) Proto() *pbRollupV1.BlockBody

type BlockHeader

type BlockHeader struct {
	Version             uint32
	ChainID             string
	Height              uint64
	CelestiaBlockHeight uint64
	Timestamp           time.Time
	ParentHash          crypto.Hash
	DirsRoot            crypto.Hash
	FilesRoot           crypto.Hash
	ChunksRoot          crypto.Hash
	StateRoot           crypto.Hash
}

func BlockHeaderFromBytes

func BlockHeaderFromBytes(b []byte) *BlockHeader

func BlockHeaderFromProto

func BlockHeaderFromProto(pbHeader *pbRollupV1.BlockHeader) *BlockHeader

func CopyBlockHeader

func CopyBlockHeader(bh *BlockHeader) *BlockHeader

func (*BlockHeader) Bytes

func (bh *BlockHeader) Bytes() []byte

func (*BlockHeader) Hash

func (bh *BlockHeader) Hash() crypto.Hash

func (*BlockHeader) Proto

func (bh *BlockHeader) Proto() *pbRollupV1.BlockHeader

func (*BlockHeader) UpdateHashCache added in v0.2.0

func (bh *BlockHeader) UpdateHashCache(hash crypto.Hash)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL