encoding

package
v0.38.0-preview.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: AGPL-3.0 Imports: 1 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec added in v0.23.2

type Codec interface {
	NewEncoder(w io.Writer) Encoder
	NewDecoder(r io.Reader) Decoder
}

type Decoder added in v0.23.2

type Decoder interface {
	Decode(interface{}) error
}

type Encodable

type Encodable interface {
	Encode() []byte
}

Encodable is a type that defines a canonical encoding.

type Encoder

type Encoder interface {
	Encode(interface{}) error
}

type Marshaler added in v0.23.2

type Marshaler interface {
	// Marshaler marshals a value to bytes.
	//
	// This function returns an error if the value type is not supported by this marshaler.
	Marshal(interface{}) ([]byte, error)

	// Unmarshal unmarshals bytes to a value.
	//
	// This functions returns an error if the bytes do not fit the provided value type.
	Unmarshal([]byte, interface{}) error

	// MustMarshal marshals a value to bytes.
	//
	// This function panics if marshaling fails.
	MustMarshal(interface{}) []byte

	// MustUnmarshal unmarshals bytes to a value.
	//
	// This function panics if decoding fails.
	MustUnmarshal([]byte, interface{})
}

Marshaler marshals and unmarshals values to and from bytes.

type SigType added in v0.26.1

type SigType uint8

SigType is the aggregable signature type.

const (
	SigTypeStaking      SigType = 0
	SigTypeRandomBeacon SigType = 1
)

SigType specifies the role of the signature in the protocol. Both types are aggregatable cryptographic signatures.

  • SigTypeRandomBeacon type is for random beacon signatures.
  • SigTypeStaking is for Hotstuff signatures.

func (SigType) Valid added in v0.26.1

func (t SigType) Valid() bool

Valid returns true if the signature is either SigTypeStaking or SigTypeRandomBeacon else return false

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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