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 staleness indicator to exchange rate store #17

Merged
merged 3 commits into from
May 31, 2022

Conversation

udpatil
Copy link
Collaborator

@udpatil udpatil commented May 26, 2022

Still a work in progress, most of the business logic is complete though.

@udpatil udpatil requested review from philipsu522, codchen and LCyson May 26, 2022 22:18
if denom == utils.MicroBaseDenom {
return sdk.OneDec(), nil
return sdk.OneDec(), sdk.ZeroInt(), nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

it might be easier for this to be set as the latest period-end block so that callers can handle base vs. non-base denom exchange rates consistently. Something like ctx.BlockHeight() / votePeriod * votePeriod. (would also make the eventual switch of base denom to sei easier)

@udpatil udpatil force-pushed the oracle-staleness branch from 21d6214 to 153da1d Compare May 27, 2022 22:12
sdk "github.com/cosmos/cosmos-sdk/types"
)

func TestMigrate2to3(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 - this is an awesome test

@udpatil udpatil merged commit 243af7c into master May 31, 2022
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