mirror of https://github.com/status-im/nim-eth.git
Fix rlpHash of Transaction: remove EIP-4844 blobs before hashing (#643)
This commit is contained in:
parent
e34a9c4e5d
commit
1bae1d8426
|
@ -295,6 +295,8 @@ func destination*(tx: Transaction): EthAddress =
|
||||||
return tx.to.get
|
return tx.to.get
|
||||||
|
|
||||||
func removeNetworkPayload*(tx: Transaction): Transaction =
|
func removeNetworkPayload*(tx: Transaction): Transaction =
|
||||||
|
if tx.networkPayload.isNil:
|
||||||
|
return tx
|
||||||
result = tx
|
result = tx
|
||||||
result.networkPayload = nil
|
result.networkPayload = nil
|
||||||
|
|
||||||
|
|
|
@ -399,6 +399,9 @@ proc append*(rlpWriter: var RlpWriter, t: EthTime) {.inline.} =
|
||||||
proc rlpHash*[T](v: T): Hash256 =
|
proc rlpHash*[T](v: T): Hash256 =
|
||||||
keccakHash(rlp.encode(v))
|
keccakHash(rlp.encode(v))
|
||||||
|
|
||||||
|
proc rlpHash*(tx: Transaction): Hash256 =
|
||||||
|
keccakHash(rlp.encode(tx.removeNetworkPayload))
|
||||||
|
|
||||||
func blockHash*(h: BlockHeader): KeccakHash {.inline.} = rlpHash(h)
|
func blockHash*(h: BlockHeader): KeccakHash {.inline.} = rlpHash(h)
|
||||||
|
|
||||||
proc append*(rlpWriter: var RlpWriter, id: NetworkId) =
|
proc append*(rlpWriter: var RlpWriter, id: NetworkId) =
|
||||||
|
|
Loading…
Reference in New Issue