chain

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: Apache-2.0 Imports: 8 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")

	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 {
	// 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