Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(simapp): home flag is not respected #18994

Merged
merged 18 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/init-simapp.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

SIMD_BIN=${SIMD_BIN:=$(which simd 2>/dev/null)}

Expand All @@ -15,4 +15,4 @@ $SIMD_BIN init test --chain-id demo
$SIMD_BIN genesis add-genesis-account alice 5000000000stake --keyring-backend test
$SIMD_BIN genesis add-genesis-account bob 5000000000stake --keyring-backend test
$SIMD_BIN genesis gentx alice 1000000stake --chain-id demo
$SIMD_BIN genesis collect-gentxs
$SIMD_BIN genesis collect-gentxs
8 changes: 1 addition & 7 deletions server/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,7 @@ func GetServerContextFromCmd(cmd *cobra.Command) *Context {
// SetCmdServerContext sets a command's Context value to the provided argument.
// If the context has not been set, set the given context as the default.
func SetCmdServerContext(cmd *cobra.Command, serverCtx *Context) error {
v := cmd.Context().Value(ServerContextKey)
if v == nil {
v = serverCtx
}

serverCtxPtr := v.(*Context)
*serverCtxPtr = *serverCtx
cmd.SetContext(context.WithValue(cmd.Context(), ServerContextKey, serverCtx))

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion simapp/simd/cmd/root_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func NewRootCmd() *cobra.Command {
cmd.SetOut(cmd.OutOrStdout())
cmd.SetErr(cmd.ErrOrStderr())

clientCtx = clientCtx.WithCmdContext(cmd.Context())
clientCtx = clientCtx.WithCmdContext(cmd.Context()).WithViper("")
clientCtx, err := client.ReadPersistentCommandFlags(clientCtx, cmd.Flags())
if err != nil {
return err
Expand Down
Loading