types

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// MaximumPriceSize defines the maximum size of a price in bytes. This allows
	// up to 32 bytes for the price and 1 byte for the sign (positive/negative).
	MaximumPriceSize = 33

	// NumInjectedTxs is the number of transactions that were injected into
	// the proposal but are not actual transactions. In this case, the oracle
	// info is injected into the proposal but should be ignored by the application.
	NumInjectedTxs = 1

	// OracleInfoIndex is the index of the oracle info in the proposal.
	OracleInfoIndex = 0
)

Variables

This section is empty.

Functions

func RecordLatencyAndStatus

func RecordLatencyAndStatus(
	metrics servicemetrics.Metrics, latency time.Duration, err error, method servicemetrics.ABCIMethod,
)

RecordLatencyAndStatus is used by the ABCI handlers to record their e2e latency, and the status of the request to their corresponding metrics objects.

Types

type CodecError

type CodecError struct {
	Err error
}

CodecError is an error that is returned when a codec fails to marshal or unmarshal a type.

func (CodecError) Error

func (e CodecError) Error() string

func (CodecError) Label

func (e CodecError) Label() string

type MissingCommitInfoError

type MissingCommitInfoError struct{}

MissingCommitInfoError is an error that is returned when a proposal is missing the CommitInfo from the previous height.

func (MissingCommitInfoError) Error

func (e MissingCommitInfoError) Error() string

func (MissingCommitInfoError) Label

func (e MissingCommitInfoError) Label() string

type NilRequestError

type NilRequestError struct {
	Handler servicemetrics.ABCIMethod
}

NilRequestError is an error that is returned when a nil request is given to the handler.

func (NilRequestError) Error

func (e NilRequestError) Error() string

func (NilRequestError) Label

func (e NilRequestError) Label() string

type OracleClient

type OracleClient interface {
	Prices(ctx context.Context, in *servertypes.QueryPricesRequest, opts ...grpc.CallOption) (*servertypes.QueryPricesResponse, error)
}

OracleClient defines the interface that must be fulfilled by the connect client. This interface is utilized by the vote extension handler to fetch prices.

type OracleKeeper

type OracleKeeper interface {
	GetAllCurrencyPairs(ctx context.Context) []connecttypes.CurrencyPair
	SetPriceForCurrencyPair(ctx context.Context, cp connecttypes.CurrencyPair, qp oracletypes.QuotePrice) error
}

OracleKeeper defines the interface that must be fulfilled by the oracle keeper. This interface is utilized by the PreBlock handler to write oracle data to state for the supported assets.

type WrappedHandlerError

type WrappedHandlerError struct {
	Handler servicemetrics.ABCIMethod
	Err     error
}

WrappedHandlerError is an error that is returned when a handler that is wrapped by a Connect ABCI handler returns an error.

func (WrappedHandlerError) Error

func (e WrappedHandlerError) Error() string

func (WrappedHandlerError) Label

func (e WrappedHandlerError) Label() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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