Skip to content

Commit

Permalink
chore: add IsMiddlewareEnabled key to simulation store decoder (#2215)
Browse files Browse the repository at this point in the history
## Description



closes: #2166 

---

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

- [ ] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
- [ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md).
- [ ] Wrote unit and integration [tests](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#testing)
- [ ] Updated relevant documentation (`docs/`) or specification (`x/<module>/spec/`)
- [ ] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code).
- [ ] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md`
- [ ] Re-reviewed `Files changed` in the Github PR explorer
- [ ] Review `Codecov Report` in the comment section below once CI passes
  • Loading branch information
colin-axner authored Sep 12, 2022
1 parent 2a46942 commit 489fdf4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/apps/27-interchain-accounts/simulation/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ func NewDecodeStore() func(kvA, kvB kv.Pair) string {
return fmt.Sprintf("Owner A: %s\nOwner B: %s", string(kvA.Value), string(kvB.Value))
case bytes.Equal(kvA.Key[:len(types.ActiveChannelKeyPrefix)], []byte(types.ActiveChannelKeyPrefix)):
return fmt.Sprintf("ActiveChannel A: %s\nActiveChannel B: %s", string(kvA.Value), string(kvB.Value))
case bytes.Equal(kvA.Key[:len(types.IsMiddlewareEnabledPrefix)], []byte(types.IsMiddlewareEnabledPrefix)):
return fmt.Sprintf("IsMiddlewareEnabled A: %s\nIsMiddlewareEnabled B: %s", string(kvA.Value), string(kvB.Value))

default:
panic(fmt.Sprintf("invalid %s key prefix %s", types.ModuleName, kvA.Key))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ func TestDecodeStore(t *testing.T) {
Key: []byte(types.ActiveChannelKeyPrefix),
Value: []byte("channel-0"),
},
{
Key: []byte(types.IsMiddlewareEnabledPrefix),
Value: []byte("false"),
},
},
}
tests := []struct {
Expand All @@ -43,6 +47,7 @@ func TestDecodeStore(t *testing.T) {
{"PortID", fmt.Sprintf("Port A: %s\nPort B: %s", types.PortID, types.PortID)},
{"Owner", fmt.Sprintf("Owner A: %s\nOwner B: %s", owner, owner)},
{"ActiveChannel", fmt.Sprintf("ActiveChannel A: %s\nActiveChannel B: %s", channelID, channelID)},
{"IsMiddlewareEnabled", fmt.Sprintf("IsMiddlewareEnabled A: %s\nIsMiddlewareEnabled B: %s", "false", "false")},
{"other", ""},
}

Expand Down

0 comments on commit 489fdf4

Please sign in to comment.