@@ -87,8 +87,8 @@ pub fn transaction_request_to_typed(
87
87
to,
88
88
) {
89
89
// legacy transaction
90
- ( Some ( 0 ) , _, None , None , None , None , None , None , _) |
91
- ( None , Some ( _) , None , None , None , None , None , None , _) => {
90
+ ( Some ( 0 ) , _, None , None , None , None , None , None , _)
91
+ | ( None , Some ( _) , None , None , None , None , None , None , _) => {
92
92
Some ( TypedTransactionRequest :: Legacy ( TxLegacy {
93
93
nonce : nonce. unwrap_or_default ( ) ,
94
94
gas_price : gas_price. unwrap_or_default ( ) ,
@@ -100,8 +100,8 @@ pub fn transaction_request_to_typed(
100
100
} ) )
101
101
}
102
102
// EIP2930
103
- ( Some ( 1 ) , _, None , None , _, None , None , None , _) |
104
- ( None , _, None , None , Some ( _) , None , None , None , _) => {
103
+ ( Some ( 1 ) , _, None , None , _, None , None , None , _)
104
+ | ( None , _, None , None , Some ( _) , None , None , None , _) => {
105
105
Some ( TypedTransactionRequest :: EIP2930 ( TxEip2930 {
106
106
nonce : nonce. unwrap_or_default ( ) ,
107
107
gas_price : gas_price. unwrap_or_default ( ) ,
@@ -114,10 +114,10 @@ pub fn transaction_request_to_typed(
114
114
} ) )
115
115
}
116
116
// EIP1559
117
- ( Some ( 2 ) , None , _, _, _, _, None , None , _) |
118
- ( None , None , Some ( _) , _, _, _, None , None , _) |
119
- ( None , None , _, Some ( _) , _, _, None , None , _) |
120
- ( None , None , None , None , None , _, None , None , _) => {
117
+ ( Some ( 2 ) , None , _, _, _, _, None , None , _)
118
+ | ( None , None , Some ( _) , _, _, _, None , None , _)
119
+ | ( None , None , _, Some ( _) , _, _, None , None , _)
120
+ | ( None , None , None , None , None , _, None , None , _) => {
121
121
// Empty fields fall back to the canonical transaction schema.
122
122
Some ( TypedTransactionRequest :: EIP1559 ( TxEip1559 {
123
123
nonce : nonce. unwrap_or_default ( ) ,
@@ -163,9 +163,9 @@ pub fn transaction_request_to_typed(
163
163
}
164
164
165
165
fn has_optimism_fields ( other : & OtherFields ) -> bool {
166
- other. contains_key ( "sourceHash" ) &&
167
- other. contains_key ( "mint" ) &&
168
- other. contains_key ( "isSystemTx" )
166
+ other. contains_key ( "sourceHash" )
167
+ && other. contains_key ( "mint" )
168
+ && other. contains_key ( "isSystemTx" )
169
169
}
170
170
171
171
#[ derive( Clone , Debug , PartialEq , Eq ) ]
@@ -214,7 +214,7 @@ impl MaybeImpersonatedTransaction {
214
214
/// Returns the hash of the transaction
215
215
pub fn hash ( & self ) -> B256 {
216
216
if let Some ( sender) = self . impersonated_sender {
217
- return self . transaction . impersonated_hash ( sender)
217
+ return self . transaction . impersonated_hash ( sender) ;
218
218
}
219
219
self . transaction . hash ( )
220
220
}
@@ -1047,7 +1047,7 @@ impl Encodable2718 for TypedTransaction {
1047
1047
impl Decodable2718 for TypedTransaction {
1048
1048
fn typed_decode ( ty : u8 , buf : & mut & [ u8 ] ) -> Result < Self , Eip2718Error > {
1049
1049
if ty == 0x7E {
1050
- return Ok ( Self :: Deposit ( DepositTransaction :: decode ( buf) ?) )
1050
+ return Ok ( Self :: Deposit ( DepositTransaction :: decode ( buf) ?) ) ;
1051
1051
}
1052
1052
match TxEnvelope :: typed_decode ( ty, buf) ? {
1053
1053
TxEnvelope :: Eip2930 ( tx) => Ok ( Self :: EIP2930 ( tx) ) ,
@@ -1122,12 +1122,12 @@ pub struct DepositReceipt<T = Receipt<alloy_primitives::Log>> {
1122
1122
1123
1123
impl DepositReceipt {
1124
1124
fn payload_len ( & self ) -> usize {
1125
- self . inner . receipt . status . length ( ) +
1126
- self . inner . receipt . cumulative_gas_used . length ( ) +
1127
- self . inner . logs_bloom . length ( ) +
1128
- self . inner . receipt . logs . length ( ) +
1129
- self . deposit_nonce . map_or ( 0 , |n| n. length ( ) ) +
1130
- self . deposit_receipt_version . map_or ( 0 , |n| n. length ( ) )
1125
+ self . inner . receipt . status . length ( )
1126
+ + self . inner . receipt . cumulative_gas_used . length ( )
1127
+ + self . inner . logs_bloom . length ( )
1128
+ + self . inner . receipt . logs . length ( )
1129
+ + self . deposit_nonce . map_or ( 0 , |n| n. length ( ) )
1130
+ + self . deposit_receipt_version . map_or ( 0 , |n| n. length ( ) )
1131
1131
}
1132
1132
1133
1133
/// Returns the rlp header for the receipt payload.
@@ -1227,11 +1227,11 @@ pub enum TypedReceipt<T = Receipt<alloy_primitives::Log>> {
1227
1227
impl < T > TypedReceipt < T > {
1228
1228
pub fn as_receipt_with_bloom ( & self ) -> & ReceiptWithBloom < T > {
1229
1229
match self {
1230
- Self :: Legacy ( r) |
1231
- Self :: EIP1559 ( r) |
1232
- Self :: EIP2930 ( r) |
1233
- Self :: EIP4844 ( r) |
1234
- Self :: EIP7702 ( r) => r,
1230
+ Self :: Legacy ( r)
1231
+ | Self :: EIP1559 ( r)
1232
+ | Self :: EIP2930 ( r)
1233
+ | Self :: EIP4844 ( r)
1234
+ | Self :: EIP7702 ( r) => r,
1235
1235
Self :: Deposit ( r) => & r. inner ,
1236
1236
}
1237
1237
}
@@ -1240,11 +1240,11 @@ impl<T> TypedReceipt<T> {
1240
1240
impl < T > From < TypedReceipt < T > > for ReceiptWithBloom < T > {
1241
1241
fn from ( value : TypedReceipt < T > ) -> Self {
1242
1242
match value {
1243
- TypedReceipt :: Legacy ( r) |
1244
- TypedReceipt :: EIP1559 ( r) |
1245
- TypedReceipt :: EIP2930 ( r) |
1246
- TypedReceipt :: EIP4844 ( r) |
1247
- TypedReceipt :: EIP7702 ( r) => r,
1243
+ TypedReceipt :: Legacy ( r)
1244
+ | TypedReceipt :: EIP1559 ( r)
1245
+ | TypedReceipt :: EIP2930 ( r)
1246
+ | TypedReceipt :: EIP4844 ( r)
1247
+ | TypedReceipt :: EIP7702 ( r) => r,
1248
1248
TypedReceipt :: Deposit ( r) => r. inner ,
1249
1249
}
1250
1250
}
@@ -1412,11 +1412,11 @@ impl Encodable2718 for TypedReceipt {
1412
1412
out. put_u8 ( ty) ;
1413
1413
}
1414
1414
match self {
1415
- Self :: Legacy ( r) |
1416
- Self :: EIP2930 ( r) |
1417
- Self :: EIP1559 ( r) |
1418
- Self :: EIP4844 ( r) |
1419
- Self :: EIP7702 ( r) => r. encode ( out) ,
1415
+ Self :: Legacy ( r)
1416
+ | Self :: EIP2930 ( r)
1417
+ | Self :: EIP1559 ( r)
1418
+ | Self :: EIP4844 ( r)
1419
+ | Self :: EIP7702 ( r) => r. encode ( out) ,
1420
1420
Self :: Deposit ( r) => r. encode ( out) ,
1421
1421
}
1422
1422
}
0 commit comments