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

refactor: x/oracle: make GetExchangeRateBase more efficient #866

Merged
merged 5 commits into from
May 5, 2022

Conversation

adamewozniak
Copy link
Collaborator

Description

Resolves a small efficiency issue with the GetExchangeRateBase function + will add some tests for it

closes: #865


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added appropriate labels to the PR
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@codecov-commenter
Copy link

codecov-commenter commented May 5, 2022

Codecov Report

Merging #866 (147035c) into main (87cb558) will increase coverage by 0.15%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #866      +/-   ##
==========================================
+ Coverage   50.93%   51.08%   +0.15%     
==========================================
  Files          64       64              
  Lines        9428     9425       -3     
==========================================
+ Hits         4802     4815      +13     
+ Misses       4383     4365      -18     
- Partials      243      245       +2     
Impacted Files Coverage Δ
x/oracle/keeper/keeper.go 84.79% <100.00%> (+7.06%) ⬆️

@adamewozniak
Copy link
Collaborator Author

We should follow up on this in #661 by cleaning up this test file a bit - could be table driven

@adamewozniak adamewozniak marked this pull request as ready for review May 5, 2022 18:03
@adamewozniak adamewozniak requested a review from a team as a code owner May 5, 2022 18:03
@adamewozniak adamewozniak requested a review from a team as a code owner May 5, 2022 18:30
@adamewozniak adamewozniak requested a review from toteki May 5, 2022 19:46
@adamewozniak adamewozniak merged commit d919765 into main May 5, 2022
@adamewozniak adamewozniak deleted the woz/exchange-rate-efficiency branch May 5, 2022 20:24
mergify bot pushed a commit that referenced this pull request May 5, 2022
adamewozniak added a commit that referenced this pull request May 5, 2022
)

(cherry picked from commit d919765)

Co-authored-by: Adam Wozniak <29418299+adamewozniak@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

x/oracle: inefficient computation in GetExchangeRateBase ( RV #20 )
3 participants