edr
edr copied to clipboard
Add support for block override in `eth_call`
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.)