diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4a0096c51..7583d4fa4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,13 +52,11 @@ jobs: # TODO[1760]: Re-analyze how long tests tests take and change the splitting back to be based on speed. run: | grep -vF \ - -e 'github.com/provenance-io/provenance/x/ibchooks' \ -e 'github.com/provenance-io/provenance/x/ibcratelimit/simulation' \ -e 'github.com/provenance-io/provenance/x/oracle/simulation' \ pkgs.txt > pkgs.txt.tmp split -d -n l/3 pkgs.txt.tmp pkgs.txt.part. printf '%s\n' \ - 'github.com/provenance-io/provenance/x/ibchooks' \ 'github.com/provenance-io/provenance/x/ibcratelimit/simulation' \ 'github.com/provenance-io/provenance/x/oracle/simulation' \ > pkgs.txt.part.03 diff --git a/CHANGELOG.md b/CHANGELOG.md index c99ad25bc..80c105e31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * Clean up the marker module's expected BankKeeper interface [#1954](https://github.com/provenance-io/provenance/pull/1954). * Add the auto-cli commands and a few others newly added by the SDK [#1971](https://github.com/provenance-io/provenance/pull/1971). * Fix unit tests for ibcratelimit [#1977](https://github.com/provenance-io/provenance/pull/1977). +* Fix unit tests for ibchooks [#1980](https://github.com/provenance-io/provenance/pull/1980). ### Client Breaking diff --git a/x/ibchooks/ibc_middleware_test.go b/x/ibchooks/ibc_middleware_test.go index 7259836ca..38e1af349 100644 --- a/x/ibchooks/ibc_middleware_test.go +++ b/x/ibchooks/ibc_middleware_test.go @@ -205,7 +205,7 @@ func (suite *HooksTestSuite) makeMockPacket(receiver, memo string, prevSequence suite.path.EndpointB.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, - clienttypes.NewHeight(0, 100), + clienttypes.NewHeight(1, 100), 0, ) } @@ -379,7 +379,7 @@ func NewMsgTransfer( Token: token, Sender: sender, Receiver: receiver, - TimeoutHeight: clienttypes.NewHeight(0, 100), + TimeoutHeight: clienttypes.NewHeight(1, 500), TimeoutTimestamp: 0, Memo: memo, } @@ -429,7 +429,7 @@ func (suite *HooksTestSuite) RelayPacket(packet channeltypes.Packet, direction D return receiveResult, ack } -func (suite *HooksTestSuite) FullSend(msg sdk.Msg, direction Direction) (*sdk.Result, *abci.ExecTxResult, string, error) { +func (suite *HooksTestSuite) FullSend(msg sdk.Msg, direction Direction) (*abci.ExecTxResult, *abci.ExecTxResult, string, error) { var sender *testutil.TestChain switch direction { case AtoB: @@ -445,9 +445,7 @@ func (suite *HooksTestSuite) FullSend(msg sdk.Msg, direction Direction) (*sdk.Re receiveResult, ack := suite.RelayPacket(packet, direction) - // TODO[1760]: ibchooks: Update tests - // return sendResult, receiveResult, string(ack), err - return nil, receiveResult, string(ack), err + return sendResult, receiveResult, string(ack), err } func (suite *HooksTestSuite) TestAcks() { diff --git a/x/ibchooks/marker_hooks_test.go b/x/ibchooks/marker_hooks_test.go index 3cd54888c..37f81be80 100644 --- a/x/ibchooks/marker_hooks_test.go +++ b/x/ibchooks/marker_hooks_test.go @@ -158,9 +158,9 @@ func (suite *MarkerHooksTestSuite) TestAddUpdateMarker() { metadata, found := suite.chainA.GetProvenanceApp().BankKeeper.GetDenomMetaData(suite.chainA.GetContext(), tc.expIbcDenom) require.True(t, found, "GetDenomMetaData() not found for "+tc.expErr) assert.Equal(t, marker.GetDenom(), metadata.Base, "Metadata Base should equal marker denom") - assert.Equal(t, "testchain2/"+tc.denom, metadata.Name, "Metadata Name should be chainid/denom") - assert.Equal(t, "testchain2/"+tc.denom, metadata.Display, "Metadata Display should be chainid/denom") - assert.Equal(t, tc.denom+" from testchain2", metadata.Description, "Metadata Description is incorrect") + assert.Equal(t, "testchain2-1/"+tc.denom, metadata.Name, "Metadata Name should be chainid/denom") + assert.Equal(t, "testchain2-1/"+tc.denom, metadata.Display, "Metadata Display should be chainid/denom") + assert.Equal(t, tc.denom+" from testchain2-1", metadata.Description, "Metadata Description is incorrect") assert.Len(t, marker.GetAccessList(), len(tc.expTransAuths), "Resulting access list does not equal expect length") for _, access := range marker.GetAccessList() { assert.Len(t, access.GetAccessList(), 1, "Expecting permissions list to only one item")