This repository has been archived by the owner on Jun 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Feat/add price slot check (In on-chain programs) #16
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jayantk
reviewed
Feb 11, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see inline comment
- Introduces another Price struct which doesn't have comps (published prices) and unused fields. The reason is that we want to mutate struct (to add the check) and Price Account Data has ~3kb so copying is expensive. This creates a significantly smaller one. This naming allow us to have least impact on existing consumers. The price account data is available as price account data if a consumer needs it. - Also make Ema fields public
ali-bahjati
force-pushed
the
feat/add-price-slot-check
branch
from
February 14, 2022 08:14
c9a3200
to
b026932
Compare
ali-bahjati
commented
Feb 14, 2022
jayantk
reviewed
Feb 14, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change generally looks good. I had a couple comments on how to structure things so they're more general / easier for readers to understand. I think there's enough there that I'd like to look at this one more time before approving.
Reisen
reviewed
Feb 15, 2022
jayantk
approved these changes
Feb 15, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but please do address the inline comments before merging.
Reisen
approved these changes
Feb 17, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds
get_current_price_status
to Price struct which returns the current price status. If run on-chain with the current slot it checks whether price information has got stale or not.get_current_price
uses this function to make the interface consistent.Additional changes:
test_instr
for testing tocommon.rs
(as it's used in the test for this feature) and renamed it totest_instr_exex_ok
to be more clear.