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
  • Loading branch information
mergify[bot] authored Sep 13, 2022
1 parent 9d0c6d2 commit 4500274
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 4500274

Please sign in to comment.