Skip to content

Commit

Permalink
Merge branch 'main' into adam/params
Browse files Browse the repository at this point in the history
  • Loading branch information
toteki committed Jul 27, 2022
2 parents 5275615 + a250307 commit c56ddba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions price-feeder/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

- [#1038](https://github.com/umee-network/umee/pull/1038) Adds the option for validators to override API endpoints in our config.
- [#1002](https://github.com/umee-network/umee/pull/1002) Add linting to the price feeder CI.
- [#1170](https://github.com/umee-network/umee/pull/1170) Restrict price feeder quotes to USD, USDT, USDC, ETH, DAI, and BTC.

## [v0.2.4](https://github.com/umee-network/umee/releases/tag/price-feeder%2Fv0.2.4) - 2022-07-14

Expand Down
14 changes: 14 additions & 0 deletions price-feeder/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ var (
// maxDeviationThreshold is the maxmimum allowed amount of standard
// deviations which validators are able to set for a given asset.
maxDeviationThreshold = sdk.MustNewDecFromStr("3.0")

// SupportedQuotes defines a lookup table for which assets we support
// using as quotes.
SupportedQuotes = map[string]struct{}{
DenomUSD: {},
"USDC": {},
"USDT": {},
"DAI": {},
"BTC": {},
"ETH": {},
}
)

type (
Expand Down Expand Up @@ -227,6 +238,9 @@ func ParseConfig(configPath string) (Config, error) {
if strings.ToUpper(cp.Quote) != DenomUSD {
coinQuotes[cp.Quote] = struct{}{}
}
if _, ok := SupportedQuotes[strings.ToUpper(cp.Quote)]; !ok {
return cfg, fmt.Errorf("unsupported quote: %s", cp.Quote)
}

for _, provider := range cp.Providers {
if _, ok := SupportedProviders[provider]; !ok {
Expand Down

0 comments on commit c56ddba

Please sign in to comment.