Enable proto JSON for genesis (#7000)
* Enable proto JSON for genesis * Test fixes * Cleanup * Cleanup * Cleanup * Update CHANGELOG.md * Protogen Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: SaReN <sahithnarahari@gmail.com>
This commit is contained in:
co-authored by
Federico Kunze
SaReN
parent
1744194e71
commit
20c5ee3624
+5
-6
@@ -3,6 +3,7 @@ package server
|
||||
// DONTCOVER
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
@@ -10,9 +11,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
tmtypes "github.com/tendermint/tendermint/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/server/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
@@ -29,9 +28,6 @@ func ExportCmd(appExporter types.AppExporter, defaultNodeHome string) *cobra.Com
|
||||
Use: "export",
|
||||
Short: "Export state to JSON",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
clientCtx := client.GetClientContextFromCmd(cmd)
|
||||
cdc := clientCtx.JSONMarshaler
|
||||
|
||||
serverCtx := GetServerContextFromCmd(cmd)
|
||||
config := serverCtx.Config
|
||||
|
||||
@@ -94,7 +90,10 @@ func ExportCmd(appExporter types.AppExporter, defaultNodeHome string) *cobra.Com
|
||||
},
|
||||
}
|
||||
|
||||
encoded, err := codec.MarshalJSONIndent(cdc, doc)
|
||||
// NOTE: for now we're just using standard JSON marshaling for the root GenesisDoc.
|
||||
// These types are in Tendermint, don't support proto and as far as we know, don't need it.
|
||||
// All of the protobuf/amino state is inside AppState
|
||||
encoded, err := json.MarshalIndent(doc, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user