Skip to content

Commit

Permalink
fix(amino/json): use AminoMarshaler reprType info
Browse files Browse the repository at this point in the history
When checking if `info.IsJSONAnyValueType`, if this type is a
AminoMarshaler, then also check `info.ReprType.IsJSONAnyValueType`.

This prevents a panics that happens during the sanity check phase of
`encodeReflectJSONInterface()` when the type `ConcreteInfo` doesn't match
the JSON structure. For instance, before that fix, that used to happen
with `BigintValue` which is a struct (so expected JSON is `{...}` and
`IsJSONAnyValueType=false`), but is marshaled into a simple string (so
expected JSON is only `"..."`, and `ReprType.IsJSONAnyValueType=true`).
  • Loading branch information
tbruyelle committed Sep 4, 2023
1 parent c4d61e1 commit b2ffe3b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 5,837 deletions.
Loading

0 comments on commit b2ffe3b

Please sign in to comment.