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

feat(oracle): add timestamp to exchange rates #2254

Merged
merged 19 commits into from
Sep 27, 2023
Merged

Conversation

gsk967
Copy link
Collaborator

@gsk967 gsk967 commented Sep 19, 2023

Description

closes: #XXXX


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 ! to the type prefix if API or client breaking change
  • added appropriate labels to the PR
  • 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 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)

@gsk967 gsk967 requested review from a team as code owners September 19, 2023 14:26
x/oracle/types/asset.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Merging #2254 (674b917) into main (7f05ad4) will decrease coverage by 4.89%.
Report is 245 commits behind head on main.
The diff coverage is 83.60%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2254      +/-   ##
==========================================
- Coverage   75.38%   70.50%   -4.89%     
==========================================
  Files         100      169      +69     
  Lines        8025    12735    +4710     
==========================================
+ Hits         6050     8979    +2929     
- Misses       1589     3155    +1566     
- Partials      386      601     +215     
Files Coverage Δ
ante/ante.go 66.66% <100.00%> (+18.45%) ⬆️
ante/fee.go 80.00% <100.00%> (+1.64%) ⬆️
ante/spam_prevention.go 75.92% <ø> (ø)
app/inflation/inflation.go 100.00% <100.00%> (ø)
util/coin/utoken.go 100.00% <100.00%> (ø)
x/incentive/client/tests/suite.go 100.00% <100.00%> (ø)
x/incentive/client/tests/tests.go 100.00% <100.00%> (ø)
x/incentive/codec.go 47.82% <ø> (+9.89%) ⬆️
x/incentive/genesis.go 92.48% <100.00%> (+79.14%) ⬆️
x/incentive/keeper/bond.go 92.50% <ø> (ø)
... and 48 more

... and 89 files with indirect coverage changes

Copy link
Member

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first quick review

app/test_helpers.go Show resolved Hide resolved
proto/umee/oracle/v1/oracle.proto Show resolved Hide resolved
x/oracle/abci.go Outdated Show resolved Hide resolved
@gsk967 gsk967 enabled auto-merge September 21, 2023 12:46
Copy link
Member

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As noted in the previous review you only need new type for Genesis.
So, instead of changing ExchangeRate, keep it as is, and don't change Set/GetExchange rate. Instead, as you did in the latest version, use DenomExchangeRate (and add denom there) for Genesis.

x/oracle/types/exchange_rates.go Show resolved Hide resolved
x/oracle/keeper/keeper.go Outdated Show resolved Hide resolved
x/oracle/types/exchange_rates.go Outdated Show resolved Hide resolved
auto-merge was automatically disabled September 21, 2023 13:50

Merge queue setting changed

@gsk967 gsk967 enabled auto-merge September 22, 2023 13:18
x/oracle/keeper/keeper.go Outdated Show resolved Hide resolved
x/oracle/keeper/keeper.go Outdated Show resolved Hide resolved
Copy link
Member

@toteki toteki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left comments - my main concerns are codec usage and making sure we don't accidentally mess with upper/lower case in a way that needs a migration or affects mainnet

@gsk967
Copy link
Collaborator Author

gsk967 commented Sep 24, 2023

Left comments - my main concerns are codec usage and making sure we don't accidentally mess with upper/lower case in a way that needs a migration or affects mainnet

I did not use codec for ExchangeRate because it is only just go struct and I revert the UMEE to umee in defaultParams

@gsk967 gsk967 requested a review from toteki September 24, 2023 13:59
Copy link
Member

@toteki toteki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check comments - other than that I have no more issues

@gsk967 gsk967 added this pull request to the merge queue Sep 27, 2023
Merged via the queue into main with commit 498bd30 Sep 27, 2023
25 of 26 checks passed
@gsk967 gsk967 deleted the sai/failover_prices branch September 27, 2023 09:38
facundomedica pushed a commit that referenced this pull request Oct 30, 2023
* add timestamp to denom price

* address the first review comments

* add SetExchangeRateWithTimestamp func

* storing rate and timestamp without denom into exg rates

* renamed ExchangeRate to DenomExchangeRate on oracle genesis
 and using ExchangeRate for return types on oracle

* address the review comments

* add some tests and cli query for getting timestamps of exgrates

* add tests to cli and grpc exg rates with timestamp req

* fix the tests on oracle

* fix the tests

---------

Co-authored-by: Adam Moser <63419657+toteki@users.noreply.github.com>
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.

3 participants