diff --git a/CHANGELOG.md b/CHANGELOG.md index 50a67f431e..b8bcf74801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Fixes + +- [1736](https://github.com/umee-network/umee/pull/1736) Blacklisted tokens no longer add themselves back to the oracle accept list. + ## [v4.0.0](https://github.com/umee-network/umee/releases/tag/v4.0.0) - 2023-01-20 ### API Breaking diff --git a/x/oracle/keeper/hooks.go b/x/oracle/keeper/hooks.go index 2c6d830f70..74cc1c8053 100644 --- a/x/oracle/keeper/hooks.go +++ b/x/oracle/keeper/hooks.go @@ -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 diff --git a/x/oracle/keeper/hooks_test.go b/x/oracle/keeper/hooks_test.go index 3c53592bea..c31ca9c254 100644 --- a/x/oracle/keeper/hooks_test.go +++ b/x/oracle/keeper/hooks_test.go @@ -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) }