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

pkg/cosmos/cmd/chainlink-cosmos: un-nest config #428

Merged
merged 1 commit into from
Feb 3, 2025
Merged
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
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
Loading