Skip to content

Commit

Permalink
Web3: blockhash field incorrect in RPC response partial tests (#587)
Browse files Browse the repository at this point in the history
* web3.md: compute blockhash in tx receipt

* web3: formatting
  • Loading branch information
anvacaru authored and rv-jenkins committed Dec 2, 2019
1 parent 2cc646c commit d8920f0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions web3.md
Original file line number Diff line number Diff line change
Expand Up @@ -927,17 +927,17 @@ Transaction Receipts
...
</account>
...
</network> | _ })
</network> | _ } #as BLOCKITEM )
=> #rpcResponseSuccess( { "transactionHash": TXHASH
, "transactionIndex": #unparseQuantity(getIndexOf(TXID, TXLIST))
, "blockHash": #unparseQuantity(1)
, "blockHash": "0x" +String Keccak256(#rlpEncodeBlock(BLOCKITEM))
, "blockNumber": #unparseQuantity(BN)
, "from": #unparseQuantity(TXFROM)
, "to": #unparseAccount(TT)
, "gasUsed": #unparseQuantity(CGAS)
, "cumulativeGasUsed": #unparseQuantity(CGAS)
, "contractAddress": #if TT ==K .Account #then #unparseQuantity(#newAddr(TXFROM, NONCE -Int 1)) #else null #fi
, "logs": [#serializeLogs(LOGS, 0, TXID, TXHASH, BN, 1)]
, "logs": [#serializeLogs(LOGS, 0, TXID, TXHASH, "0x" +String Keccak256(#rlpEncodeBlock(BLOCKITEM)), BN)]
, "status": #unparseQuantity(TXSTATUS)
, "logsBloom": #unparseDataByteArray(BLOOM)
, "v": #unparseQuantity(TW)
Expand Down Expand Up @@ -985,14 +985,14 @@ Transaction Receipts
rule #unparseIntListAux(.List, RESULT) => RESULT
rule #unparseIntListAux(L ListItem(I), RESULT) => #unparseIntListAux(L, (#unparseDataByteArray(#padToWidth(32,#asByteStack(I))), RESULT))
syntax JSONs ::= #serializeLogs ( List, Int, Int, String, Int, Int ) [function]
// -------------------------------------------------------------------------------
syntax JSONs ::= #serializeLogs ( List, Int, Int, String, String, Int ) [function]
// ----------------------------------------------------------------------------------
rule #serializeLogs (.List, _, _, _, _, _) => .JSONs
rule #serializeLogs (ListItem({ ACCT | TOPICS:List | DATA }) L, LI, TI, TH, BH, BN) => {
"logIndex": #unparseQuantity(LI),
"transactionIndex": #unparseQuantity(TI),
"transactionHash": TH,
"blockHash": #unparseQuantity(BH),
"blockHash": BH,
"blockNumber": #unparseQuantity(BN),
"address": #unparseQuantity(ACCT),
"data": #unparseDataByteArray(DATA),
Expand Down

0 comments on commit d8920f0

Please sign in to comment.