question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

Tiny snub-nosed monkey sitting on a branch of a tree

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
danfinlaycommented, Jul 3, 2017

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.

1reaction
pipermerriamcommented, Jul 3, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found