-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup removed oracle feeds #1204
Conversation
x/oracle/keeper/keeper.go
Outdated
return false | ||
}) | ||
// compare | ||
activesToClear := []string{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw, idiomatic is defaulting to the nil: var activesToClear []string
@@ -681,3 +693,123 @@ func TestCalculateTwaps(t *testing.T) { | |||
require.Error(t, err) | |||
require.Equal(t, types.ErrInvalidTwapLookback, err) | |||
} | |||
|
|||
func TestCalculateTwapsWithUnsupportedDenom(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ yay test
@@ -162,5 +162,7 @@ | |||
// reset miss counters of all validators at the last block of slash window | |||
if utils.IsPeriodLastBlock(ctx, params.SlashWindow) { | |||
k.SlashAndResetCounters(ctx) | |||
// Compare vote targets and actives and remove excess feeds | |||
k.RemoveExcessFeeds(ctx) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1204 +/- ##
==========================================
- Coverage 63.40% 63.35% -0.05%
==========================================
Files 257 257
Lines 16694 16726 +32
==========================================
+ Hits 10585 10597 +12
- Misses 5601 5626 +25
+ Partials 508 503 -5
|
Describe your changes and provide context
This ensure that oracle feeds are removed at the end of the oracle slashing window IF the asset is no longer whitelisted. Additionally, it prevents the TWAPs endpoint from serving twaps for denoms that are no longer in the whitelist.
Testing performed to validate your change
Unit tests