diff --git a/modules/apps/29-fee/ibc_middleware_test.go b/modules/apps/29-fee/ibc_middleware_test.go index 1a6a8360a78..7a388ac1748 100644 --- a/modules/apps/29-fee/ibc_middleware_test.go +++ b/modules/apps/29-fee/ibc_middleware_test.go @@ -1557,17 +1557,17 @@ func (suite *FeeTestSuite) TestAckUnmarshal() { testCases := []struct { name string ackBytes []byte - expPass bool + expError error }{ { "success", []byte(`{"app_acknowledgement": "eyJyZXN1bHQiOiJiVzlqYXlCaFkydHViM2RzWldsblpXMWxiblE9In0=", "forward_relayer_address": "relayer", "underlying_app_success": true}`), - true, + nil, }, { "failure: unknown fields", []byte(`{"app_acknowledgement": "eyJyZXN1bHQiOiJiVzlqYXlCaFkydHViM2RzWldsblpXMWxiblE9In0=", "forward_relayer_address": "relayer", "underlying_app_success": true, "extra_field": "foo"}`), - false, + errors.New("json: unknown field \"extra_field\""), }, } for _, tc := range testCases { @@ -1575,10 +1575,10 @@ func (suite *FeeTestSuite) TestAckUnmarshal() { ack := &types.IncentivizedAcknowledgement{} err := json.Unmarshal(tc.ackBytes, ack) - if tc.expPass { + if tc.expError == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.expError.Error()) } }) }