js-tendermint icon indicating copy to clipboard operation
js-tendermint copied to clipboard

getBlockHash(header) not working

Open garvitgoel opened this issue 4 years ago • 0 comments

the hash returned by getBlockHash(header) is in-correct. It does not match the match the commit.block_id.hash. This is happening for headers and commits that are correct (checked using go-tendermint).

function verifyCommit (header, commit, validators) {
  let blockHash = getBlockHash(header)

  if (blockHash !== commit.block_id.hash) {
    throw Error('Commit does not match block hash')
  }

Given here - https://github.com/nomic-io/js-tendermint/blob/92aec26734c02b2ccd75ececccdaf1d6e70b772e/src/verify.js#L51

garvitgoel avatar Nov 02 '21 12:11 garvitgoel