MP-3122 price source checks #302
Merged
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.
Missing checks when adding price source
Description
Add a check in
assert_osmosis_pool_assets
to verify thatdenom
andbase_denom
are different.https://github.com/mars-protocol/red-bank/blob/aab034ea186c37d2df5219e1bb3b85bfb44cbd64/contracts/oracle/osmosis/src/helpers.rs#L10
Check that the denomination is valid.
https://github.com/mars-protocol/red-bank/blob/aab034ea186c37d2df5219e1bb3b85bfb44cbd64/contracts/oracle/osmosis/src/price_source.rs#L374
https://github.com/mars-protocol/red-bank/blob/aab034ea186c37d2df5219e1bb3b85bfb44cbd64/contracts/oracle/osmosis/src/price_source.rs#L392
Impact
A mistake could occur when setting a new price source