Commit 668ec50
authored
feat(l1, l2): add EIP-1898 blockHash support to eth_call (#6130)
## Summary
- Add support for the `blockHash` parameter to `eth_call` as specified
in [EIP-1898](https://eips.ethereum.org/EIPS/eip-1898)
- Previously, 5 of 6 EIP-1898 methods supported block hashes; only
`eth_call` used `BlockIdentifier` instead of `BlockIdentifierOrHash`
- Now all 6 methods are consistent: `eth_getBalance`,
`eth_getStorageAt`, `eth_getTransactionCount`, `eth_getCode`,
`eth_call`, and `eth_getProof`
## Changes
- Add `resolve_block_header()` method to `BlockIdentifierOrHash` in
`block_identifier.rs`
- Update `CallRequest` struct to use `BlockIdentifierOrHash` instead of
`BlockIdentifier` in `transaction.rs`
## Test plan
- [x] `cargo build -p ethrex-rpc` passes
- [x] `cargo test -p ethrex-rpc` passes (46 tests)1 parent c13cd03 commit 668ec50
2 files changed
Lines changed: 17 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
94 | 103 | | |
95 | 104 | | |
96 | 105 | | |
| |||
0 commit comments