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

fix: init command build empty config file #108

Merged
merged 2 commits into from
Feb 7, 2024

Conversation

dadamu
Copy link
Contributor

@dadamu dadamu commented Feb 7, 2024

Description

This PR intends to fix the init command building empty config instead of the default config since bytes value of DefaultConfig built by constructor is nil.

Checklist

  • Targeted PR against correct branch.
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote unit tests.
  • Re-reviewed Files changed in the Github PR explorer.

@dadamu dadamu requested review from RiccardoM and MonikaCat February 7, 2024 11:05
@@ -49,7 +50,7 @@ func DefaultConfig() Config {
}

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break everything when using the GetBytes method on other projects. Instead, we should fix the initialization inside the DefaultConfig if the problem is there

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated it.

@dadamu dadamu requested a review from RiccardoM February 7, 2024 13:12
@RiccardoM RiccardoM changed the title fix: fix init command build empty config file fix: init command build empty config file Feb 7, 2024
@RiccardoM RiccardoM added the automerge Automatically merge PR once all prerequisites pass label Feb 7, 2024
@RiccardoM RiccardoM merged commit 4a9c1b8 into cosmos/v0.47.x Feb 7, 2024
4 checks passed
@RiccardoM RiccardoM deleted the paul/fix-init-cmd branch February 7, 2024 13:31
RiccardoM pushed a commit that referenced this pull request Mar 27, 2024
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
v                               ✰  Thanks for creating a PR! ✰
v    Before smashing the submit button please review the checkboxes.
v If a checkbox is n/a - please still include it but + a little note why
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  -->

## Description
<!-- Small description -->

This PR intends to fix the init command building empty config instead of
the default config since `bytes` value of `DefaultConfig` built by
constructor is `nil`.

## Checklist
- [x] Targeted PR against correct branch.
- [ ] Linked to Github issue with discussion and accepted design OR link
to spec that describes this work.
- [ ] Wrote unit tests.
- [x] Re-reviewed `Files changed` in the Github PR explorer.
dzmitryhil pushed a commit to CoreumFoundation/junov5 that referenced this pull request Dec 16, 2024
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
v                               ✰  Thanks for creating a PR! ✰    
v    Before smashing the submit button please review the checkboxes.
v If a checkbox is n/a - please still include it but + a little note why
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  -->

## Description
<!-- Small description -->

This PR intends to fix the init command building empty config instead of
the default config since `bytes` value of `DefaultConfig` built by
constructor is `nil`.

## Checklist
- [x] Targeted PR against correct branch.
- [ ] Linked to Github issue with discussion and accepted design OR link
to spec that describes this work.
- [ ] Wrote unit tests.  
- [x] Re-reviewed `Files changed` in the Github PR explorer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PR once all prerequisites pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants