Skip to content
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

Merged
merged 7 commits into from
Oct 22, 2024
Merged

Conversation

aljo242
Copy link
Contributor

@aljo242 aljo242 commented Oct 16, 2024

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.

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 15 lines in your changes missing coverage. Please review.

Project coverage is 57.31%. Comparing base (1d27812) to head (46b8197).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
providers/providertest/provider.go 0.00% 9 Missing ⚠️
oracle/market_mapper.go 81.25% 4 Missing and 2 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

// - 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 {
Copy link
Member

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?

Copy link
Contributor Author

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

@aljo242 aljo242 merged commit f4be9c5 into main Oct 22, 2024
14 checks passed
@aljo242 aljo242 deleted the fix/sidecar-last-updated-fix branch October 22, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants