Skip to content

Commit

Permalink
fix: allow chainId without hyphen in interchainquery. Fixes #974
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Bowman committed Dec 29, 2023
1 parent e412e1c commit 509c0ce
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions x/interchainquery/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package types

import (
"errors"
"strings"

sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand Down Expand Up @@ -31,10 +30,8 @@ func (msg MsgSubmitQueryResponse) ValidateBasic() error {
return errors.New("height must be non-negative")
}

// TODO: is there a chain validation spec in ICS?
chainParts := strings.Split(msg.ChainId, "-")
if len(chainParts) < 2 && msg.ChainId != "provider" {
return errors.New("chainID must be of form XXXX-N")
if len(msg.ChainId) < 2 {
return errors.New("invalid chain id")

Check warning on line 34 in x/interchainquery/types/msgs.go

View check run for this annotation

Codecov / codecov/patch

x/interchainquery/types/msgs.go#L34

Added line #L34 was not covered by tests
}

if len(msg.QueryId) != 64 {
Expand Down

0 comments on commit 509c0ce

Please sign in to comment.