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

web3.eth.getTransaction with EthereumTesterProvider return data instead of input #901

Closed
Tracked by #2854
rnesytov opened this issue Jun 13, 2018 · 1 comment · Fixed by #3235
Closed
Tracked by #2854
Labels
priority: p3 normal v7 breaking changes considered for v7

Comments

@rnesytov
Copy link

  • Version: 4.3.0
  • Python: 3.6
  • OS: osx

What was wrong?

I am using web3.eth.getTransaction to check transaction data in my tests. If I use geth node as HTTPProvider I got:

AttributeDict({'blockHash': HexBytes('0xc9dd4255ee1a3be19ef2ebd9939518ac97930884736d393955b96a57d6514ce4'),
 'blockNumber': 2455498,
 'from': '0x3b6aE508805aDc8d93A7FaBE7c44853fD1E5508a',
 'gas': 387057,
 'gasPrice': 1000000000,
 'hash': HexBytes('0xe30dc8d4177d653d78796742d4c2d8d2d6a5caed7a5e458f285b4c59d73da19f'),
 'input': '0xea94496b0000000000000000000000000000000000000000000000000000000000053c1b000000000000000000000000000000000000000000000000000000000000fa4b',
 'nonce': 1718,
 'r': HexBytes('0xdd4e1c435a0815e68b4c78663d7583d6283bf625e321eaf1610e55cc2686f4b1'),
 's': HexBytes('0x1df25aebb44d5045afff728a95aa823dcac2b62bfba68094faedb2769399c11a'),
 'to': '0xFe2149773B3513703E79Ad23D05A778A185016ee',
 'transactionIndex': 23,
 'v': 44,
 'value': 3000000000000000})

But if I use EthereumTesterProvider with PyEVM I got:

AttributeDict({'blockHash': HexBytes('0x769ab5efa0150bd42f3daf3b5e6073f1776980f8067bc5278f0579782a43bee8'),
 'blockNumber': 4,
 'data': '0x40c10f19000000000000000000000000b0a3f48478d84a497f930d8455711d9981b66a7000000000000000000000000000000000000000000000000000000000000007ca',
 'from': '0x73015966604928A312F79F7E69291a656Cb88602',
 'gas': 40000,
 'gasPrice': 5000000000,
 'hash': HexBytes('0x76ba2e6a718a921f33afde65e3251ac6fa0df8f7ba5c7aefb0930a0e5c7de9ab'),
 'nonce': 0,
 'r': HexBytes('0xa4bc06d2cc7ab8888a4f0d5dd7cf3f0f77c43e0f60d60af7da3e3024f2d57440'),
 's': HexBytes('0x7a220bb17c3e25e006a6b3df60ccd8a3fecb911f1eb4cd5d2332912e0fd7381e'),
 'to': '0x2feB9363a9bb1E16Ab90F6d4007264774e959F34',
 'transactionIndex': 0,
 'v': 28,
 'value': 0})

AttributeDict keys is the same except for 'input'/'data'. According to geth and parity JSON-RPC docs, there should beinput.

Here in eth_tester this field defined.

How can it be fixed?

Add 'data': 'input' to TRANSACTION_KEY_MAPPINGS

@carver
Copy link
Collaborator

carver commented Jun 13, 2018

Hm, this change might actually belong in eth-tester. Either way, we'll have to copy it and deprecate input (rather than just move it) in case anyone is depending on this current behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 normal v7 breaking changes considered for v7
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants