Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[jsonrpc] Fix newHeads subscription returns inconsistent names and ty…
…pes (#267) # Description The `eth_subscibe` with `newHeads` return data inconsistent with other endpoints. The PR fixes it. expected: ```json { "parentHash": "0x97aaaa7beb1c1b214b5be2e7f7c10c0b6a4cbd03199c6b801261d52259b61861", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "miner": "0x92bB5D1A856E54157232b43Fe1C9C7e89eE36ABE", "stateRoot": "0xfbc57a3dae227fe8fe9c6257da16aea23f66d40d814e07a6071a9c4d1a6871ff", "txRoot": "0xe2e4d8c039867942bbb51678a7b9eb1021eeb8a112d610941a440ef33698cc96", "receiptsRoot": "0xaab4695d4870a57327b11f93c3654fee07ce0b317cee231ae003781d5deb5cf5", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "difficulty": "0x4d3a89", "number": "0x4d3a89", "gasLimit": "0x1c9c380", "gasUsed": "0x10b2a", "timestamp": "0x638895ac", "extraData": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD5AWT4VJTWaLulB9BDj/Iu6M6zQTI3ZWaaJJRxdZlv+dy4+7g7aOK4jxoCkBRVW5SSu10ahW5UFXIytD/hycfonuNqvpRk8mhuOsdJLDs/Zi0y7Li2v6VI/rhBN1vHq66zRutiXAwD4IED/n2u3kDvXY4EjSe/hiFdOsNxtBgbDwNVrxB7eHTIFXDKu4SVr1Y/Lyr3Mi25m+YdWwH4ybhBktNBzNLycczqZpElmSBOWxhkFXZWoQyQOnGNwUtWV54CWTualYHIQ3IebuJkVGuceWb6nHikvgq67q5RrhI0IAC4QXLtLnCtU/IqFrYkhYVsezrGluc4hPikBhFbkHg3taFDCS52rxtF1sjOiJt+yvalDplds7f0j2CA/QT9mky1jEIBuEE/vPa7tBS4dLnuSJR23mjd8qZ7crVV6ECmfhAUew9/o3xGG5Cmh1/rvHNjrGehL0m3WmME6kbcHJ+lM6ptM3wqAQ==", "mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365", "nonce": "0x0000000000000000", "hash": "0xc0b316518ba0b13fde70c1fba9984d3d55c0b0d2d3ba951581dca71dab814d81" } ``` actual: ```json { "ParentHash": "0x97aaaa7beb1c1b214b5be2e7f7c10c0b6a4cbd03199c6b801261d52259b61861", "Sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "Miner": "0x92bB5D1A856E54157232b43Fe1C9C7e89eE36ABE", "StateRoot": "0xfbc57a3dae227fe8fe9c6257da16aea23f66d40d814e07a6071a9c4d1a6871ff", "TxRoot": "0xe2e4d8c039867942bbb51678a7b9eb1021eeb8a112d610941a440ef33698cc96", "ReceiptsRoot": "0xaab4695d4870a57327b11f93c3654fee07ce0b317cee231ae003781d5deb5cf5", "LogsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "Difficulty": 5061257, "Number": 5061257, "GasLimit": 30000000, "GasUsed": 68394, "Timestamp": 1669895596, "ExtraData": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD5AWT4VJTWaLulB9BDj/Iu6M6zQTI3ZWaaJJRxdZlv+dy4+7g7aOK4jxoCkBRVW5SSu10ahW5UFXIytD/hycfonuNqvpRk8mhuOsdJLDs/Zi0y7Li2v6VI/rhBN1vHq66zRutiXAwD4IED/n2u3kDvXY4EjSe/hiFdOsNxtBgbDwNVrxB7eHTIFXDKu4SVr1Y/Lyr3Mi25m+YdWwH4ybhBktNBzNLycczqZpElmSBOWxhkFXZWoQyQOnGNwUtWV54CWTualYHIQ3IebuJkVGuceWb6nHikvgq67q5RrhI0IAC4QXLtLnCtU/IqFrYkhYVsezrGluc4hPikBhFbkHg3taFDCS52rxtF1sjOiJt+yvalDplds7f0j2CA/QT9mky1jEIBuEE/vPa7tBS4dLnuSJR23mjd8qZ7crVV6ECmfhAUew9/o3xGG5Cmh1/rvHNjrGehL0m3WmME6kbcHJ+lM6ptM3wqAQ==", "MixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365", "Nonce": "0x0000000000000000", "Hash": "0xc0b316518ba0b13fde70c1fba9984d3d55c0b0d2d3ba951581dca71dab814d81" } ``` # Changes include - [x] Bugfix (non-breaking change that solves an issue) ## Testing - [x] I have tested this code with the official test suite
- Loading branch information