Swap to general export command
This commit is contained in:
committed by
rigelrozanski
parent
55c82e44a2
commit
f92e83d2e0
@@ -1,31 +0,0 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/wire" // XXX fix
|
||||
"github.com/cosmos/cosmos-sdk/x/stake"
|
||||
)
|
||||
|
||||
// get the command to export state
|
||||
func GetCmdExport(export func() (stake.GenesisState, error), cdc *wire.Codec) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "export-stake",
|
||||
Short: "Export stake module state as JSON to stdout",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
genesis, err := export()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
output, err := wire.MarshalJSONIndent(cdc, genesis)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(string(output))
|
||||
return nil
|
||||
},
|
||||
}
|
||||
return cmd
|
||||
}
|
||||
Reference in New Issue
Block a user