diff --git a/.changelog/unreleased/bug-fixes/2199-fix-wasm-build-addr.md b/.changelog/unreleased/bug-fixes/2199-fix-wasm-build-addr.md new file mode 100644 index 000000000..d366ec534 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/2199-fix-wasm-build-addr.md @@ -0,0 +1 @@ +* Add the query flags to the query wasm build-addr command [PR 2199](https://github.com/provenance-io/provenance/pull/2199). diff --git a/cmd/provenanced/cmd/root.go b/cmd/provenanced/cmd/root.go index d151d4d01..8bb24890f 100644 --- a/cmd/provenanced/cmd/root.go +++ b/cmd/provenanced/cmd/root.go @@ -132,6 +132,7 @@ func NewRootCmd(sealConfig bool) (*cobra.Command, params.EncodingConfig) { } fixTxWasmInstantiate2Aliases(rootCmd) + fixQueryWasmBuildAddressFlags(rootCmd) return rootCmd, encodingConfig } @@ -535,3 +536,16 @@ func getTelemetryGlobalLabels(logger log.Logger, appOpts servertypes.AppOptions) logger.Debug("Extracted telemetry setup from app options.", telEnabledKey, enabled, telGlobalLabelsKey, globalLabels) return globalLabels, enabled } + +// fixQueryWasmBuildAddressFlags resolves an issue where the Wasm build-address query failed to recognize the node flag. +func fixQueryWasmBuildAddressFlags(rootCmd *cobra.Command) { + // Find the "build-address" command. + cmd, _, err := rootCmd.Find([]string{"query", "wasm", "build-address"}) + if err != nil || cmd == nil { + // If the command doesn't exist, there's nothing to do. + return + } + + // Apply query flags to the command. + flags.AddQueryFlagsToCmd(cmd) +}