Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return proper response in eth_getTransactionReceipt #179

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

m-Peter
Copy link
Collaborator

@m-Peter m-Peter commented Mar 25, 2024

Closes: #160

Description

The Ethereum JSON-API specification, requires also the following fields:

  • contractAddress (present for contract creation),
  • from,
  • to (null for contract creation)

Examples:

Contract creation:

curl -XPOST 'localhost:8545' --header 'Content-Type: application/json' --data-raw '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0xe414f90fea2aebd75e8c0b3b6a4a0c9928e86c16ea724343d884f40bfe2c4c6b"],"id":8}' | jq
{
  "jsonrpc": "2.0",
  "id": 8,
  "result": {
    "blockHash": "0xcbad8c56cfd41509bbbe8c5750d8f550d6268cc3549abcf7ea78087e46c54f49",
    "blockNumber": "0x3",
    "contractAddress": "0x99466ed2e37b892a2ee3e9cd55a98b68f5735db2",
    "cumulativeGasUsed": "0x195b0",
    "effectiveGasPrice": "0x0",
    "from": "0x658bdf435d810c91414ec09147daa6db62406379",
    "gasUsed": "0x195b0",
    "logs": [],
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "status": "0x1",
    "to": null,
    "transactionHash": "0xe414f90fea2aebd75e8c0b3b6a4a0c9928e86c16ea724343d884f40bfe2c4c6b",
    "transactionIndex": "0x0",
    "type": "0x0"
  }
}

Contract call:

curl -XPOST 'localhost:8545' --header 'Content-Type: application/json' --data-raw '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x9da005357b95da4b5c485c08f2ac41ecfe868ead4e6856b909a45dc27a6fcf7d"],"id":8}' | jq
{
  "jsonrpc": "2.0",
  "id": 8,
  "result": {
    "blockHash": "0x019fdff559b2bf0d3f0f4d3e951875c22d84065a041636179c0a22f5f51a7373",
    "blockNumber": "0x4",
    "contractAddress": null,
    "cumulativeGasUsed": "0x57f2",
    "effectiveGasPrice": "0x0",
    "from": "0x658bdf435d810c91414ec09147daa6db62406379",
    "gasUsed": "0x57f2",
    "logs": [
      {
        "address": "0x99466ed2e37b892a2ee3e9cd55a98b68f5735db2",
        "topics": [
          "0x24abdb5865df5079dcc5ac590ff6f01d5c16edbc5fab4e195d9febd1114503da"
        ],
        "data": "0x000000000000000000000000000000000000000000000000000000000000002a",
        "blockNumber": "0x4",
        "transactionHash": "0x9da005357b95da4b5c485c08f2ac41ecfe868ead4e6856b909a45dc27a6fcf7d",
        "transactionIndex": "0x0",
        "blockHash": "0x019fdff559b2bf0d3f0f4d3e951875c22d84065a041636179c0a22f5f51a7373",
        "logIndex": "0x0",
        "removed": false
      }
    ],
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000020000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000",
    "status": "0x1",
    "to": "0x99466ed2e37b892a2ee3e9cd55a98b68f5735db2",
    "transactionHash": "0x9da005357b95da4b5c485c08f2ac41ecfe868ead4e6856b909a45dc27a6fcf7d",
    "transactionIndex": "0x0",
    "type": "0x0"
  }
}

For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the standards mentioned here.
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@m-Peter m-Peter added this to the Flow-EVM-M2 milestone Mar 25, 2024
@m-Peter m-Peter self-assigned this Mar 25, 2024
The Ethereum JSON-API specification, requires also the following fields:
- contractAddress (present for contract creation),
- from,
- to (null for contract creation)
@m-Peter m-Peter force-pushed the eth-get-tx-receipt-proper-response branch from 158d794 to a4d7182 Compare March 26, 2024 14:21
@m-Peter m-Peter merged commit 6086d9e into onflow:main Mar 26, 2024
1 check passed
@m-Peter m-Peter deleted the eth-get-tx-receipt-proper-response branch March 26, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Return proper response for eth_getTransactionReceipt
2 participants