File tree Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 1- use std:: option;
2-
31use alloy:: {
42 dyn_abi:: TypedData ,
53 primitives:: { Address , ChainId } ,
Original file line number Diff line number Diff 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 ( ) ,
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments