cosmwasm
cosmwasm copied to clipboard
Discussion: JSON formatted Numbers Are Different Form in uint64 vs uint128
In JSON used in cosmwasm, uint64
is formatted as the number, and uint128
(in coin, for example) is formatted as the string. I think it is a little confusing.
How they are formatted in JSON should be unified in my intuition. But, it may be a problem with the max number of JSON (JS). The max integer JS can use is 2^53 -1 (I don't know why we can use uint64
as the number...).
The cosmos-sdk also uses 64 bit integer as string.
https://github.com/tendermint/go-amino/blob/master/json-encode.go#L103-L109
I'm not sure in the stargate version.