Skip to content

Commit

Permalink
pkg/cosmos/cmd/chainlink-cosmos: un-nest config
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 committed Feb 3, 2025
1 parent 3df261e commit 587d0e3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/cosmos/cmd/chainlink-cosmos/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ type pluginRelayer struct {
func (c *pluginRelayer) NewRelayer(ctx context.Context, config string, keystore loop.Keystore, capRegistry core.CapabilitiesRegistry) (loop.Relayer, error) {
d := toml.NewDecoder(strings.NewReader(config))
d.DisallowUnknownFields()
var cfg struct {
Cosmos coscfg.TOMLConfig
}

var cfg coscfg.TOMLConfig
if err := d.Decode(&cfg); err != nil {
return nil, fmt.Errorf("failed to decode config toml: %w:\n\t%s", err, config)
}
Expand All @@ -67,7 +65,7 @@ func (c *pluginRelayer) NewRelayer(ctx context.Context, config string, keystore
KeyStore: keystore,
DS: c.ds,
}
chain, err := cosmos.NewChain(&cfg.Cosmos, opts)
chain, err := cosmos.NewChain(&cfg, opts)
if err != nil {
return nil, fmt.Errorf("failed to create chain: %w", err)
}
Expand Down

0 comments on commit 587d0e3

Please sign in to comment.