cli: convert coins to smallest unit registered (#7777)

* cli: convert coins to smallest unit registered

fixes: #7623

- test order of decimal operations
- support both int and decimal coins, truncate when normalizing to
  base unit

* Update types/coin_test.go

* Update types/coin_test.go

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Amaury <amaury.martiny@protonmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
yihuang
2020-11-16 11:34:54 +00:00
committed by GitHub
co-authored by Alessio Treglia Amaury mergify[bot]
parent 0d0c9696e8
commit 54201d11e6
17 changed files with 225 additions and 53 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ func TestRandStringOfLength(t *testing.T) {
}
func mustParseCoins(s string) sdk.Coins {
coins, err := sdk.ParseCoins(s)
coins, err := sdk.ParseCoinsNormalized(s)
if err != nil {
panic(err)
}