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

remove spurious TestABCICodeDeterminism tests #1695

Merged
merged 1 commit into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 0 additions & 63 deletions modules/apps/27-interchain-accounts/host/ibc_module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import (
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
"github.com/gogo/protobuf/proto"
"github.com/stretchr/testify/suite"
abcitypes "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto"
tmprotostate "github.com/tendermint/tendermint/proto/tendermint/state"
tmstate "github.com/tendermint/tendermint/state"

"github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"
icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"
Expand Down Expand Up @@ -692,63 +689,3 @@ func (suite *InterchainAccountsTestSuite) TestControlAccountAfterChannelClose()
hasBalance = suite.chainB.GetSimApp().BankKeeper.HasBalance(suite.chainB.GetContext(), icaAddr, sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(0)})
suite.Require().True(hasBalance)
}

// The safety of including SDK MsgResponses in the acknowledgement rests
// on the inclusion of the abcitypes.ResponseDeliverTx.Data in the
// abcitypes.ResposneDeliverTx hash. If the abcitypes.ResponseDeliverTx.Data
// gets removed from consensus they must no longer be used in the packet
// acknowledgement.
//
// This test acts as an indicator that the abcitypes.ResponseDeliverTx.Data
// may no longer be deterministic.
func (suite *InterchainAccountsTestSuite) TestABCICodeDeterminism() {
msgResponseBz, err := proto.Marshal(&channeltypes.MsgChannelOpenInitResponse{})
suite.Require().NoError(err)

msgData := &sdk.MsgData{
MsgType: sdk.MsgTypeURL(&channeltypes.MsgChannelOpenInit{}),
Data: msgResponseBz,
}

txResponse, err := proto.Marshal(&sdk.TxMsgData{
Data: []*sdk.MsgData{msgData},
})
suite.Require().NoError(err)

deliverTx := abcitypes.ResponseDeliverTx{
Data: txResponse,
}
responses := tmprotostate.ABCIResponses{
DeliverTxs: []*abcitypes.ResponseDeliverTx{
&deliverTx,
},
}

differentMsgResponseBz, err := proto.Marshal(&channeltypes.MsgRecvPacketResponse{})
suite.Require().NoError(err)

differentMsgData := &sdk.MsgData{
MsgType: sdk.MsgTypeURL(&channeltypes.MsgRecvPacket{}),
Data: differentMsgResponseBz,
}

differentTxResponse, err := proto.Marshal(&sdk.TxMsgData{
Data: []*sdk.MsgData{differentMsgData},
})
suite.Require().NoError(err)

differentDeliverTx := abcitypes.ResponseDeliverTx{
Data: differentTxResponse,
}

differentResponses := tmprotostate.ABCIResponses{
DeliverTxs: []*abcitypes.ResponseDeliverTx{
&differentDeliverTx,
},
}

hash := tmstate.ABCIResponsesResultsHash(&responses)
differentHash := tmstate.ABCIResponsesResultsHash(&differentResponses)

suite.Require().NotEqual(hash, differentHash)
}
81 changes: 0 additions & 81 deletions modules/apps/27-interchain-accounts/host/types/ack_test.go

This file was deleted.