refactor(client): add client/Context.Codec and deprecate JSONCodec (#9498)

* chore(types): add sdk.Context.Codec and deprecate JSONCodec

* Use clientContext.Codec rather than JSONCodec everywhere

* update tests to use clientContext.Codec

* added a note that EncodingConfig.Marshaler will be renamed to Codec

* update changelog

* fix tests to use clientCtx.WithCodec instead of WithJSONCodec

* fix genutil build

* Update simapp/params/encoding.go

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
This commit is contained in:
Robert Zaremba
2021-06-11 11:49:39 +00:00
committed by GitHub
co-authored by Amaury
parent 606bb2f46d
commit 7bca49e2d2
63 changed files with 222 additions and 203 deletions
+2 -2
View File
@@ -39,7 +39,7 @@ func TestGetCommandEncode(t *testing.T) {
ctx := context.Background()
clientCtx := client.Context{}.
WithTxConfig(encodingConfig.TxConfig).
WithJSONCodec(encodingConfig.Marshaler)
WithCodec(encodingConfig.Marshaler)
ctx = context.WithValue(ctx, client.ClientContextKey, &clientCtx)
cmd.SetArgs([]string{txFileName})
@@ -52,7 +52,7 @@ func TestGetCommandDecode(t *testing.T) {
clientCtx := client.Context{}.
WithTxConfig(encodingConfig.TxConfig).
WithJSONCodec(encodingConfig.Marshaler)
WithCodec(encodingConfig.Marshaler)
cmd := GetDecodeCommand()
_ = testutil.ApplyMockIODiscardOutErr(cmd)