fix some tests

This commit is contained in:
marbar3778
2021-06-17 11:56:16 +02:00
parent f9a22483c0
commit 8a39848d06
21 changed files with 131 additions and 288 deletions
+3 -11
View File
@@ -407,8 +407,8 @@ func (c *Client) BlockResults(ctx context.Context, height *int64) (*ctypes.Resul
return nil, err
}
// proto-encode BeginBlock events
bbeBytes, err := proto.Marshal(&abci.ResponseBeginBlock{
// proto-encode FinalizeBlock events
bbeBytes, err := proto.Marshal(&abci.ResponseFinalizeBlock{
Events: res.BeginBlockEvents,
})
if err != nil {
@@ -418,16 +418,8 @@ func (c *Client) BlockResults(ctx context.Context, height *int64) (*ctypes.Resul
// Build a Merkle tree of proto-encoded DeliverTx results and get a hash.
results := types.NewResults(res.TxsResults)
// proto-encode EndBlock events.
ebeBytes, err := proto.Marshal(&abci.ResponseEndBlock{
Events: res.EndBlockEvents,
})
if err != nil {
return nil, err
}
// Build a Merkle tree out of the above 3 binary slices.
rH := merkle.HashFromByteSlices([][]byte{bbeBytes, results.Hash(), ebeBytes})
rH := merkle.HashFromByteSlices([][]byte{bbeBytes, results.Hash()})
// Verify block results.
if !bytes.Equal(rH, trustedBlock.LastResultsHash) {