Skip to content

Commit

Permalink
rename unavailable tree error variant
Browse files Browse the repository at this point in the history
  • Loading branch information
montekki committed Nov 13, 2023
1 parent c60b72c commit 93e0cf1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions core/lib/web3_decl/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ pub enum Web3Error {
InvalidFilterBlockHash,
#[error("Query returned more than {0} results. Try smaller range of blocks")]
TooManyLogs(usize),
#[error("getProofs API is not available")]
GetProofsUnavailable,
#[error("Tree API is not available")]
TreeApiUnavailable,
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn into_jsrpc_error(err: Web3Error) -> Error {
Web3Error::SubmitTransactionError(_, _) | Web3Error::SerializationError(_) => 3.into(),
Web3Error::PubSubTimeout => 4.into(),
Web3Error::RequestTimeout => 5.into(),
Web3Error::GetProofsUnavailable => 6.into(),
Web3Error::TreeApiUnavailable => 6.into(),
},
message: match err {
Web3Error::SubmitTransactionError(_, _) => err.to_string(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn into_jsrpc_error(err: Web3Error) -> ErrorObjectOwned {
Web3Error::SubmitTransactionError(_, _) | Web3Error::SerializationError(_) => 3,
Web3Error::PubSubTimeout => 4,
Web3Error::RequestTimeout => 5,
Web3Error::GetProofsUnavailable => 6,
Web3Error::TreeApiUnavailable => 6,
},
match err {
Web3Error::SubmitTransactionError(ref message, _) => message.clone(),
Expand Down
2 changes: 1 addition & 1 deletion core/lib/zksync_core/src/api_server/web3/namespaces/zks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ impl<G: L1GasPriceProvider> ZksNamespace<G> {
.state
.tree_api
.as_ref()
.ok_or(Web3Error::GetProofsUnavailable)?
.ok_or(Web3Error::TreeApiUnavailable)?
.get_proofs(l1_batch_number, hashed_keys)
.await
.map_err(|err| internal_error(METHOD_NAME, err))?
Expand Down

0 comments on commit 93e0cf1

Please sign in to comment.