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

[oracle] add timestamp to oracle exchange rates #1073

Merged
merged 3 commits into from
Sep 28, 2023
Merged

Conversation

udpatil
Copy link
Collaborator

@udpatil udpatil commented Sep 27, 2023

Describe your changes and provide context

This adds last_update_timestamp to the data stored for exchange rates. This allows for calculating stalesness of oracle prices based on timestamp for use by smart contracts.

For this change, no migration is necessary because we don't have the tiemstamps of previously updated oracle prices available, and the timestamp will only be present as 0 for one oracle window prior to the next oracle update. There won't yet be contracts reading that values until after the timestamps have been established.

Testing performed to validate your change

Updated unit tests + verified compatibility for existing cosmwasm version + verified compatibility with updated sei-cosmwasm struct to have the timestamp field.

@udpatil udpatil changed the title add timestamp to oracle exchange rates [oracle] add timestamp to oracle exchange rates Sep 27, 2023
@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

Merging #1073 (2744f68) into main (4fdcf14) will increase coverage by 0.22%.
The diff coverage is 69.23%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1073      +/-   ##
==========================================
+ Coverage   63.41%   63.64%   +0.22%     
==========================================
  Files         256      256              
  Lines       16593    16597       +4     
==========================================
+ Hits        10523    10563      +40     
+ Misses       5567     5530      -37     
- Partials      503      504       +1     
Files Coverage Δ
x/oracle/keeper/keeper.go 94.58% <100.00%> (+0.01%) ⬆️
x/oracle/keeper/querier.go 58.76% <100.00%> (+0.86%) ⬆️
x/oracle/types/vote.go 35.08% <0.00%> (-0.63%) ⬇️

... and 3 files with indirect coverage changes

@udpatil udpatil merged commit 4604460 into main Sep 28, 2023
36 checks passed
@udpatil udpatil deleted the oracle-exchange-rate-ts branch September 28, 2023 16:28
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