JSON Proto changes

This commit is contained in:
Aleksandr Bezobchuk
2020-03-26 12:46:10 -04:00
parent e4857898c0
commit 6135912e53
20 changed files with 868 additions and 112 deletions
+3 -3
View File
@@ -254,7 +254,7 @@ func PostProcessResponseBare(w http.ResponseWriter, ctx context.CLIContext, body
resp, err = marshaler.MarshalJSON(body)
if ctx.Indent && err == nil {
resp, err = sdk.MarshalIndentFromJSON(resp)
resp, err = codec.MarshalIndentFromJSON(resp)
}
if err != nil {
@@ -299,7 +299,7 @@ func PostProcessResponse(w http.ResponseWriter, ctx context.CLIContext, resp int
result, err = marshaler.MarshalJSON(resp)
if ctx.Indent && err == nil {
result, err = sdk.MarshalIndentFromJSON(result)
result, err = codec.MarshalIndentFromJSON(result)
}
if err != nil {
@@ -312,7 +312,7 @@ func PostProcessResponse(w http.ResponseWriter, ctx context.CLIContext, resp int
output, err := marshaler.MarshalJSON(wrappedResp)
if ctx.Indent && err == nil {
output, err = sdk.MarshalIndentFromJSON(output)
output, err = codec.MarshalIndentFromJSON(output)
}
if err != nil {
+2 -3
View File
@@ -19,7 +19,6 @@ import (
"github.com/cosmos/cosmos-sdk/client/context"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
func TestBaseReq_Sanitize(t *testing.T) {
@@ -210,7 +209,7 @@ func TestProcessPostResponse(t *testing.T) {
expectedNoIndent, err := ctx.Codec.MarshalJSON(respNoIndent)
require.Nil(t, err)
expectedWithIndent, err := sdk.MarshalIndentFromJSON(expectedNoIndent)
expectedWithIndent, err := codec.MarshalIndentFromJSON(expectedNoIndent)
require.Nil(t, err)
// check that negative height writes an error
@@ -416,7 +415,7 @@ func runPostProcessResponse(t *testing.T, ctx context.CLIContext, obj interface{
require.NoError(t, err)
if indent {
marshalled, err = sdk.MarshalIndentFromJSON(marshalled)
marshalled, err = codec.MarshalIndentFromJSON(marshalled)
require.NoError(t, err)
}