-
Notifications
You must be signed in to change notification settings - Fork 12
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
Task/oracle test #170
Task/oracle test #170
Conversation
e97662c
to
59aff6c
Compare
await oracle.setAssetToCtoken(bat.address, cBat.address); | ||
|
||
// update compound oracle price for BAT | ||
const batPrice = '777857500000000'; |
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.
Is it possible to use ganache fork for this and also test with mainnet data? (Also these tests will probs change since we need to use a different oracle now right?)
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 is the data I copied from mainnet, for unit tests I think it's okay that we just hardcode the value, because we don't have existing cicd workflow to run ganache fork now.
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.
Looks good to me. It would also be good to test on ganache fork and pull mainnet data if we can, just so we don't mock too much of the data and we know for sure the math calculations we did make sense :)
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.
Contract Changes
CompoundOracleInterface
andOracleInterface
:CompoundOracleInterface
is the oneOracle.sol
use to interact with compound v1 oracle, andOracleInterface
is just the interface forOracle.sol
MockCompoundOracle
andMockOracle
accordingly, useMockCompoundOracle
inOracle
's unit test.OptionsContract.sol
fromcompoundOracle
tooracle
OptionExchange
inOptionsContract
, declare that variable inOtoken
, which is the only one using it.