Skip to content

Commit

Permalink
refactor early return to ?
Browse files Browse the repository at this point in the history
  • Loading branch information
itegulov committed Feb 22, 2024
1 parent f4bdba4 commit 34ab2b1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/lib/zksync_core/src/api_server/web3/namespaces/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,9 +612,11 @@ impl EthNamespace {
const METHOD_NAME: &str = "new_filter";

let method_latency = API_METRICS.start_call(METHOD_NAME);
let Some(installed_filters) = &self.state.installed_filters else {
return Err(Web3Error::NotImplemented);
};
let installed_filters = self
.state
.installed_filters
.as_ref()
.ok_or(Web3Error::NotImplemented)?;
if let Some(topics) = filter.topics.as_ref() {
if topics.len() > EVENT_TOPIC_NUMBER_LIMIT {
return Err(Web3Error::TooManyTopics);
Expand Down

0 comments on commit 34ab2b1

Please sign in to comment.