Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FailingMockProvider ¶
type FailingMockProvider struct {
*StaticMockProvider
}
FailingMockProvider defines a mocked exchange rate provider that always fails when fetching prices.
func NewFailingMockProvider ¶
func NewFailingMockProvider() *FailingMockProvider
NewFailingMockProvider returns a new failing mock provider.
func (FailingMockProvider) GetPrices ¶
func (p FailingMockProvider) GetPrices(_ context.Context) (map[oracletypes.CurrencyPair]types.QuotePrice, error)
GetPrices always fails for the failing mock provider.
func (FailingMockProvider) Name ¶
func (p FailingMockProvider) Name() string
Name returns the name of the failing mock provider.
type StaticMockProvider ¶
type StaticMockProvider struct {
// contains filtered or unexported fields
}
StaticMockProvider defines a mocked exchange rate provider using fixed exchange rates.
func NewStaticMockProvider ¶
func NewStaticMockProvider() *StaticMockProvider
NewStaticMockProvider returns a new mock provider. The mock provider will always return the same static data. Meant to be used for testing.
func (StaticMockProvider) GetPairs ¶
func (p StaticMockProvider) GetPairs() []oracletypes.CurrencyPair
GetPairs is a no-op for the mock provider.
func (StaticMockProvider) GetPrices ¶
func (p StaticMockProvider) GetPrices(_ context.Context) (map[oracletypes.CurrencyPair]types.QuotePrice, error)
GetPrices returns the mocked exchange rates.
func (StaticMockProvider) Name ¶
func (p StaticMockProvider) Name() string
Name returns the name of the mock provider.
func (StaticMockProvider) SetPairs ¶
func (p StaticMockProvider) SetPairs(_ ...oracletypes.CurrencyPair)
SetPairs is a no-op for the mock provider.
type TimeoutMockProvider ¶
type TimeoutMockProvider struct { *StaticMockProvider // contains filtered or unexported fields }
TimeoutMockProvider defines a mocked exchange rate provider that always times out when fetching prices.
func NewTimeoutMockProvider ¶
func NewTimeoutMockProvider(timeout time.Duration) *TimeoutMockProvider
NewTimeoutMockProvider returns a new timeout mock provider.
func (TimeoutMockProvider) GetPrices ¶
func (p TimeoutMockProvider) GetPrices(_ context.Context) (map[oracletypes.CurrencyPair]types.QuotePrice, error)
GetPrices always times out for the timeout mock provider.
func (TimeoutMockProvider) Name ¶
func (p TimeoutMockProvider) Name() string
Name returns the name of the timeout mock provider.