cleanup a few more rlpHash calls (#2359)

This commit is contained in:
Jacek Sieka 2024-06-14 12:42:31 +02:00 committed by GitHub
parent ad57575958
commit 8a0772ac10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -467,7 +467,7 @@ proc verify*(f: Era1File): Result[Digest, string] =
?f.getBlockTuple(blockNumber)
txRoot = calcTxRoot(blockBody.transactions)
ommershHash = keccakHash(rlp.encode(blockBody.uncles))
ommershHash = rlpHash(blockBody.uncles)
if blockHeader.txRoot != txRoot:
return err("Invalid transactions root")

View File

@ -24,7 +24,7 @@ proc isValidNextNode(
let nextHash =
if hashOrShortRlp.isList():
# is a short node
keccakHash(rlp.encode(hashOrShortRlp))
rlpHash(hashOrShortRlp)
else:
let hash = hashOrShortRlp.toBytes()
if hash.len() != 32:

View File

@ -119,7 +119,7 @@ func init*(
inc i
else:
for tx in body.transactions:
blockObject.transactions.add txOrHash(w3Hash keccakHash(rlp.encode(tx)))
blockObject.transactions.add txOrHash(w3Hash rlpHash(tx))
blockObject