Skip to content

Commit

Permalink
fix: fix default config initialization, instead
Browse files Browse the repository at this point in the history
  • Loading branch information
dadamu committed Feb 7, 2024
1 parent d6232c4 commit c0b25aa
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions types/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,23 @@ func NewConfig(
}

func DefaultConfig() Config {
return NewConfig(
cfg := NewConfig(
nodeconfig.DefaultConfig(),
DefaultChainConfig(), databaseconfig.DefaultDatabaseConfig(),
parserconfig.DefaultParsingConfig(), loggingconfig.DefaultLoggingConfig(),
)

bz, err := yaml.Marshal(cfg)
if err != nil {
panic(err)
}

cfg.bytes = bz
return cfg
}

func (c Config) GetBytes() ([]byte, error) {
return yaml.Marshal(c)
return c.bytes, nil
}

// ---------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit c0b25aa

Please sign in to comment.