mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-02 05:16:10 +00:00
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.
This commit is contained in:
+2
-2
@@ -28,8 +28,8 @@ var (
|
||||
)
|
||||
|
||||
type Consensus struct {
|
||||
Block uint64 `json:"block"`
|
||||
App uint64 `json:"app"`
|
||||
Block uint64 `json:"block,string"`
|
||||
App uint64 `json:"app,string"`
|
||||
}
|
||||
|
||||
func (c Consensus) ToProto() tmversion.Consensus {
|
||||
|
||||
Reference in New Issue
Block a user