Skip to content

Conversation

@guibescos
Copy link
Contributor

@guibescos guibescos commented Sep 7, 2022

Sma base implementation. It only implements 30min prices (no confidence).
It is gated by cfg(test) flags while in development.

@guibescos guibescos marked this pull request as ready for review September 7, 2022 17:55
Copy link
Contributor

@jayantk jayantk left a comment

Choose a reason for hiding this comment

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

this looks very solid to me. Pretty much all of the comments are minor except the one about the true which i think should be false.

impl PriceAccountWrapper {
pub fn initialize_time_machine(&mut self) -> Result<(), OracleError> {
// TO DO
#[cfg(test)]
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe comment why this is cfg(test)? I presume you're doing some sort of feature flag thing to keep this code out of the real deployment?

Copy link
Contributor

Choose a reason for hiding this comment

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

fwiw I think a better place for this flag would actually be around the code the resize account code + the code that calls add_price_to_time_machine.

This is fine for this PR though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added some comments. We can definitely gate those two instructions, but there's a test in the python for resizing that would need to get scrapped (the python tests use the production version of the rust binary).

@guibescos
Copy link
Contributor Author

current_epoch_is_valid gets initialized to false now.

Copy link
Contributor

@jayantk jayantk left a comment

Choose a reason for hiding this comment

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

nice!

@guibescos guibescos merged commit 8301f05 into main Sep 12, 2022
@guibescos guibescos deleted the sma3 branch September 12, 2022 20:00
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