Author | SHA1 | Message | Date |
---|---|---|---|
M. J. Fromberger |
f9c6cc9306
|
rpc: use encoding/json rather than tmjson (#7670)
The main change here is to use encoding/json to encode and decode RPC parameters, rather than the custom tmjson package. This includes: - Update the HTTP POST handler parameter handling. - Add field tags to 64-bit integer types to get string encoding (to match amino/tmjson). - Add marshalers to struct types that mention interfaces. - Inject wrappers to decode interface arguments in RPC handlers. |
3 years ago |
M. J. Fromberger |
72c2e6a5b8
|
jsontypes: improve tests and error diagnostics (#7669)
Avert panics for corner cases (e.g., nil pointers) and for implementations that reside only on the pointer type. Add documentation and tests. |
3 years ago |
M. J. Fromberger |
dbe2146d0a
|
rpc: simplify the encoding of interface-typed arguments in JSON (#7600)
Add package jsontypes that implements a subset of the custom libs/json package. Specifically it handles encoding and decoding of interface types wrapped in "tagged" JSON objects. It omits the deep reflection on arbitrary types, preserving only the handling of type tags wrapper encoding. - Register interface types (Evidence, PubKey, PrivKey) for tagged encoding. - Update the existing implementations to satisfy the type. - Register those types with the jsontypes registry. - Add string tags to 64-bit integer fields where needed. - Add marshalers to structs that export interface-typed fields. |
3 years ago |