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

Fallback mechanism for oracle priority #118

Merged
merged 18 commits into from
Aug 26, 2024
Merged

Fallback mechanism for oracle priority #118

merged 18 commits into from
Aug 26, 2024

Conversation

Braqzen
Copy link
Contributor

@Braqzen Braqzen commented Jul 2, 2024

Changes

  • Rename MockOracle to Oracle
  • Introduce 2 mock oracle interfaces that mostly align with what this integration will use
    • Mocked pyth, with some testing setup too
    • Mocked redstone, with some testing setup too
  • Updated existing tests to pass while using the new oracle
  • Best effort update to deployment and other areas that may have touched the oracle but it's incompatible with beta-5 version (12 breaking versions ahead) so it's untested
  • Code uses forc 61.2
  • Oracle tests
  • Mocked oracles aren't tested themselves since they don't need to be, shouldn't be and the oracle itself is tested
  • Any code added has followed the codebase pattern rather than rewriting the structure

Closes #117

@Braqzen Braqzen added the enhancement New feature or request label Jul 2, 2024
@Braqzen Braqzen self-assigned this Jul 2, 2024
@Braqzen Braqzen requested a review from diyahir August 22, 2024 15:10
@Braqzen Braqzen marked this pull request as ready for review August 22, 2024 15:10
Copy link
Member

@diyahir diyahir left a comment

Choose a reason for hiding this comment

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

Mostly looks good, there are some file names that are outdated still using mock in front of the oracle

and then there's the issue with the assumed oracle precision which needs to be accounted for in the actual oracle implementation

contracts/borrow-operations-contract/src/main.sw Outdated Show resolved Hide resolved
contracts/mock-oracle-contract/src/main.sw Outdated Show resolved Hide resolved
contracts/mock-oracle-contract/src/main.sw Outdated Show resolved Hide resolved
contracts/mock-oracle-contract/tests/harness.rs Outdated Show resolved Hide resolved
libraries/src/mock_oracle_interface.sw Outdated Show resolved Hide resolved
contracts/mock-oracle-contract/src/main.sw Outdated Show resolved Hide resolved
contracts/mock-oracle-contract/tests/harness.rs Outdated Show resolved Hide resolved
@Braqzen Braqzen requested a review from diyahir August 23, 2024 15:37
libraries/src/fluid_math.sw Outdated Show resolved Hide resolved
contracts/oracle-contract/tests/harness.rs Show resolved Hide resolved
@Braqzen Braqzen requested a review from diyahir August 26, 2024 13:00
Copy link
Member

@diyahir diyahir left a comment

Choose a reason for hiding this comment

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

Code is inverted, all tests are wrongly formed

libraries/src/fluid_math.sw Outdated Show resolved Hide resolved
libraries/src/fluid_math.sw Outdated Show resolved Hide resolved
libraries/src/fluid_math.sw Outdated Show resolved Hide resolved
libraries/src/fluid_math.sw Outdated Show resolved Hide resolved
contracts/oracle-contract/tests/harness.rs Outdated Show resolved Hide resolved
@diyahir diyahir merged commit dac9157 into main Aug 26, 2024
@Braqzen Braqzen deleted the braqzen-117 branch August 26, 2024 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fallback mechanism for oracle priority
2 participants