Skip to content

Commit

Permalink
Fixed tests failing because of nil telemetry endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
kishansagathiya committed Oct 14, 2021
1 parent 8b95797 commit e75298c
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 21 deletions.
4 changes: 4 additions & 0 deletions chain/dev/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package dev

import (
"github.com/ChainSafe/gossamer/lib/genesis"
"github.com/ChainSafe/gossamer/lib/runtime/wasmer"
log "github.com/ChainSafe/log15"
)
Expand Down Expand Up @@ -44,6 +45,9 @@ var (
// DefaultRetainBlocks is the default retained blocks
DefaultRetainBlocks = int64(512)

// DefaultTelemetryURLs is the default URL of the telemetry server to connect to.
DefaultTelemetryURLs = []genesis.TelemetryEndpoint{}

// InitConfig

// DefaultGenesis is the default genesis configuration path
Expand Down
4 changes: 4 additions & 0 deletions chain/kusama/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package kusama

import (
"github.com/ChainSafe/gossamer/lib/genesis"
"github.com/ChainSafe/gossamer/lib/runtime/wasmer"
log "github.com/ChainSafe/log15"
)
Expand Down Expand Up @@ -44,6 +45,9 @@ var (
// DefaultRetainBlocks is the default retained blocks
DefaultRetainBlocks = int64(512)

// DefaultTelemetryURLs is the default URL of the telemetry server to connect to.
DefaultTelemetryURLs = []genesis.TelemetryEndpoint{}

// InitConfig

// DefaultGenesis is the default genesis configuration path
Expand Down
4 changes: 4 additions & 0 deletions chain/polkadot/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package polkadot

import (
"github.com/ChainSafe/gossamer/lib/genesis"
"github.com/ChainSafe/gossamer/lib/runtime/wasmer"
log "github.com/ChainSafe/log15"
)
Expand All @@ -41,6 +42,9 @@ var (
// DefaultRetainBlocks is the default pruning mode
DefaultRetainBlocks = int64(512)

// DefaultTelemetryURLs is the default URL of the telemetry server to connect to.
DefaultTelemetryURLs = []genesis.TelemetryEndpoint{}

// InitConfig

// DefaultGenesis is the default genesis configuration path
Expand Down
3 changes: 3 additions & 0 deletions cmd/gossamer/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ func TestUpdateConfigFromGenesisJSON(t *testing.T) {
LogLvl: testCfg.Global.LogLvl,
PublishMetrics: testCfg.Global.PublishMetrics,
MetricsPort: testCfg.Global.MetricsPort,
TelemetryURLs: testCfg.Global.TelemetryURLs,
},
Log: dot.LogConfig{
CoreLvl: log.LvlInfo,
Expand Down Expand Up @@ -774,6 +775,7 @@ func TestUpdateConfigFromGenesisJSON_Default(t *testing.T) {
LogLvl: testCfg.Global.LogLvl,
PublishMetrics: testCfg.Global.PublishMetrics,
MetricsPort: testCfg.Global.MetricsPort,
TelemetryURLs: testCfg.Global.TelemetryURLs,
},
Log: dot.LogConfig{
CoreLvl: log.LvlInfo,
Expand Down Expand Up @@ -823,6 +825,7 @@ func TestUpdateConfigFromGenesisData(t *testing.T) {
LogLvl: testCfg.Global.LogLvl,
PublishMetrics: testCfg.Global.PublishMetrics,
MetricsPort: testCfg.Global.MetricsPort,
TelemetryURLs: testCfg.Global.TelemetryURLs,
},
Log: dot.LogConfig{
CoreLvl: log.LvlInfo,
Expand Down
45 changes: 24 additions & 21 deletions dot/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,14 @@ func GssmrConfig() *Config {
func KusamaConfig() *Config {
return &Config{
Global: GlobalConfig{
Name: kusama.DefaultName,
ID: kusama.DefaultID,
BasePath: kusama.DefaultBasePath,
LogLvl: kusama.DefaultLvl,
MetricsPort: kusama.DefaultMetricsPort,
RetainBlocks: gssmr.DefaultRetainBlocks,
Pruning: pruner.Mode(gssmr.DefaultPruningMode),
Name: kusama.DefaultName,
ID: kusama.DefaultID,
BasePath: kusama.DefaultBasePath,
LogLvl: kusama.DefaultLvl,
MetricsPort: kusama.DefaultMetricsPort,
RetainBlocks: gssmr.DefaultRetainBlocks,
Pruning: pruner.Mode(gssmr.DefaultPruningMode),
TelemetryURLs: kusama.DefaultTelemetryURLs,
},
Log: LogConfig{
CoreLvl: kusama.DefaultLvl,
Expand Down Expand Up @@ -250,13 +251,14 @@ func KusamaConfig() *Config {
func PolkadotConfig() *Config {
return &Config{
Global: GlobalConfig{
Name: polkadot.DefaultName,
ID: polkadot.DefaultID,
BasePath: polkadot.DefaultBasePath,
LogLvl: polkadot.DefaultLvl,
RetainBlocks: gssmr.DefaultRetainBlocks,
Pruning: pruner.Mode(gssmr.DefaultPruningMode),
MetricsPort: gssmr.DefaultMetricsPort,
Name: polkadot.DefaultName,
ID: polkadot.DefaultID,
BasePath: polkadot.DefaultBasePath,
LogLvl: polkadot.DefaultLvl,
RetainBlocks: gssmr.DefaultRetainBlocks,
Pruning: pruner.Mode(gssmr.DefaultPruningMode),
MetricsPort: gssmr.DefaultMetricsPort,
TelemetryURLs: polkadot.DefaultTelemetryURLs,
},
Log: LogConfig{
CoreLvl: polkadot.DefaultLvl,
Expand Down Expand Up @@ -298,13 +300,14 @@ func PolkadotConfig() *Config {
func DevConfig() *Config {
return &Config{
Global: GlobalConfig{
Name: dev.DefaultName,
ID: dev.DefaultID,
BasePath: dev.DefaultBasePath,
LogLvl: dev.DefaultLvl,
MetricsPort: dev.DefaultMetricsPort,
RetainBlocks: dev.DefaultRetainBlocks,
Pruning: pruner.Mode(dev.DefaultPruningMode),
Name: dev.DefaultName,
ID: dev.DefaultID,
BasePath: dev.DefaultBasePath,
LogLvl: dev.DefaultLvl,
MetricsPort: dev.DefaultMetricsPort,
RetainBlocks: dev.DefaultRetainBlocks,
Pruning: pruner.Mode(dev.DefaultPruningMode),
TelemetryURLs: dev.DefaultTelemetryURLs,
},
Log: LogConfig{
CoreLvl: dev.DefaultLvl,
Expand Down

0 comments on commit e75298c

Please sign in to comment.