Skip to content

Commit

Permalink
fix: oracle accept list no longer automatically adds blacklisted toke…
Browse files Browse the repository at this point in the history
…ns (backport #1736) (#1818)
  • Loading branch information
mergify[bot] authored Feb 14, 2023
1 parent 5cc2c0c commit 9b65b8c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Fixes

- [1736](https://github.com/umee-network/umee/pull/1736) Blacklisted tokens no longer add themselves back to the oracle accept list.

## [v4.0.1](https://github.com/umee-network/umee/releases/tag/v4.0.1) - 2023-02-10

- [1800](https://github.com/umee-network/umee/pull/1800) Handle non-capitalized assets when calling the historacle data.

## [v4.0.0](https://github.com/umee-network/umee/releases/tag/v4.0.0) - 2023-01-20
Expand Down
5 changes: 5 additions & 0 deletions x/oracle/keeper/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ func (k Keeper) Hooks() Hooks {
// it checks if the provided Token should be added to the existing accepted list
// of assets for the x/oracle module.
func (h Hooks) AfterTokenRegistered(ctx sdk.Context, token leveragetypes.Token) {
if token.Blacklist {
// Blacklisted tokens should not trigger updates to the oracle accept list
return
}

acceptList := h.k.AcceptList(ctx)

var tokenExists bool
Expand Down
9 changes: 9 additions & 0 deletions x/oracle/keeper/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,13 @@ func (s *IntegrationTestSuite) TestHooks_AfterTokenRegistered() {
Exponent: 6,
})
s.Require().Len(s.app.OracleKeeper.AcceptList(s.ctx), 3)

// require a blacklisted token does not update the accept list
h.AfterTokenRegistered(s.ctx, leveragetypes.Token{
BaseDenom: "unope",
SymbolDenom: "NOPE",
Exponent: 6,
Blacklist: true,
})
s.Require().Len(s.app.OracleKeeper.AcceptList(s.ctx), 3)
}

0 comments on commit 9b65b8c

Please sign in to comment.