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

Co-authored-by: Connor Davis <17688291+PoisonPhang@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
mergify[bot] 2024-01-30 21:53:35 +00:00 committed by GitHub
parent a4bd70895d
commit d2f9634443
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 5 deletions

View File

@ -43,7 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (abci): [#19200](https://github.com/cosmos/cosmos-sdk/pull/19200) Ensure that sdk side ve math matches cometbft
* [#19106](https://github.com/cosmos/cosmos-sdk/pull/19106) Allow empty public keys when setting signatures. Public keys aren't needed for every transaction.
* (baseapp) [#19198](https://github.com/cosmos/cosmos-sdk/pull/19198) Remove usage of pointers in logs in all OE goroutines.
* (baseapp) [#19177](https://github.com/cosmos/cosmos-sdk/pull/19177) Fix baseapp DefaultProposalHandler same-sender non-sequential sequence
* (baseapp) [#19177](https://github.com/cosmos/cosmos-sdk/pull/19177) Fix baseapp DefaultProposalHandler same-sender non-sequential sequence.
## [v0.50.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.3) - 2023-01-15

View File

@ -359,6 +359,14 @@ func GetClientContextFromCmd(cmd *cobra.Command) Context {
// SetCmdClientContext 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 SetCmdClientContext(cmd *cobra.Command, clientCtx Context) error {
cmd.SetContext(context.WithValue(cmd.Context(), ClientContextKey, &clientCtx))
var cmdCtx context.Context
if cmd.Context() == nil {
cmdCtx = context.Background()
} else {
cmdCtx = cmd.Context()
}
cmd.SetContext(context.WithValue(cmdCtx, ClientContextKey, &clientCtx))
return nil
}

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
SIMD_BIN=${SIMD_BIN:=$(which simd 2>/dev/null)}
@ -14,4 +14,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

View File

@ -62,7 +62,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