cosmos / cosmjs

The Swiss Army knife to power JavaScript based client solutions ranging from Web apps/explorers over browser extensions to server-side clients like faucets/scrapers.
https://cosmos.github.io/cosmjs/
Apache License 2.0
635 stars 328 forks source link

fix(amino/coin): ibc denoms should be parsable #1536

Closed zakarialounes closed 5 months ago

zakarialounes commented 7 months ago

Applied same regex as https://github.com/cosmos/cosmjs/commit/643bf25a8a5449a00ad8c11bce01b5da6db4f6f4#diff-9136eafb27b821610a184d11b99ace152206c81924606263f9443a75ff2865aeR28.

ps: the commit specifies that it has been merged into main and yet I don't see any changes in version v0.32.2 either via npm or this github repository.

webmaster128 commented 5 months ago

The change you are referring to is for GasPrice.fromString, i.e. parses a single amount+denom pair. parseCoins is different as it is for a list of coins. Here we have the ibc issue as well.

Unfortunately the diff is hard to review and introduces decimal amounts without any additional test. Will close this and add IBC support to parseCoins in a deparate PR.

webmaster128 commented 5 months ago

Done in https://github.com/cosmos/cosmjs/pull/1554. Turns out, import { parseCoins } from "@cosmjs/proto-signing"; had the IBC support already but this used a more advanced version than the @cosmjs/amino one (for historic heasons).