ve_writer

package
v0.0.0-...-41d3419 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VEApplier

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

func NewVEApplier

func NewVEApplier(
	logger log.Logger,
	voteAggregator aggregator.VoteAggregator,
	pricesKeeper VEApplierPricesKeeper,
	ratelimitKeeper VEApplierRatelimitKeeper,
	voteExtensionCodec codec.VoteExtensionCodec,
	extendedCommitCodec codec.ExtendedCommitCodec,
	spotPriceUpdateCache pricecache.PriceUpdatesCache,
	pnlPriceUpdateCache pricecache.PriceUpdatesCache,
	sDaiConversionRateCache bigintcache.BigIntCache,
	vecache *vecache.VeCache,
) *VEApplier

func (*VEApplier) ApplyVE

func (vea *VEApplier) ApplyVE(
	ctx sdk.Context,
	txs [][]byte,
	writeToCache bool,
) error

func (*VEApplier) CacheSeenExtendedVotes

func (vea *VEApplier) CacheSeenExtendedVotes(
	ctx sdk.Context,
	req *abci.RequestCommit,
) error

func (*VEApplier) CheckCacheHasValidValues

func (vea *VEApplier) CheckCacheHasValidValues(
	ctx sdk.Context,
	txHash []byte,
) bool

func (*VEApplier) GetCachedPnlPrices

func (vea *VEApplier) GetCachedPnlPrices() pricecache.PriceUpdates

func (*VEApplier) GetCachedSDaiConversionRate

func (vea *VEApplier) GetCachedSDaiConversionRate() *big.Int

func (*VEApplier) GetCachedSpotPrices

func (vea *VEApplier) GetCachedSpotPrices() pricecache.PriceUpdates

func (*VEApplier) GetPnlPriceUpdateCache

func (vea *VEApplier) GetPnlPriceUpdateCache() pricecache.PriceUpdatesCache

func (*VEApplier) GetSDaiConversionRateCache

func (vea *VEApplier) GetSDaiConversionRateCache() bigintcache.BigIntCache

func (*VEApplier) GetSpotPriceUpdateCache

func (vea *VEApplier) GetSpotPriceUpdateCache() pricecache.PriceUpdatesCache

func (*VEApplier) GetTxsHash

func (vea *VEApplier) GetTxsHash(txs [][]byte) []byte

func (*VEApplier) GetVECache

func (vea *VEApplier) GetVECache() *vecache.VeCache

func (*VEApplier) VoteAggregator

func (vea *VEApplier) VoteAggregator() aggregator.VoteAggregator

func (*VEApplier) WritePricesToStoreAndMaybeCache

func (vea *VEApplier) WritePricesToStoreAndMaybeCache(
	ctx sdk.Context,
	prices map[string]voteweighted.AggregatorPricePair,
	txHash []byte,
	writeToCache bool,
) error

func (*VEApplier) WriteSDaiConversionRateToStoreAndMaybeCache

func (vea *VEApplier) WriteSDaiConversionRateToStoreAndMaybeCache(
	ctx sdk.Context,
	sDaiConversionRate *big.Int,
	txHash []byte,
	writeToCache bool,
) error

type VEApplierPricesKeeper

type VEApplierPricesKeeper interface {
	PerformStatefulPriceUpdateValidation(
		ctx sdk.Context,
		marketPriceUpdates *types.MarketPriceUpdate,
	) (isSpotValid bool, isPnlValid bool)

	GetAllMarketParams(ctx sdk.Context) []types.MarketParam

	UpdateSpotAndPnlMarketPrices(
		ctx sdk.Context,
		update *types.MarketPriceUpdate,
	) error

	UpdateSpotPrice(
		ctx sdk.Context,
		update *types.MarketSpotPriceUpdate,
	) error

	UpdatePnlPrice(
		ctx sdk.Context,
		update *types.MarketPnlPriceUpdate,
	) error

	GetMarketParam(
		ctx sdk.Context,
		id uint32,
	) (
		market types.MarketParam,
		exists bool,
	)
}

type VEApplierRatelimitKeeper

type VEApplierRatelimitKeeper interface {
	ProcessNewSDaiConversionRateUpdate(ctx sdk.Context, sDaiConversionRate *big.Int, blockHeight *big.Int) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳