Skip to content

Commit db2d5d8

Browse files
committed
address review feedback
1 parent 70dd5e2 commit db2d5d8

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

core/src/execution_options/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ where
4646
if !map.contains_key("type") {
4747
map.insert(
4848
"type".to_string(),
49-
serde_json::Value::String("Auto".to_string()),
49+
serde_json::Value::String("auto".to_string()),
5050
);
5151
}
5252

core/src/signer.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::option;
2-
31
use alloy::{
42
dyn_abi::TypedData,
53
primitives::{Address, ChainId},

core/src/userop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl UserOpVersion {
4343
pre_verification_gas: userop.pre_verification_gas,
4444
max_fee_per_gas: userop.max_fee_per_gas,
4545
verification_gas_limit: userop.verification_gas_limit,
46-
sender: userop.sender.clone(),
46+
sender: userop.sender,
4747
paymaster_and_data: userop.paymaster_and_data.clone(),
4848
signature: userop.signature.clone(),
4949
call_gas_limit: userop.call_gas_limit,
@@ -58,7 +58,7 @@ impl UserOpVersion {
5858
pre_verification_gas: userop.pre_verification_gas,
5959
max_fee_per_gas: userop.max_fee_per_gas,
6060
verification_gas_limit: userop.verification_gas_limit,
61-
sender: userop.sender.clone(),
61+
sender: userop.sender,
6262
paymaster_data: userop.paymaster_data.clone().unwrap_or_default(),
6363
factory: userop.factory.unwrap_or_default(),
6464
factory_data: userop.factory_data.clone().unwrap_or_default(),

server/src/http/routes/sign_typed_data.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,12 @@ async fn sign_single_typed_data(
270270
match result {
271271
Ok(signature) => {
272272
// Convert typed data to JSON string for signed_data field
273-
let signed_data = serde_json::to_string(typed_data)
274-
.unwrap_or_else(|_| "Failed to serialize typed data".to_string());
275-
SignResultItem::success(signature, signed_data)
273+
match serde_json::to_string(typed_data) {
274+
Ok(signed_data) => SignResultItem::success(signature, signed_data),
275+
Err(e) => SignResultItem::failure(EngineError::ValidationError {
276+
message: format!("Failed to serialize typed data: {}", e),
277+
}),
278+
}
276279
}
277280
Err(e) => SignResultItem::failure(e),
278281
}

0 commit comments

Comments
 (0)