penumbra
penumbra copied to clipboard
test: correctly display denom unit values with round-trip
This bugfix (linked below) needs a unit test.
It can be triggered by having a Metadata object where the list of units is not sorted. The previous code is incorrect on, for instance, the USDC Metadata currently in the Prax registry. That JSON object could be copied into a unit test, which can create a value like "1.234 USDC", parse it, and check that displaying it round trips (because the correct unit is selected).
Originally posted by @hdevalence in https://github.com/penumbra-zone/penumbra/pull/4801#discussion_r1714017078