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"
|
|
|
|
|
2021-06-22 10:49:18 +00:00
|
|
|
"github.com/tharsis/ethermint/app"
|
2022-04-05 15:30:20 +00:00
|
|
|
chibaclonkd "github.com/tharsis/ethermint/cmd/chibaclonkd"
|
2021-04-17 10:00:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestInitCmd(t *testing.T) {
|
2022-04-05 15:30:20 +00:00
|
|
|
rootCmd, _ := chibaclonkd.NewRootCmd()
|
2021-04-17 10:00:07 +00:00
|
|
|
rootCmd.SetArgs([]string{
|
2021-08-17 14:11:26 +00:00
|
|
|
"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
|
2021-08-17 14:11:26 +00:00
|
|
|
fmt.Sprintf("--%s=%s", flags.FlagChainID, "ethermint_9000-1"),
|
2021-04-17 10:00:07 +00:00
|
|
|
})
|
|
|
|
|
2022-04-26 10:39:18 +00:00
|
|
|
err := svrcmd.Execute(rootCmd, chibaclonkd.EnvPrefix, app.DefaultNodeHome)
|
2021-04-17 10:00:07 +00:00
|
|
|
require.NoError(t, err)
|
|
|
|
}
|