pricefeed

package
v0.0.0-...-baf6593 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTestMarketPriceUpdates

func GetTestMarketPriceUpdates(n int) (indexPrices []*pricefeedapi.MarketPriceUpdate)

func UpdateIndexPrice

func UpdateIndexPrice(
	t *testing.T,
	ctx sdk.Context,
	tApp *app.App,
	marketId uint32,
	price uint64,
	lastUpdatedTime time.Time,
)

Types

type ExchangeServer

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

func NewExchangeServer

func NewExchangeServer() *ExchangeServer

NewExchangeServer creates a new ExchangeServer that can be used to fake price data from exchanges. This server responds queries for the test exchange built into the pricefeed daemon and for bitfinex. It is appropriate to run locally or on containers.

func (*ExchangeServer) CleanUp

func (p *ExchangeServer) CleanUp() error

CleanUp shuts down the server and validates that it shut down correctly.

func (*ExchangeServer) GetPrice

func (p *ExchangeServer) GetPrice(marketId pricefeed.MarketId) float64

func (*ExchangeServer) SetPrice

func (p *ExchangeServer) SetPrice(marketId pricefeed.MarketId, price float64)

Jump to

Keyboard shortcuts

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