Skip to content

Commit

Permalink
fix: remove hard-coded usd rate
Browse files Browse the repository at this point in the history
  • Loading branch information
adamewozniak authored Jan 28, 2022
1 parent 9379f14 commit 8f36f82
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
4 changes: 0 additions & 4 deletions x/oracle/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ func (k Keeper) GetExchangeRate(ctx sdk.Context, symbol string) (sdk.Dec, error)
// GetExchangeRateBase gets the consensus exchange rate of an asset
// in the base denom (e.g. ATOM -> uatom)
func (k Keeper) GetExchangeRateBase(ctx sdk.Context, denom string) (sdk.Dec, error) {
if strings.Contains(strings.ToUpper(denom), types.USDDenom) {
return sdk.OneDec(), nil
}

var symbol string

// Translate the base denom -> symbol
Expand Down
8 changes: 0 additions & 8 deletions x/oracle/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,6 @@ func (s *IntegrationTestSuite) TestSetExchangeRateWithEvent() {
s.Require().Equal(rate, sdk.OneDec())
}

func (s *IntegrationTestSuite) TestGetExchangeRate_USD() {
app, ctx := s.app, s.ctx

rate, err := app.OracleKeeper.GetExchangeRateBase(ctx, "uusd")
s.Require().NoError(err)
s.Require().Equal(rate, sdk.OneDec())
}

func (s *IntegrationTestSuite) TestGetExchangeRate_InvalidDenom() {
app, ctx := s.app, s.ctx

Expand Down

0 comments on commit 8f36f82

Please sign in to comment.