-
Notifications
You must be signed in to change notification settings - Fork 50
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
fix: sidecar no longer checks LastUpdated
#800
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #800 +/- ##
==========================================
+ Coverage 56.98% 57.31% +0.33%
==========================================
Files 213 213
Lines 14801 14823 +22
==========================================
+ Hits 8434 8496 +62
+ Misses 5757 5713 -44
- Partials 610 614 +4 ☔ View full report in Codecov by Sentry. |
// - returns false if the market map is not updated | ||
// - returns true and the new market map if the new market map is updated and valid. | ||
func (o *OracleImpl) IsMarketMapValidUpdated(resp *mmtypes.MarketMapResponse) (mmtypes.MarketMap, bool, error) { | ||
if resp == nil { |
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.
Looks like we didn't check for result.Value to be nil before, are we checking it now because we are not sure if it can be nil, or just because we are exposing this as a function?
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.
It should not be nil
if it is returned from x/marketmap
, but since the client is generic, its good to have nil checks in place since this is now a function
Part of CON-1839
This is a sidecar level fix that reverts the check of
LastUpdated
to checking equality of the incoming market map updates.Factor out updating check to
IsMarketMapValidUpdated
which now has testing.The market equality check can be reverted to the LastUpdated check once we are using on-chain logic with this PR.