Skip to content

Commit a7d1f54

Browse files
Apply suggestions from code review
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 560ecb9 commit a7d1f54

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

crates/node/src/eth_api_forwarder.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,13 @@ where
138138
self.remote
139139
.request("eth_sendRawTransaction", vec![raw_tx])
140140
.await
141-
.map_err(|e| {
142-
jsonrpsee::types::error::ErrorObject::owned(
141+
.map_err(|e| match e {
142+
jsonrpsee::core::client::ClientError::Call(obj) => obj,
143+
_ => jsonrpsee::types::error::ErrorObject::owned(
143144
jsonrpsee::types::error::INTERNAL_ERROR_CODE,
144145
format!("Failed to forward transaction: {e}"),
145146
None::<String>,
146-
)
147+
),
147148
})
148149
}
149150

@@ -153,12 +154,13 @@ where
153154
self.remote
154155
.request("eth_sendRawTransactionSync", vec![raw_tx])
155156
.await
156-
.map_err(|e| {
157-
jsonrpsee::types::error::ErrorObject::owned(
157+
.map_err(|e| match e {
158+
jsonrpsee::core::client::ClientError::Call(obj) => obj,
159+
_ => jsonrpsee::types::error::ErrorObject::owned(
158160
jsonrpsee::types::error::INTERNAL_ERROR_CODE,
159161
format!("Failed to forward transaction sync: {e}"),
160162
None::<String>,
161-
)
163+
),
162164
})
163165
}
164166

0 commit comments

Comments
 (0)