Skip to content

Commit

Permalink
Fix config template
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Beliaev committed Feb 25, 2025
1 parent 9ba292a commit 68316bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion cmd/wardend/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
evmservercfg "github.com/evmos/evmos/v20/server/config"
oracleconfig "github.com/skip-mev/slinky/oracle/config"

httpconfig "github.com/warden-protocol/wardenprotocol/prophet/handlers/http/config"
pricepredconfig "github.com/warden-protocol/wardenprotocol/prophet/handlers/pricepred/config"
)

Expand Down Expand Up @@ -39,6 +40,7 @@ func initAppConfig() (string, interface{}) {

// Prophet handlers
PricePred pricepredconfig.Config `mapstructure:"pricepred"`
Http httpconfig.Config `mapstructure:"http"`
}

// Optionally allow the chain developer to overwrite the SDK's default
Expand Down Expand Up @@ -91,6 +93,7 @@ func initAppConfig() (string, interface{}) {
tlsConfig := evmservercfg.DefaultTLSConfig()

pricePredictionConfig := pricepredconfig.DefaultConfig()
httpConfig := httpconfig.DefaultConfig()

customAppConfig := CustomAppConfig{
Config: *srvCfg,
Expand All @@ -100,13 +103,15 @@ func initAppConfig() (string, interface{}) {
TLS: *tlsConfig,
Rosetta: *evmservercfg.DefaultRosettaConfig(),
PricePred: *pricePredictionConfig,
Http: *httpConfig,
}

customAppTemplate := serverconfig.DefaultConfigTemplate +
oracleconfig.DefaultConfigTemplate +
evmservercfg.DefaultEVMConfigTemplate +
evmservercfg.DefaultRosettaConfigTemplate +
pricepredconfig.DefaultEVMConfigTemplate
pricepredconfig.DefaultEVMConfigTemplate +
httpconfig.DefaultEVMConfigTemplate

// Edit the default template file
//
Expand Down
2 changes: 1 addition & 1 deletion prophet/handlers/http/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const DefaultEVMConfigTemplate = `
enabled = "{{ .Http.Enabled }}"
# URLs used for HTTP handler
urls = ["{{ .Http.URLs | join "," }}"]
urls = ["{{ range $i, $url := .Http.URLs }}{{if $i}},{{end}}{{$url}}{{end}}"]
# Timeout in seconds for the HTTP client
timeout = {{ .Http.Timeout }}
Expand Down

0 comments on commit 68316bc

Please sign in to comment.