Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: indexer config reading sqs enabled value #8431

Merged
merged 2 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* [#8420](https://github.com/osmosis-labs/osmosis/pull/8420) Remove further unneeded IBC acknowledgements time from CheckTx/RecheckTx.

### Config

* [#8431](https://github.com/osmosis-labs/osmosis/pull/8431) Fix osmosis-indexer config bug that read osmosis-sqs value

## v25.1.2

* [#8415](https://github.com/osmosis-labs/osmosis/pull/8415) Reset cache on pool creation
Expand Down
14 changes: 8 additions & 6 deletions osmoutils/config_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import (

// ParseBool parses a boolean value from a server type option.
func ParseBool(opts servertypes.AppOptions, groupOptName, optName string, defaultValue bool) bool {
fullOptName := "osmosis-sqs." + optName
fullOptName := groupOptName + "." + optName
valueInterface := opts.Get(fullOptName)
value := defaultValue
if valueInterface != nil {
valueStr, ok := valueInterface.(string)
if !ok {
panic("invalidly configured osmosis-sqs." + optName)
panic("invalidly configured " + fullOptName)
}
valueStr = strings.TrimSpace(valueStr)
v, err := strconv.ParseBool(valueStr)
Expand All @@ -34,9 +34,10 @@ func ParseBool(opts servertypes.AppOptions, groupOptName, optName string, defaul

// ParseInt parses an integer value from a server type option.
func ParseInt(opts servertypes.AppOptions, groupOptName, optName string) int {
valueInterface := opts.Get(groupOptName + "." + optName)
fullOptName := groupOptName + "." + optName
valueInterface := opts.Get(fullOptName)
if valueInterface == nil {
panic("missing config for osmosis-sqs." + optName)
panic("missing config for " + fullOptName)
}
value := cast.ToInt(valueInterface)
return value
Expand Down Expand Up @@ -86,9 +87,10 @@ func ParseStringToUint64Slice(input string) ([]uint64, error) {

// ParseString parses a string value from a server type option.
func ParseString(opts servertypes.AppOptions, groupOptName, optName string) string {
valueInterface := opts.Get(groupOptName + "." + optName)
fullOptName := groupOptName + "." + optName
valueInterface := opts.Get(fullOptName)
if valueInterface == nil {
panic("missing config for osmosis-sqs." + optName)
panic("missing config for " + fullOptName)
}
value := cast.ToString(valueInterface)
return value
Expand Down