Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ibchooks tests #1980

Merged
merged 14 commits into from
May 17, 2024
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 4 additions & 6 deletions x/ibchooks/ibc_middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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:
Expand All @@ -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() {
Expand Down
6 changes: 3 additions & 3 deletions x/ibchooks/marker_hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading