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.

Block identifier parameter in Contract.call

See original GitHub issue
  • Version: 3.16.2
  • Python: 3.5
  • OS: linux

What was wrong?

I’m trying to query a contract state 6 block ago. Unlike web3.js api in Contract.call I can’t specify block identifier to run this call against. What is a correct way of doing this in web3py? Am I correct in my understanding that as a workaround I can temporarily set Eth.defaultBlock to desired number and I won’t run into any internal web3py thread/green thread concurrency issues?

How can it be fixed?

I’m feature-requesting addition of block identifier parameter in Contract.call in accord with web3.js api.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pipermerriamcommented, Dec 5, 2017

I’d say extra optional parameter.

1reaction
pipermerriamcommented, Nov 20, 2017

Yes, this should be added (and should be relatively easy to implement)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Contracts — Web3.py 6.0.0-beta.5 documentation
Smart contracts are programs deployed to the Ethereum network. ... The block_identifier parameter is passed directly to the call at the end portion...
Read more >
Units and Globally Available Variables - Solidity
When contracts are evaluated off-chain rather than in context of a transaction included in a block, you should not assume that block.* and...
Read more >
The `blocklog` Contract | Shimmer Wiki
Returns a list with the IDs of all requests in the block with block index n . Parameters​. n (optional uint32 ):The block...
Read more >
What is block processing - Nethereum Documentation
One-off data retrieval; Inter-contract calls; Currently the processor can't ... Process block and cancel http://playground.nethereum.com/csharp/id/1022 ...
Read more >
OPERA Controls — Blocks
AUTOLOAD CONTRACT GRID PARAMETER. [AUTOLOAD_CONTRACT_GRID]. When active, the Original Grid is auto loaded into Contract grid. User has an option to 'Stop Auto ......
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