Skip to content

Commit

Permalink
Merge branch 'main' into bznein/transferEnvironment
Browse files Browse the repository at this point in the history
  • Loading branch information
damiannolan authored Dec 18, 2024
2 parents a919b87 + f88b9b3 commit b12f783
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions modules/core/02-client/types/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,12 +697,12 @@ func (suite *TypesTestSuite) TestMsgRecoverClientValidateBasic() {
// TestMsgRecoverClientGetSigners tests GetSigners for MsgRecoverClient
func TestMsgRecoverClientGetSigners(t *testing.T) {
testCases := []struct {
name string
address sdk.AccAddress
expPass bool
name string
address sdk.AccAddress
expError error
}{
{"success: valid address", sdk.AccAddress(ibctesting.TestAccAddress), true},
{"failure: nil address", nil, false},
{"success: valid address", sdk.AccAddress(ibctesting.TestAccAddress), nil},
{"failure: nil address", nil, fmt.Errorf("empty address string is not allowed")},
}

for _, tc := range testCases {
Expand All @@ -712,11 +712,12 @@ func TestMsgRecoverClientGetSigners(t *testing.T) {
}
encodingCfg := moduletestutil.MakeTestEncodingConfig(testutil.CodecOptions{}, ibc.AppModule{})
signers, _, err := encodingCfg.Codec.GetMsgSigners(&msg)
if tc.expPass {
if tc.expError == nil {
require.NoError(t, err)
require.Equal(t, tc.address.Bytes(), signers[0])
} else {
require.Error(t, err)
require.Equal(t, err.Error(), tc.expError.Error())
}
}
}
Expand Down
13 changes: 7 additions & 6 deletions modules/light-clients/08-wasm/types/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,12 @@ func (suite *TypesTestSuite) TestMsgRemoveChecksumGetSigners() {
suite.Require().NoError(err)

testCases := []struct {
name string
address sdk.AccAddress
expPass bool
name string
address sdk.AccAddress
expError error
}{
{"success: valid address", sdk.AccAddress(ibctesting.TestAccAddress), true},
{"failure: nil address", nil, false},
{"success: valid address", sdk.AccAddress(ibctesting.TestAccAddress), nil},
{"failure: nil address", nil, fmt.Errorf("empty address string is not allowed")},
}

for _, tc := range testCases {
Expand All @@ -259,11 +259,12 @@ func (suite *TypesTestSuite) TestMsgRemoveChecksumGetSigners() {
msg := types.NewMsgRemoveChecksum(address.String(), checksum)

signers, _, err := GetSimApp(suite.chainA).AppCodec().GetMsgSigners(msg)
if tc.expPass {
if tc.expError == nil {
suite.Require().NoError(err)
suite.Require().Equal(address.Bytes(), signers[0])
} else {
suite.Require().Error(err)
suite.Require().Equal(err.Error(), tc.expError.Error())
}
})
}
Expand Down

0 comments on commit b12f783

Please sign in to comment.