osmosis
osmosis copied to clipboard
Using last spot price instead of zero on error in `getSpotPrices`
Closes: #2689
What is the purpose of the change
Refer from #2689 . Instead of updating price=0 if
getSpotPrices
got error as it is. We will update the price with the previous record.
Brief Changelog
-
Update
getSpotPrices
logic - Update related function & test
- Got a special case that needs to be discussed. What if the pair have no previous record? Should spot price = 0( Following this way in my code)
This is not eligible for v12 inclusion
assuming that we're putting this in in the upcoming future releases, I'm wondering if there needs to be migration work needed to be done for the existing twap records?
Nah this wouldn't need a state migration, it'll only affect new records
Thank you for leaving comments. Updated almost them. Also add new test cases and update related tests at TestUpdateRecords
& TestUpdateRecord
I leave some comments to discuss more
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you!