diff --git a/testing/chain.go b/testing/chain.go index fff0a937302..cb695b5744b 100644 --- a/testing/chain.go +++ b/testing/chain.go @@ -472,7 +472,7 @@ func (chain *TestChain) CurrentTMClientHeader() *ibctm.Header { // be used to sign over the proposed header. func CommitHeader(proposedHeader cmttypes.Header, valSet *cmttypes.ValidatorSet, signers map[string]cmttypes.PrivValidator) (*cmtproto.SignedHeader, error) { hhash := proposedHeader.Hash() - blockID := MakeBlockID(hhash, 3, tmhash.Sum([]byte("part_set"))) + blockID := MakeBlockID(hhash, 3, unusedHash) voteSet := cmttypes.NewVoteSet(proposedHeader.ChainID, proposedHeader.Height, 1, cmtproto.PrecommitType, valSet) // MakeExtCommit expects a signer array in the same order as the validator array. @@ -512,13 +512,13 @@ func (chain *TestChain) CreateTMClientHeader(chainID string, blockHeight int64, Time: timestamp, LastBlockID: MakeBlockID(make([]byte, tmhash.Size), 10_000, make([]byte, tmhash.Size)), LastCommitHash: chain.App.LastCommitID().Hash, - DataHash: tmhash.Sum([]byte("data_hash")), + DataHash: unusedHash, ValidatorsHash: cmtValSet.Hash(), NextValidatorsHash: nextVals.Hash(), - ConsensusHash: tmhash.Sum([]byte("consensus_hash")), + ConsensusHash: unusedHash, AppHash: chain.ProposedHeader.AppHash, - LastResultsHash: tmhash.Sum([]byte("last_results_hash")), - EvidenceHash: tmhash.Sum([]byte("evidence_hash")), + LastResultsHash: unusedHash, + EvidenceHash: unusedHash, ProposerAddress: cmtValSet.Proposer.Address, //nolint:staticcheck } diff --git a/testing/values.go b/testing/values.go index 115f3b39281..0f14f41a081 100644 --- a/testing/values.go +++ b/testing/values.go @@ -11,6 +11,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cometbft/cometbft/crypto/tmhash" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" commitmenttypes "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types" @@ -67,4 +69,6 @@ var ( MockRecvCanaryCapabilityName = mock.MockRecvCanaryCapabilityName prefix = commitmenttypes.NewMerklePrefix([]byte("ibc")) + // unusedHash is a placeholder hash used for testing. + unusedHash = tmhash.Sum([]byte{0x00}) )