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) ?f.getBlockTuple(blockNumber)
txRoot = calcTxRoot(blockBody.transactions) txRoot = calcTxRoot(blockBody.transactions)
ommershHash = keccakHash(rlp.encode(blockBody.uncles)) ommershHash = rlpHash(blockBody.uncles)
if blockHeader.txRoot != txRoot: if blockHeader.txRoot != txRoot:
return err("Invalid transactions root") return err("Invalid transactions root")

View File

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

View File

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