osmosis
osmosis copied to clipboard
test(twap): unchecked test result
Background
Result of https://github.com/osmosis-labs/osmosis/blob/main/x/twap/api_test.go#L899-L904 supposedly should be checked, but it is not at the moment (context: https://github.com/osmosis-labs/osmosis/pull/6336#issuecomment-1711432231)
I tried to assert the result of this comparison, it led to a failed test
Suggested Design
- add check that the output is 0 (aka compared values are within error tolerance)
- fix test if it breaks it
Acceptance Criteria
result checked, test passes
@pysel there will always be 95 times in 200 retries that CompareBigDec will not be in range of tolerance with ErrTolerance MultiplicativeTolerance set to SmallestDec, at least that's for my computer. it work fine with MultiplicativeTolerance set to osmomath.SmallestBigDec().Dec() though. My conclusion is we need to loosen the MultiplicativeTolerance and it will pass.