Skip to content

Commit

Permalink
Merge branch 'main' into gjermund/bump-wasmvm
Browse files Browse the repository at this point in the history
  • Loading branch information
gjermundgaraba authored Dec 19, 2024
2 parents 7b239a9 + 5bd6eda commit 40a13c1
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 18 deletions.
16 changes: 16 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ pull_request_rules:
backport:
branches:
- 08-wasm/release/v0.3.x+ibc-go-v7.4.x-wasmvm-v1.5.x
- name: backport patches to v0.4.x wasm ibc-go v7.4.x & wasmvm 1.5.x branch
conditions:
- base=main
- label=backport-wasm-v0.4.x+ibc-go-v7.4.x-wasmvm-v1.5.x
actions:
backport:
branches:
- 08-wasm/release/v0.4.x+ibc-go-v7.4.x-wasmvm-v1.5.x
- name: backport patches to v0.4.x wasm ibc-go v8.4.x & wasmvm 2.0.x branch
conditions:
- base=main
Expand All @@ -54,6 +62,14 @@ pull_request_rules:
backport:
branches:
- 08-wasm/release/v0.4.x+ibc-go-v8.4.x-wasmvm-v2.0.x
- name: backport patches to v0.5.x wasm ibc-go v8.4.x & wasmvm 2.1.x branch
conditions:
- base=main
- label=backport-wasm-v0.5.x+ibc-go-v8.4.x-wasmvm-v2.1.x
actions:
backport:
branches:
- 08-wasm/release/v0.5.x+ibc-go-v8.4.x-wasmvm-v2.0.x
- name: backport patches to v0.5.x wasm ibc-go v9.0.x & wasmvm 2.1.x branch
conditions:
- base=main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ func (suite *GenesisTypesTestSuite) TestValidateControllerGenesisState() {
testCases := []struct {
name string
malleate func()
expPass bool
expErr error
}{
{
"success",
func() {},
true,
nil,
},
{
"failed to validate active channel - invalid port identifier",
Expand All @@ -110,7 +110,7 @@ func (suite *GenesisTypesTestSuite) TestValidateControllerGenesisState() {

genesisState = genesistypes.NewControllerGenesisState(activeChannels, []genesistypes.RegisteredInterchainAccount{}, []string{}, controllertypes.DefaultParams())
},
false,
host.ErrInvalidID,
},
{
"failed to validate active channel - invalid channel identifier",
Expand All @@ -124,7 +124,7 @@ func (suite *GenesisTypesTestSuite) TestValidateControllerGenesisState() {

genesisState = genesistypes.NewControllerGenesisState(activeChannels, []genesistypes.RegisteredInterchainAccount{}, []string{}, controllertypes.DefaultParams())
},
false,
host.ErrInvalidID,
},
{
"failed to validate registered account - invalid port identifier",
Expand All @@ -145,7 +145,7 @@ func (suite *GenesisTypesTestSuite) TestValidateControllerGenesisState() {

genesisState = genesistypes.NewControllerGenesisState(activeChannels, registeredAccounts, []string{}, controllertypes.DefaultParams())
},
false,
host.ErrInvalidID,
},
{
"failed to validate registered account - invalid owner address",
Expand All @@ -166,7 +166,7 @@ func (suite *GenesisTypesTestSuite) TestValidateControllerGenesisState() {

genesisState = genesistypes.NewControllerGenesisState(activeChannels, registeredAccounts, []string{}, controllertypes.DefaultParams())
},
false,
icatypes.ErrInvalidAccountAddress,
},
{
"failed to validate controller ports - invalid port identifier",
Expand All @@ -187,7 +187,7 @@ func (suite *GenesisTypesTestSuite) TestValidateControllerGenesisState() {

genesisState = genesistypes.NewControllerGenesisState(activeChannels, registeredAccounts, []string{"invalid|port"}, controllertypes.DefaultParams())
},
false,
host.ErrInvalidID,
},
}

Expand All @@ -201,10 +201,11 @@ func (suite *GenesisTypesTestSuite) TestValidateControllerGenesisState() {

err := genesisState.Validate()

if tc.expPass {
if tc.expErr == nil {
suite.Require().NoError(err, tc.name)
} else {
suite.Require().Error(err, tc.name)
suite.Require().ErrorIs(err, tc.expErr)
}
})
}
Expand Down
21 changes: 11 additions & 10 deletions modules/core/02-client/types/client_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package types_test

import (
"errors"
"testing"

"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -63,26 +64,26 @@ func TestValidateClientType(t *testing.T) {
testCases := []struct {
name string
clientType string
expPass bool
expError error
}{
{"valid", "tendermint", true},
{"valid solomachine", "solomachine-v1", true},
{"too large", "tenderminttenderminttenderminttenderminttendermintt", false},
{"too short", "t", false},
{"blank id", " ", false},
{"empty id", "", false},
{"ends with dash", "tendermint-", false},
{"valid", "tendermint", nil},
{"valid solomachine", "solomachine-v1", nil},
{"too large", "tenderminttenderminttenderminttenderminttendermintt", errors.New("client type results in largest client identifier being invalid")},
{"too short", "t", errors.New("client type results in smallest client identifier being invalid")},
{"blank id", " ", errors.New("client type cannot be blank")},
{"empty id", "", errors.New("client type cannot be blank")},
{"ends with dash", "tendermint-", errors.New("invalid client type")},
}

for _, tc := range testCases {
tc := tc

err := types.ValidateClientType(tc.clientType)

if tc.expPass {
if tc.expError == nil {
require.NoError(t, err, tc.name)
} else {
require.Error(t, err, tc.name)
require.ErrorContains(t, err, tc.expError.Error())
}
}
}

0 comments on commit 40a13c1

Please sign in to comment.