Skip to content

Commit

Permalink
fix unsupported sign-mode issue (backport #8728) (#8750)
Browse files Browse the repository at this point in the history
* fix unsupported sign-mode issue (#8728)

* fix unsupported sign-mode issue

* update changelog

---------

Co-authored-by: PaddyMc <[email protected]>
(cherry picked from commit 502f559)

# Conflicts:
#	CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: Marri Harish <[email protected]>
Co-authored-by: PaddyMc <[email protected]>
  • Loading branch information
3 people authored Oct 2, 2024
1 parent d20b42d commit 3a19be9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#8563](https://github.com/osmosis-labs/osmosis/pull/8563) Add additional queries in x/gauges
* [#8726](https://github.com/osmosis-labs/osmosis/pull/8726) fix: multiple temp directories on command executions
* [#8731](https://github.com/osmosis-labs/osmosis/pull/8731) fix: in place testnet logs
* [#8728](https://github.com/osmosis-labs/osmosis/pull/8728) fix unsupported sign-mode issue
* [#8743](https://github.com/osmosis-labs/osmosis/pull/8743) chore: bump sdk and cometbft

## v26.0.1

### State Machine Breaking

* [#8732](https://github.com/osmosis-labs/osmosis/pull/8732) fix: iterate delegations continue instead of erroring

## v26.0.0

### State Breaking
Expand Down
25 changes: 25 additions & 0 deletions cmd/osmosisd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"cosmossdk.io/core/appmodule"
runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services"
authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec"
"github.com/cosmos/cosmos-sdk/x/auth/tx"

cosmosdb "github.com/cosmos/cosmos-db"

Expand Down Expand Up @@ -61,7 +62,9 @@ import (
servertypes "github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
authtxconfig "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/crisis"
Expand Down Expand Up @@ -389,6 +392,24 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
return err
}

// This needs to go after ReadFromClientConfig, as that function
// sets the RPC client needed for SIGN_MODE_TEXTUAL. This sign mode
// is only available if the client is online.
if !initClientCtx.Offline {
txConfigOpts := tx.ConfigOptions{
EnabledSignModes: append(tx.DefaultSignModes, signing.SignMode_SIGN_MODE_TEXTUAL),
TextualCoinMetadataQueryFn: authtxconfig.NewGRPCCoinMetadataQueryFn(initClientCtx),
}
txConfigWithTextual, err := tx.NewTxConfigWithOptions(
initClientCtx.Codec,
txConfigOpts,
)
if err != nil {
return err
}
initClientCtx = initClientCtx.WithTxConfig(txConfigWithTextual)
}

// Only loads asset list into a map if human readable denoms are enabled.
assetMap, assetMapRev := map[string]DenomUnitMap{}, map[string]string{}
if humanReadableDenomsInput || humanReadableDenomsOutput {
Expand Down Expand Up @@ -1308,5 +1329,9 @@ func autoCliOpts(initClientCtx client.Context, tempApp *osmosis.OsmosisApp) auto
ValidatorAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()),
ConsensusAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()),
ClientCtx: initClientCtx,
TxConfigOpts: tx.ConfigOptions{
EnabledSignModes: tx.DefaultSignModes,
TextualCoinMetadataQueryFn: authtxconfig.NewGRPCCoinMetadataQueryFn(initClientCtx),
},
}
}

0 comments on commit 3a19be9

Please sign in to comment.