|
40 | 40 | bytes paymasterAndData;
|
41 | 41 | bytes signature;
|
42 | 42 | }
|
43 |
| - |
| 43 | + |
44 | 44 | // v0.8 UserOperation struct with packed fields
|
45 | 45 | #[derive(Debug, Default, PartialEq, Eq)]
|
46 | 46 | struct PackedUserOperation {
|
@@ -2331,7 +2331,7 @@ impl UserOperationBuilder {
|
2331 | 2331 |
|
2332 | 2332 | // Set the signature
|
2333 | 2333 | packed_op.signature = Bytes::from(signature);
|
2334 |
| - |
| 2334 | + |
2335 | 2335 | Ok(packed_op)
|
2336 | 2336 | }
|
2337 | 2337 |
|
@@ -2484,29 +2484,24 @@ fn pack_gas_values(high: U256, low: U256) -> B256 {
|
2484 | 2484 | // Take the lower 16 bytes of each value
|
2485 | 2485 | let high_bytes = high.to_be_bytes::<32>();
|
2486 | 2486 | let low_bytes = low.to_be_bytes::<32>();
|
2487 |
| - |
| 2487 | + |
2488 | 2488 | // Pack high value in first 16 bytes
|
2489 | 2489 | packed[0..16].copy_from_slice(&high_bytes[16..32]);
|
2490 | 2490 | // Pack low value in last 16 bytes
|
2491 | 2491 | packed[16..32].copy_from_slice(&low_bytes[16..32]);
|
2492 |
| - |
| 2492 | + |
2493 | 2493 | B256::from(packed)
|
2494 | 2494 | }
|
2495 | 2495 |
|
2496 | 2496 | /// Build a v0.8 PackedUserOperation from the builder values
|
2497 | 2497 | pub fn build_packed_user_operation(builder: &UserOperationBuilder) -> PackedUserOperation {
|
2498 | 2498 | // Pack gas limits: verificationGasLimit (high) and callGasLimit (low)
|
2499 |
| - let account_gas_limits = pack_gas_values( |
2500 |
| - builder.verification_gas_limit, |
2501 |
| - builder.call_gas_limit |
2502 |
| - ); |
2503 |
| - |
| 2499 | + let account_gas_limits = |
| 2500 | + pack_gas_values(builder.verification_gas_limit, builder.call_gas_limit); |
| 2501 | + |
2504 | 2502 | // Pack gas fees: maxPriorityFeePerGas (high) and maxFeePerGas (low)
|
2505 |
| - let gas_fees = pack_gas_values( |
2506 |
| - builder.max_priority_fee_per_gas, |
2507 |
| - builder.max_fee_per_gas |
2508 |
| - ); |
2509 |
| - |
| 2503 | + let gas_fees = pack_gas_values(builder.max_priority_fee_per_gas, builder.max_fee_per_gas); |
| 2504 | + |
2510 | 2505 | PackedUserOperation {
|
2511 | 2506 | sender: builder.sender,
|
2512 | 2507 | nonce: builder.nonce,
|
|
0 commit comments