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:
@@ -135,7 +135,7 @@ func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, *t
|
||||
serverCtx := server.NewDefaultContext()
|
||||
serverCtx.Config.RootDir = tempDir
|
||||
|
||||
clientCtx := client.Context{}.WithJSONCodec(app.AppCodec())
|
||||
clientCtx := client.Context{}.WithCodec(app.AppCodec())
|
||||
genDoc := newDefaultGenesisDoc(encCfg.Marshaler)
|
||||
|
||||
require.NoError(t, saveGenesisFile(genDoc, serverCtx.Config.GenesisFile()))
|
||||
|
||||
+1
-1
@@ -347,7 +347,7 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App
|
||||
Retries: config.Rosetta.Retries,
|
||||
Offline: offlineMode,
|
||||
}
|
||||
conf.WithCodec(clientCtx.InterfaceRegistry, clientCtx.JSONCodec.(*codec.ProtoCodec))
|
||||
conf.WithCodec(clientCtx.InterfaceRegistry, clientCtx.Codec.(*codec.ProtoCodec))
|
||||
|
||||
rosettaSrv, err = rosetta.ServerFromConfig(conf)
|
||||
if err != nil {
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ func ShowValidatorCmd() *cobra.Command {
|
||||
return err
|
||||
}
|
||||
clientCtx := client.GetClientContextFromCmd(cmd)
|
||||
bz, err := clientCtx.JSONCodec.MarshalInterfaceJSON(sdkPK)
|
||||
bz, err := clientCtx.Codec.MarshalInterfaceJSON(sdkPK)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user