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 46
46
if !map. contains_key ( "type" ) {
47
47
map. insert (
48
48
"type" . to_string ( ) ,
49
- serde_json:: Value :: String ( "Auto " . to_string ( ) ) ,
49
+ serde_json:: Value :: String ( "auto " . to_string ( ) ) ,
50
50
) ;
51
51
}
52
52
Original file line number Diff line number Diff line change 1
- use std:: option;
2
-
3
1
use alloy:: {
4
2
dyn_abi:: TypedData ,
5
3
primitives:: { Address , ChainId } ,
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ impl UserOpVersion {
43
43
pre_verification_gas : userop. pre_verification_gas ,
44
44
max_fee_per_gas : userop. max_fee_per_gas ,
45
45
verification_gas_limit : userop. verification_gas_limit ,
46
- sender : userop. sender . clone ( ) ,
46
+ sender : userop. sender ,
47
47
paymaster_and_data : userop. paymaster_and_data . clone ( ) ,
48
48
signature : userop. signature . clone ( ) ,
49
49
call_gas_limit : userop. call_gas_limit ,
@@ -58,7 +58,7 @@ impl UserOpVersion {
58
58
pre_verification_gas : userop. pre_verification_gas ,
59
59
max_fee_per_gas : userop. max_fee_per_gas ,
60
60
verification_gas_limit : userop. verification_gas_limit ,
61
- sender : userop. sender . clone ( ) ,
61
+ sender : userop. sender ,
62
62
paymaster_data : userop. paymaster_data . clone ( ) . unwrap_or_default ( ) ,
63
63
factory : userop. factory . unwrap_or_default ( ) ,
64
64
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(
270
270
match result {
271
271
Ok ( signature) => {
272
272
// 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
+ }
276
279
}
277
280
Err ( e) => SignResultItem :: failure ( e) ,
278
281
}
You can’t perform that action at this time.
0 commit comments