Skip to content

Commit

Permalink
fix: fix x/profiles genesis unpacking (#881)
Browse files Browse the repository at this point in the history
## Description

This PR fixes the `x/profiles` genesis unmarshalling adding the missing `UnpackInterfaces` method for the `GenesisState` type



---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- x ] targeted the correct branch (see [PR Targeting](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html)
- [ ] included the necessary unit and integration [tests](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [x] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
  • Loading branch information
RiccardoM authored May 31, 2022
1 parent 6753a0c commit 249e286
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions x/profiles/types/genesis.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package types

import (
"github.com/cosmos/cosmos-sdk/codec/types"
host "github.com/cosmos/ibc-go/v3/modules/core/24-host"
)

Expand All @@ -19,6 +20,17 @@ func NewGenesisState(
}
}

// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces
func (g GenesisState) UnpackInterfaces(unpacker types.AnyUnpacker) error {
for _, link := range g.ChainLinks {
err := link.UnpackInterfaces(unpacker)
if err != nil {
return err
}
}
return nil
}

// DefaultGenesisState returns a default GenesisState
func DefaultGenesisState() *GenesisState {
return NewGenesisState(nil, DefaultParams(), IBCPortID, nil, nil)
Expand Down

0 comments on commit 249e286

Please sign in to comment.