chain

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrSignatureVerificationFailed              = whoops.String("signature verification failed")
	ErrSignatureDoesNotMatchItsRespectiveSigner = whoops.String("signature does not match its respective signer")
	ErrTooLittleOrTooManySignaturesProvided     = whoops.String("too many or too little signatures provided")
	ErrProcessorDoesNotSupportThisQueue         = whoops.Errorf("processor does not support queue: %s")

	ErrNotFound = whoops.String("not found")

	ErrNotConnectedToRightChain = whoops.String("not connected to the right chain")

	ErrMissingAccount    = whoops.Errorf("missing account for chain %s")
	ErrAccountBalanceLow = whoops.Errorf("account balance %s for account %s (%s) is lower than minimum allowed balance")

	EnrichedChainReferenceID whoops.Field[string] = "chainReferenceID"
	EnrichedID               whoops.Field[uint64] = "id"
	EnrichedItemType         whoops.Field[string] = "type"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainInfo

type ChainInfo interface {
	ChainReferenceID() string
	ChainID() string
	ChainType() string
}

type ExternalAccount

type ExternalAccount struct {
	ChainType        string
	ChainReferenceID string

	Address string
	PubKey  []byte
}

type LensClient

type LensClient struct {
	lens.ChainClient
}

func NewChainClient

func NewChainClient(ccc *lens.ChainClientConfig, input io.Reader, output io.Writer, kro ...keyring.Option) (*LensClient, error)

func (*LensClient) Init

func (cc *LensClient) Init() error

type MessageToProcess

type MessageToProcess struct {
	QueueTypeName string
	Msg           QueuedMessage
}

type MessageWithSignatures

type MessageWithSignatures struct {
	QueuedMessage
	Signatures []ValidatorSignature
}

type Processor

type Processor interface {
	health.Checker
	// SupportedQueues is a list of consensus queues that this processor supports and expects to work with.
	SupportedQueues() []string

	ExternalAccount() ExternalAccount

	// SignMessages takes a list of messages and signs them via their key.
	SignMessages(ctx context.Context, queueTypeName string, messages ...QueuedMessage) ([]SignedQueuedMessage, error)

	// ProcessMessages will receive messages from the current queues and it's on the implementation
	// to ensure that there are enough signatures for consensus.
	ProcessMessages(context.Context, string, []MessageWithSignatures) error

	// ProvideEvidence takes a queue name and a list of messages that have already been executed. This
	// takes the "public evidence" from the message and gets the information back to the Paloma.
	ProvideEvidence(context.Context, string, []MessageWithSignatures) error

	// it verifies if it's being connected to the right chain
	IsRightChain(ctx context.Context) error
}

type ProcessorBuilder

type ProcessorBuilder interface {
	Build(ChainInfo) (Processor, error)
}

type QueuedMessage

type QueuedMessage struct {
	ID               uint64
	Nonce            []byte
	BytesToSign      []byte
	PublicAccessData []byte
	Msg              any
}

type SignedQueuedMessage

type SignedQueuedMessage struct {
	QueuedMessage
	Signature       []byte
	SignedByAddress string
}

type ValidatorSignature

type ValidatorSignature struct {
	ValAddress      sdk.ValAddress
	Signature       []byte
	SignedByAddress string
	PublicKey       []byte
}

Directories

Path Synopsis
evm
collision
Zero collision strategy ensures that all pigeons are using the same way of determinig if they can execute a message or not.
Zero collision strategy ensures that all pigeons are using the same way of determinig if they can execute a message or not.

Jump to

Keyboard shortcuts

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