Skip to content

Commit

Permalink
Fix: Add node flag to WASM queries (build-address) (#2199)
Browse files Browse the repository at this point in the history
  • Loading branch information
SpicyLemon committed Oct 24, 2024
1 parent bf5b825 commit dc89d94
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Add the query flags to the query wasm build-addr command [PR 2199](https://github.com/provenance-io/provenance/pull/2199).
14 changes: 14 additions & 0 deletions cmd/provenanced/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func NewRootCmd(sealConfig bool) (*cobra.Command, params.EncodingConfig) {
}

fixTxWasmInstantiate2Aliases(rootCmd)
fixQueryWasmBuildAddressFlags(rootCmd)

return rootCmd, encodingConfig
}
Expand Down Expand Up @@ -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)
}

0 comments on commit dc89d94

Please sign in to comment.