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

change DefaultParams on the host to allow all messages ("*") (backport #2290) #2356

Merged
merged 3 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion modules/apps/27-interchain-accounts/host/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ const (

// StoreKey is the store key string for the interchain accounts host module
StoreKey = SubModuleName

// AllowAllHostMsgs holds the string key that allows all message types on interchain accounts host module
AllowAllHostMsgs = "*"
)

// ContainsMsgType returns true if the sdk.Msg TypeURL is present in allowMsgs, otherwise false
func ContainsMsgType(allowMsgs []string, msg sdk.Msg) bool {
// check that wildcard * option for allowing all message types is the only string in the array, if so, return true
if len(allowMsgs) == 1 && allowMsgs[0] == "*" {
if len(allowMsgs) == 1 && allowMsgs[0] == AllowAllHostMsgs {
return true
}

Expand Down
2 changes: 1 addition & 1 deletion modules/apps/27-interchain-accounts/host/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func NewParams(enableHost bool, allowMsgs []string) Params {

// DefaultParams is the default parameter configuration for the host submodule
func DefaultParams() Params {
return NewParams(DefaultHostEnabled, nil)
return NewParams(DefaultHostEnabled, []string{AllowAllHostMsgs})
}

// Validate validates all host submodule parameters
Expand Down