diff --git a/README.md b/README.md index 0107b4e9..ccf963a9 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,7 @@ This repository hosts `nyxd`, a Cosmos zone with wasm smart contracts enabled. I This code was forked from the `cosmwasm/wasmd` repository, which was itself forked from `cosmos/gaiad` as a basis by the CosmWasm project. They then added `x/wasm` and cleaned up many gaia-specific files. However, the `nyxd` binary should function just like `gaiad` except for the addition of the `x/wasm` module. -**Note**: Requires [Go 1.20.10](https://golang.org/dl/) - -**Note**: The mainnet binary in the releases is built with `Go 1.20.10` so if you plan on building from source please use that version! +**Note**: Requires [Go 1.23.5](https://golang.org/dl/). The mainnet binary in the releases is built with `Go 1.23.5` so if you plan on building from source please use that version! ⚠️ Using other versions of Go may result in non-determinism (app-hash issues) diff --git a/app/app.go b/app/app.go index 42c270d7..c073554a 100644 --- a/app/app.go +++ b/app/app.go @@ -61,6 +61,8 @@ import ( "cosmossdk.io/x/upgrade" upgradekeeper "cosmossdk.io/x/upgrade/keeper" upgradetypes "cosmossdk.io/x/upgrade/types" + signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" + txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" @@ -395,19 +397,20 @@ func NewWasmApp( ) // enable sign mode textual by overwriting the default tx config (after setting the bank keeper) - // enabledSignModes := append(tx.DefaultSignModes, sigtypes.SignMode_SIGN_MODE_TEXTUAL) - // txConfigOpts := tx.ConfigOptions{ - // EnabledSignModes: enabledSignModes, - // TextualCoinMetadataQueryFn: txmodule.NewBankKeeperCoinMetadataQueryFn(app.BankKeeper), - // } - // txConfig, err := tx.NewTxConfigWithOptions( - // appCodec, - // txConfigOpts, - // ) - // if err != nil { - // panic(err) - // } - // app.txConfig = txConfig + enabledSignModes := append(authtx.DefaultSignModes, signingtypes.SignMode_SIGN_MODE_TEXTUAL) + + txConfigOpts := authtx.ConfigOptions{ + EnabledSignModes: enabledSignModes, + TextualCoinMetadataQueryFn: txmodule.NewBankKeeperCoinMetadataQueryFn(app.BankKeeper), + } + txConfig, err = authtx.NewTxConfigWithOptions( + appCodec, + txConfigOpts, + ) + if err != nil { + panic(err) + } + app.txConfig = txConfig app.StakingKeeper = stakingkeeper.NewKeeper( appCodec, diff --git a/cmd/nyxd/root.go b/cmd/nyxd/root.go index c468e308..8461b650 100644 --- a/cmd/nyxd/root.go +++ b/cmd/nyxd/root.go @@ -17,7 +17,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth/tx" - txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" + authtxconfig "github.com/cosmos/cosmos-sdk/x/auth/tx/config" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" @@ -86,7 +86,7 @@ func NewRootCmd() *cobra.Command { enabledSignModes := append(tx.DefaultSignModes, signing.SignMode_SIGN_MODE_TEXTUAL) txConfigOpts := tx.ConfigOptions{ EnabledSignModes: enabledSignModes, - TextualCoinMetadataQueryFn: txmodule.NewGRPCCoinMetadataQueryFn(initClientCtx), + TextualCoinMetadataQueryFn: authtxconfig.NewGRPCCoinMetadataQueryFn(initClientCtx), } txConfig, err := tx.NewTxConfigWithOptions( initClientCtx.Codec, @@ -117,6 +117,10 @@ func NewRootCmd() *cobra.Command { initClientCtx, _ = config.ReadFromClientConfig(initClientCtx) autoCliOpts.Keyring, _ = keyring.NewAutoCLIKeyring(initClientCtx.Keyring) autoCliOpts.ClientCtx = initClientCtx + autoCliOpts.TxConfigOpts = tx.ConfigOptions{ + EnabledSignModes: tx.DefaultSignModes, + TextualCoinMetadataQueryFn: authtxconfig.NewGRPCCoinMetadataQueryFn(initClientCtx), + } if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil { panic(err)