Skip to content

Commit

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

* update changelog

---------

Co-authored-by: PaddyMc <paddymchale@hotmail.com>
(cherry picked from commit 502f559)

# Conflicts:
#	CHANGELOG.md
  • Loading branch information
harish551 authored and mergify[bot] committed Oct 2, 2024
1 parent 369517f commit 1579c90
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ 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
<<<<<<< HEAD
=======
* [#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

### State Machine Breaking

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

## v26.0.1

### State Machine Breaking

* [#8732](https://github.com/osmosis-labs/osmosis/pull/8732) fix: iterate delegations continue instead of erroring
>>>>>>> 502f559e6 (fix unsupported sign-mode issue (#8728))
## v26.0.0

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 1579c90

Please sign in to comment.