pricecache

package
v0.0.0-...-23a414b Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PriceUpdate

type PriceUpdate struct {
	MarketId uint32
	Price    *big.Int
}

type PriceUpdates

type PriceUpdates []PriceUpdate

type PriceUpdatesCache

type PriceUpdatesCache interface {
	SetPriceUpdates(ctx sdk.Context, updates PriceUpdates, txHash []byte)
	GetPriceUpdates() PriceUpdates
	HasValidValues(currTxHash []byte) bool
}

PriceUpdatesCache is an interface that defines the methods for caching price updates Make sure to use this in thread-safe scenarios (e.g., when flow is holding lock on the entire app).

type PriceUpdatesCacheImpl

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

func (*PriceUpdatesCacheImpl) GetPriceUpdates

func (veCache *PriceUpdatesCacheImpl) GetPriceUpdates() PriceUpdates

func (*PriceUpdatesCacheImpl) HasValidValues

func (veCache *PriceUpdatesCacheImpl) HasValidValues(currTxHash []byte) bool

func (*PriceUpdatesCacheImpl) SetPriceUpdates

func (veCache *PriceUpdatesCacheImpl) SetPriceUpdates(
	ctx sdk.Context,
	updates PriceUpdates,
	txHash []byte,
)

Jump to

Keyboard shortcuts

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