From 489fdf4aba87abe3a3ec550fbf4bacc61aabae30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Mon, 12 Sep 2022 14:46:41 +0200 Subject: [PATCH] chore: add IsMiddlewareEnabled key to simulation store decoder (#2215) ## 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//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 --- modules/apps/27-interchain-accounts/simulation/decoder.go | 2 ++ .../apps/27-interchain-accounts/simulation/decoder_test.go | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/modules/apps/27-interchain-accounts/simulation/decoder.go b/modules/apps/27-interchain-accounts/simulation/decoder.go index 706a4c3cbee..f7cf670f665 100644 --- a/modules/apps/27-interchain-accounts/simulation/decoder.go +++ b/modules/apps/27-interchain-accounts/simulation/decoder.go @@ -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)) diff --git a/modules/apps/27-interchain-accounts/simulation/decoder_test.go b/modules/apps/27-interchain-accounts/simulation/decoder_test.go index e46124920ad..9be5aab9ced 100644 --- a/modules/apps/27-interchain-accounts/simulation/decoder_test.go +++ b/modules/apps/27-interchain-accounts/simulation/decoder_test.go @@ -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 { @@ -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", ""}, }