Skip to content

Commit

Permalink
apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Artemka374 committed Dec 6, 2023
1 parent 7074c15 commit 8df660a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/lib/dal/src/blocks_web3_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl BlocksWeb3Dal<'_, '_> {
}))
}

/// Returns hashes of blocks with numbers greater than `from_block` and the number of the last block.
/// Returns hashes of blocks with numbers starting from `from_block` and the number of the last block.
pub async fn get_block_hashes_since(
&mut self,
from_block: MiniblockNumber,
Expand Down
9 changes: 3 additions & 6 deletions core/lib/zksync_core/src/api_server/web3/namespaces/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ impl<G: L1GasPriceProvider> EthNamespace<G> {
FilterChanges::Hashes(block_hashes)
}

TypedFilter::PendingTransactions(from_timestamp) => {
TypedFilter::PendingTransactions(from_timestamp_excluded) => {
let mut conn = self
.state
.connection_pool
Expand All @@ -795,16 +795,13 @@ impl<G: L1GasPriceProvider> EthNamespace<G> {
let (tx_hashes, last_timestamp) = conn
.transactions_web3_dal()
.get_pending_txs_hashes_after(
*from_timestamp,
*from_timestamp_excluded,
Some(self.state.api_config.req_entities_limit),
)
.await
.map_err(|err| internal_error(METHOD_NAME, err))?;

*from_timestamp = match last_timestamp {
Some(last_timestamp) => last_timestamp,
None => *from_timestamp,
};
*from_timestamp_excluded = last_timestamp.unwrap_or(*from_timestamp_excluded);

FilterChanges::Hashes(tx_hashes)
}
Expand Down

0 comments on commit 8df660a

Please sign in to comment.