-
Notifications
You must be signed in to change notification settings - Fork 0
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
Write PHOTWAPOracle Contracts && Tests #44
Conversation
4312995
to
16c64e8
Compare
16c64e8
to
94ce45a
Compare
94ce45a
to
94c5156
Compare
Notes/Comments from Kevin in draft PR #33 outlined here for continued discussion: |
94c5156
to
4885949
Compare
b1bd9b4
to
be9668f
Compare
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.
I only skimmed the tests as I don't have time and we have other higher priorities.
But I went over the code in depth. Please fix all requests.
When we merge this we need to add a TODO to write more tests for this oracle. basically f from what I see, we just copy paste the Solidity into the tests and test the same function against itself. it's not the most useful kind of test.
we could write the tests in another environment.
but more importantly, we need to run a more aggressive test against this oracle, put it in a more realistic scenario, simulate a few hundred deposits and then see if everything is still returning the right price. we'd also have to run tests to push the oracle to its limits (where slippage occurs)
I will address your change requests and add a TODO for more tests within the oracle test file. Are we saying to make the changes requested and submit the oracle code and tests as is though before adding such complex oracle tests? I think the more complicated oracle tests in their own PR is fair. |
e6757ae
to
0bf3406
Compare
I have addressed all requested changes, and opened up appropriate issues for any outstanding tasks outside of the scope of this PR (ex. contingency plans). One carry-over comment / change requested by Kevin was to switch the arrays to single vars. I wonder if there is really much benefit to doing this. I could but just wondering before making the change. ref: #33 (comment) |
0bf3406
to
6347a24
Compare
6347a24
to
e12346f
Compare
Final changes have been made and ready for review. |
e12346f
to
5a400ca
Compare
Write PHOTWAPOracle Contracts && Tests
Core changes:
PHOTWAPOracle
arrangementNotes:
forge test
, essentially tests took way longer than anticipated (or not at all really in full). So I simply runforge test -vvv --match-contract PHOTWAPOracle
Figjam screenshot for visual:
priceUpdateThreshold
is exceeded.USD/PHO
price from adding and removing liquidity are not included in the tests currently, can and will likely address these tomorrow, but these tests as is are good for showcasing basic functionality forPHOTWAPOracle.sol