From 478eda1f7e3e3bdb3a47c01871b30770eae9fd04 Mon Sep 17 00:00:00 2001 From: Alexander Bezobchuk Date: Mon, 5 Aug 2019 12:42:34 -0400 Subject: [PATCH] Merge PR #4846: Add RegisterEvidences --- .pending/features/_4843-Add-RegisterEv | 2 ++ codec/codec.go | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .pending/features/_4843-Add-RegisterEv diff --git a/.pending/features/_4843-Add-RegisterEv b/.pending/features/_4843-Add-RegisterEv new file mode 100644 index 0000000000..17ad66e6a4 --- /dev/null +++ b/.pending/features/_4843-Add-RegisterEv @@ -0,0 +1,2 @@ +#4843 Add RegisterEvidences function in the codec package to register +Tendermint evidence types with a given codec. diff --git a/codec/codec.go b/codec/codec.go index 5e8f94d194..048a9cca44 100644 --- a/codec/codec.go +++ b/codec/codec.go @@ -5,8 +5,9 @@ import ( "encoding/json" "fmt" - amino "github.com/tendermint/go-amino" - cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino" + "github.com/tendermint/go-amino" + cryptoamino "github.com/tendermint/tendermint/crypto/encoding/amino" + tmtypes "github.com/tendermint/tendermint/types" ) // amino codec to marshal/unmarshal @@ -18,7 +19,12 @@ func New() *Codec { // Register the go-crypto to the codec func RegisterCrypto(cdc *Codec) { - cryptoAmino.RegisterAmino(cdc) + cryptoamino.RegisterAmino(cdc) +} + +// RegisterEvidences registers Tendermint evidence types with the provided codec. +func RegisterEvidences(cdc *Codec) { + tmtypes.RegisterEvidences(cdc) } // attempt to make some pretty json @@ -54,5 +60,6 @@ var Cdc *Codec func init() { cdc := New() RegisterCrypto(cdc) + RegisterEvidences(cdc) Cdc = cdc.Seal() }