Skip to content

Commit

Permalink
Remove 'l1' from the endpoint's name
Browse files Browse the repository at this point in the history
  • Loading branch information
ilitteri committed Jan 30, 2024
1 parent 4b68d60 commit 806edd2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion core/lib/dal/src/blocks_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2147,7 +2147,7 @@ impl BlocksDal<'_, '_> {
.map(|row| row.virtual_blocks as u32))
}

pub async fn get_l1_batch_pubdata(
pub async fn get_batch_pubdata(
&mut self,
l1_batch_number: L1BatchNumber,
) -> anyhow::Result<Option<Vec<u8>>> {
Expand Down
4 changes: 2 additions & 2 deletions core/lib/web3_decl/src/namespaces/zks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,6 @@ pub trait ZksNamespace {
l1_batch_number: L1BatchNumber,
) -> RpcResult<Proof>;

#[method(name = "getL1BatchPubdata")]
async fn get_l1_batch_pubdata(&self, l1_batch_number: L1BatchNumber) -> RpcResult<Vec<u8>>;
#[method(name = "getBatchPubdata")]
async fn get_batch_pubdata(&self, l1_batch_number: L1BatchNumber) -> RpcResult<Vec<u8>>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ impl ZksNamespaceServer for ZksNamespace {
.map_err(into_jsrpc_error)
}

async fn get_l1_batch_pubdata(&self, l1_batch_number: L1BatchNumber) -> RpcResult<Vec<u8>> {
self.get_l1_batch_pubdata_impl(l1_batch_number)
async fn get_batch_pubdata(&self, l1_batch_number: L1BatchNumber) -> RpcResult<Vec<u8>> {
self.get_batch_pubdata_impl(l1_batch_number)
.await
.map_err(into_jsrpc_error)
}
Expand Down
6 changes: 3 additions & 3 deletions core/lib/zksync_core/src/api_server/web3/namespaces/zks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,18 +644,18 @@ impl ZksNamespace {
}

#[tracing::instrument(skip(self))]
pub async fn get_l1_batch_pubdata_impl(
pub async fn get_batch_pubdata_impl(
&self,
l1_batch_number: L1BatchNumber,
) -> Result<Vec<u8>, Web3Error> {
const METHOD_NAME: &str = "get_l1_batch_pubdata";
const METHOD_NAME: &str = "get_batch_pubdata";

let method_latency = API_METRICS.start_call(METHOD_NAME);
self.state.start_info.ensure_not_pruned(l1_batch_number)?;
let mut storage = self.access_storage(METHOD_NAME).await?;
let pubdata = storage
.blocks_dal()
.get_l1_batch_pubdata(l1_batch_number)
.get_batch_pubdata(l1_batch_number)
.await
.map_err(|_err| Web3Error::PubdataNotFound)?
.unwrap_or_default();
Expand Down

0 comments on commit 806edd2

Please sign in to comment.