From 2de4654fb2dae6e101d9c43ffe2a2f4f143fb430 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Tue, 17 Oct 2023 10:05:49 -0700 Subject: [PATCH] check one more error message --- web3_proxy/src/app/mod.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/web3_proxy/src/app/mod.rs b/web3_proxy/src/app/mod.rs index 6b56cd3d..440868d4 100644 --- a/web3_proxy/src/app/mod.rs +++ b/web3_proxy/src/app/mod.rs @@ -1427,9 +1427,14 @@ impl App { // that's not really an error. Return the hash like a successful response would. // TODO: move this to a helper function. probably part of try_send_protected if let ForwardedResponse::RpcError{ error_data, ..} = &response { - if error_data.code == -32000 - && (error_data.message == "ALREADY_EXISTS: already known" - || error_data.message == "INTERNAL_ERROR: existing tx with same hash") + let acceptable_error_messages = [ + "already known", + "ALREADY_EXISTS: already known", + "INTERNAL_ERROR: existing tx with same hash", + "", + ]; + + if acceptable_error_messages.contains(&error_data.message.as_ref()) { let params = web3_request.inner.params() .as_array()