-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(simapp/v2): panic with testnet init-files command (#21012)
- Loading branch information
1 parent
d2dc3ee
commit f9f2ad7
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package cmd_test | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"cosmossdk.io/core/transaction" | ||
svrcmd "cosmossdk.io/server/v2" | ||
"cosmossdk.io/simapp/v2" | ||
"cosmossdk.io/simapp/v2/simdv2/cmd" | ||
|
||
"github.com/cosmos/cosmos-sdk/client/flags" | ||
"github.com/cosmos/cosmos-sdk/crypto/keyring" | ||
) | ||
|
||
func TestInitTestFilesCmd(t *testing.T) { | ||
rootCmd := cmd.NewRootCmd[transaction.Tx]() | ||
rootCmd.SetArgs([]string{ | ||
"testnet", // Test the testnet init-files command | ||
"init-files", | ||
fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), // Set keyring-backend to test | ||
}) | ||
|
||
require.NoError(t, svrcmd.Execute(rootCmd, "", simapp.DefaultNodeHome)) | ||
} |