common

package
v0.85.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 1 Imported by: 9

Documentation

Overview

The common package contains types used by multiple mini-protocols

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Point

type Point struct {
	Slot uint64
	Hash []byte
	// contains filtered or unexported fields
}

The Point type represents a point on the blockchain. It consists of a slot number and block hash

func NewPoint

func NewPoint(slot uint64, blockHash []byte) Point

NewPoint returns a Point object with the specified slot number and block hash

func NewPointOrigin

func NewPointOrigin() Point

NewPointOrigin returns an "empty" Point object which represents the origin of the blockchain

func (*Point) MarshalCBOR

func (p *Point) MarshalCBOR() ([]byte, error)

MarshalCBOR is a helper function for encoding a Point object to CBOR. The object content can vary, so we need to do some special handling when encoding. It is not intended to be called directly.

func (*Point) UnmarshalCBOR

func (p *Point) UnmarshalCBOR(data []byte) error

UnmarshalCBOR is a helper function for decoding a Point object from CBOR. The object content can vary, so we need to do some special handling when decoding. It is not intended to be called directly.

Jump to

Keyboard shortcuts

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