Skip to content

Commit

Permalink
chore: adds proper null response to zks_batchDetails method (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
dutterbutter authored Oct 2, 2023
1 parent f19fe6c commit cc00030
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/zks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,26 @@ impl<S: Send + Sync + 'static + ForkSource + std::fmt::Debug> ZksNamespaceT
not_implemented!()
}

/// Retrieves details for a given L1 batch.
///
/// This method is intended to handle queries related to L1 batch details. However, as of the current implementation,
/// L1 communication is not supported. Instead of an error or no method found, this method intentionally returns
/// `{"jsonrpc":"2.0","result":null,"id":1}` to ensure compatibility with block explorer integration.
///
/// # Parameters
///
/// * `_batch`: The batch number of type `zksync_basic_types::L1BatchNumber` for which the details are to be fetched.
///
/// # Returns
///
/// A boxed future resolving to a `jsonrpc_core::Result` containing an `Option` of `zksync_types::api::L1BatchDetails`.
/// Given the current implementation, this will always be `None`.
fn get_l1_batch_details(
&self,
_batch: zksync_basic_types::L1BatchNumber,
) -> jsonrpc_core::BoxFuture<jsonrpc_core::Result<Option<zksync_types::api::L1BatchDetails>>>
{
not_implemented!()
Box::pin(async { Ok(None) })
}

fn get_bytecode_by_hash(
Expand Down

0 comments on commit cc00030

Please sign in to comment.