Closed brejski closed 6 years ago
The PR has some compilation error. But still, merging this will result in rejected txs until tendermint/go-amino#171 is solved.
Blocked on https://github.com/cosmos/cosmos-sdk/issues/1550, we should also sort the top-level fields (chain ID, sequence, ...) for consistency.
In this PR we're adding validation that checks if json dictionaries are all sorted, unit test for that validation and integration with ledger.
If invalid message is sent to be signed, ledger will parse it and reject it returning an error code. Also, in this PR, we've added 2 new messages that have invalid formats to goclient code.
Known issue: It seems that a bog standard message serialized by cosmos is already invalid because its dictionaries are not sorted. If you run goclient.go code, the very first message fails validation. @cwgoes, @jleni have I misunderstood the "dictionary in sorted order" validation or is there a problem in cosmos serialization?
Update: Key sorting validation has been temporarily disabled until Cosmos is updated to serialize with with key sorted.