warp

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongSourceChainID = errors.New("wrong SourceChainID")
	ErrWrongNetworkID     = errors.New("wrong networkID")
)

Functions

This section is empty.

Types

type BasicSigner

type BasicSigner struct {
	// contains filtered or unexported fields
}

BasicSigner implements Signer for basic warp message signing

func (*BasicSigner) Sign

func (s *BasicSigner) Sign(networkID uint32, sourceChainID ids.ID, payloadBytes []byte) ([]byte, error)

Sign implements the Signer interface

type Message

type Message interface {
	// SourceChainID returns the ID of the chain that sent this message
	SourceChainID() ids.ID

	// ID returns the unique ID of this message
	ID() ids.ID

	// Bytes returns the binary representation of this message
	Bytes() []byte

	// Signature returns the signature interface
	Signature() interface{ NumSigners() (int, error) }
}

Message represents a parsed warp message. This is a minimal interface to avoid import cycles.

type Signer

type Signer interface {
	// Sign returns this node's BLS signature over an unsigned message. If the caller
	// does not have the authority to sign the message, an error will be returned.
	//
	// The message must contain the correct NetworkID and SourceChainID.
	Sign(networkID uint32, sourceChainID ids.ID, payloadBytes []byte) ([]byte, error)
}

Signer defines the interface for signing warp messages. This interface is placed in utils/warp to avoid import cycles.

func NewBasicSigner

func NewBasicSigner(sk bls.Signer, networkID uint32, chainID ids.ID) Signer

NewBasicSigner creates a new BasicSigner

type SignerFactory

type SignerFactory func(sk bls.Signer, networkID uint32, chainID ids.ID) Signer

SignerFactory creates a new Signer instance

Jump to

Keyboard shortcuts

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