laconicd-deprecated/cmd/laconicd/cmd_test.go

29 lines
754 B
Go
Raw Permalink Normal View History

2021-04-17 10:00:07 +00:00
package main_test
import (
"fmt"
"testing"
"github.com/stretchr/testify/require"
"github.com/cosmos/cosmos-sdk/client/flags"
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
"github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
"github.com/cerc-io/laconicd/app"
laconicd "github.com/cerc-io/laconicd/cmd/laconicd"
2021-04-17 10:00:07 +00:00
)
func TestInitCmd(t *testing.T) {
rootCmd, _ := laconicd.NewRootCmd()
2021-04-17 10:00:07 +00:00
rootCmd.SetArgs([]string{
"init", // Test the init cmd
"etherminttest", // Moniker
2021-04-17 10:00:07 +00:00
fmt.Sprintf("--%s=%s", cli.FlagOverwrite, "true"), // Overwrite genesis.json, in case it already exists
fmt.Sprintf("--%s=%s", flags.FlagChainID, "ethermint_9000-1"),
2021-04-17 10:00:07 +00:00
})
2022-10-10 10:38:33 +00:00
err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome)
2021-04-17 10:00:07 +00:00
require.NoError(t, err)
}