feat: Include missing block id in error responses (#7416)

Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Ryan Schneider
2024-09-07 04:02:17 -07:00
committed by GitHub
parent e7defb2334
commit 7a20b413f5
25 changed files with 301 additions and 251 deletions

View File

@ -106,7 +106,7 @@ pub trait DebugApi {
async fn debug_trace_call(
&self,
request: TransactionRequest,
block_number: Option<BlockId>,
block_id: Option<BlockId>,
opts: Option<GethDebugTracingCallOptions>,
) -> RpcResult<GethTrace>;

View File

@ -238,14 +238,14 @@ pub trait EngineEthApi<B: RpcObject> {
async fn call(
&self,
request: TransactionRequest,
block_number: Option<BlockId>,
block_id: Option<BlockId>,
state_overrides: Option<StateOverride>,
block_overrides: Option<Box<BlockOverrides>>,
) -> RpcResult<Bytes>;
/// Returns code at a given address at given block number.
#[method(name = "getCode")]
async fn get_code(&self, address: Address, block_number: Option<BlockId>) -> RpcResult<Bytes>;
async fn get_code(&self, address: Address, block_id: Option<BlockId>) -> RpcResult<Bytes>;
/// Returns information about a block by hash.
#[method(name = "getBlockByHash")]

View File

@ -1,5 +1,5 @@
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::{Address, Bytes, TxHash, B256};
use reth_primitives::{Address, BlockId, Bytes, TxHash, B256};
use reth_rpc_types::{
trace::otterscan::{
BlockDetails, ContractCreator, InternalOperation, OtsBlockTransactions, TraceEntry,
@ -24,7 +24,7 @@ pub trait Otterscan {
/// Check if a certain address contains a deployed code.
#[method(name = "hasCode")]
async fn has_code(&self, address: Address, block_number: Option<u64>) -> RpcResult<bool>;
async fn has_code(&self, address: Address, block_id: Option<BlockId>) -> RpcResult<bool>;
/// Very simple API versioning scheme. Every time we add a new capability, the number is
/// incremented. This allows for Otterscan to check if the node contains all API it