Skip to content

Commit d8920f0

Browse files
anvacarurv-jenkins
authored andcommitted
Web3: blockhash field incorrect in RPC response partial tests (#587)
* web3.md: compute blockhash in tx receipt * web3: formatting
1 parent 2cc646c commit d8920f0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

web3.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -927,17 +927,17 @@ Transaction Receipts
927927
...
928928
</account>
929929
...
930-
</network> | _ })
930+
</network> | _ } #as BLOCKITEM )
931931
=> #rpcResponseSuccess( { "transactionHash": TXHASH
932932
, "transactionIndex": #unparseQuantity(getIndexOf(TXID, TXLIST))
933-
, "blockHash": #unparseQuantity(1)
933+
, "blockHash": "0x" +String Keccak256(#rlpEncodeBlock(BLOCKITEM))
934934
, "blockNumber": #unparseQuantity(BN)
935935
, "from": #unparseQuantity(TXFROM)
936936
, "to": #unparseAccount(TT)
937937
, "gasUsed": #unparseQuantity(CGAS)
938938
, "cumulativeGasUsed": #unparseQuantity(CGAS)
939939
, "contractAddress": #if TT ==K .Account #then #unparseQuantity(#newAddr(TXFROM, NONCE -Int 1)) #else null #fi
940-
, "logs": [#serializeLogs(LOGS, 0, TXID, TXHASH, BN, 1)]
940+
, "logs": [#serializeLogs(LOGS, 0, TXID, TXHASH, "0x" +String Keccak256(#rlpEncodeBlock(BLOCKITEM)), BN)]
941941
, "status": #unparseQuantity(TXSTATUS)
942942
, "logsBloom": #unparseDataByteArray(BLOOM)
943943
, "v": #unparseQuantity(TW)
@@ -985,14 +985,14 @@ Transaction Receipts
985985
rule #unparseIntListAux(.List, RESULT) => RESULT
986986
rule #unparseIntListAux(L ListItem(I), RESULT) => #unparseIntListAux(L, (#unparseDataByteArray(#padToWidth(32,#asByteStack(I))), RESULT))
987987
988-
syntax JSONs ::= #serializeLogs ( List, Int, Int, String, Int, Int ) [function]
989-
// -------------------------------------------------------------------------------
988+
syntax JSONs ::= #serializeLogs ( List, Int, Int, String, String, Int ) [function]
989+
// ----------------------------------------------------------------------------------
990990
rule #serializeLogs (.List, _, _, _, _, _) => .JSONs
991991
rule #serializeLogs (ListItem({ ACCT | TOPICS:List | DATA }) L, LI, TI, TH, BH, BN) => {
992992
"logIndex": #unparseQuantity(LI),
993993
"transactionIndex": #unparseQuantity(TI),
994994
"transactionHash": TH,
995-
"blockHash": #unparseQuantity(BH),
995+
"blockHash": BH,
996996
"blockNumber": #unparseQuantity(BN),
997997
"address": #unparseQuantity(ACCT),
998998
"data": #unparseDataByteArray(DATA),

0 commit comments

Comments
 (0)