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

Add support for block override in eth_call #605

Open
fvictorio opened this issue Aug 19, 2024 · 0 comments
Open

Add support for block override in eth_call #605

fvictorio opened this issue Aug 19, 2024 · 0 comments

Comments

@fvictorio
Copy link
Member

See docs here: https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-eth#eth-call

The fields to support are:

  • number
  • difficulty
  • time
  • gasLimit
  • coinbase
  • random
  • baseFee
  • blobBaseFee

Integration tests for this are relatively easy to implement. We just need to deploy a contract like this:

contract BlockOverrideTest {
  function getBlockNumber() public view returns (uint) {
    return block.number;
  }

  function getBlockTimestamp() public view returns (uint) {
    return block.timestamp;
  }

  // etc.
}

and call each function with the proper override. (Testing that multiple things can be overridden with a single call is a bit more involved, but still doable.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant