Transaction dict key for data differs between getTransaction() and sendTransaction()
See original GitHub issue- Version: 3.8.1
- Python: 3.5
- OS: Ubuntu 16.04.2 LTS
What seems wrong?
When getting a transaction that has data attached with tx = web3.eth.getTransaction(txhash)
, the data will be accessible via tx['input']
.
When sending a transaction with data, the expected key for data is data
.
So, to re-send the same transaction with an increased gas price, something like the following has to be done (in REPL):
tx = web3.eth.getTransaction(txhash)
tx['gasPrice'] = int(tx['gasPrice'] * 1.11)
tx['data'] = tx['input'] # <--------------- somewhat unexpected
web3.eth.sendTransaction(tx)
Otherwise, the transaction will have been re-created without data at all.
Many of the other keys are quite similar - is there a reason for this “mismatch”?
A solemn monkey
Source: /u/squamuglia @ /r/aww
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
web3.eth API — Web3.py 5.31.3 documentation - Read the Docs
Often, when a property or method returns a mapping of keys to values, it will return an AttributeDict which acts like a dict...
Read more >Blockchain Transactions in Ethereum Mempool - Coding Edition
The Ethereum client helps the node access data from the Ethereum blockchain, verify all transactions in each block, establish peer-to-peer ...
Read more >3. Your First Transaction - Algorand Developer Portal
In order to send a transaction, you first need an account on Algorand. Create an account by generating an Algorand public/private key pair...
Read more >JSON RPC API - Solana Docs
The JSON request data should contain 4 fields: jsonrpc: <string> , set to "2.0" ... Transactions are quite different from those on other...
Read more >Web3.py Introduction
In Python, you can connect to the blockchain in a few different ways. ... we would unlock our account with our password, and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You refer to EipSignal, which proposes using a DAO to manage a public compatibility table whose test spec format is up for discussion in eip 217.
I largely passed off the creation of that DAO to the Boardroom team for the moment, because they had some of the required pieces in place, but will hopefully have some fresh time to get back on that soon, because I see a lot of these incompatibilities popping up.
In the meanwhile, feel free to chime in on that spec format, it hasn’t gotten much actionable response.
It’s not a trivial EIP to create, but having a formal agreed upon RPC spec that the clients could test against would be really powerful. I know @flyswatter (Dan Finlay) was working on something like this at one point but I don’t know what the progress was.