@@ -311,7 +311,9 @@ impl<'a> TryInto<Transaction<AnyTxEnvelope>> for TransactionTraceAt<'a> {
311
311
}
312
312
TxType :: Eip2930 => {
313
313
let tx = TxEip2930 {
314
- chain_id : 0 , // TODO(alloy_migration): extract actual chain_id from trace (0 = placeholder)
314
+ // Firehose protobuf doesn't provide chain_id for transactions.
315
+ // Using 0 as placeholder since the transaction has already been validated on-chain.
316
+ chain_id : 0 ,
315
317
nonce,
316
318
gas_price,
317
319
gas_limit,
@@ -329,7 +331,9 @@ impl<'a> TryInto<Transaction<AnyTxEnvelope>> for TransactionTraceAt<'a> {
329
331
}
330
332
TxType :: Eip1559 => {
331
333
let tx = TxEip1559 {
332
- chain_id : 0 , // TODO(alloy_migration): extract actual chain_id from trace (0 = placeholder)
334
+ // Firehose protobuf doesn't provide chain_id for transactions.
335
+ // Using 0 as placeholder since the transaction has already been validated on-chain.
336
+ chain_id : 0 ,
333
337
nonce,
334
338
gas_limit,
335
339
max_fee_per_gas : max_fee_per_gas_u128,
@@ -365,7 +369,9 @@ impl<'a> TryInto<Transaction<AnyTxEnvelope>> for TransactionTraceAt<'a> {
365
369
} ) ;
366
370
367
371
let tx_eip4844 = TxEip4844 {
368
- chain_id : 0 , // TODO(alloy_migration): extract actual chain_id from trace (0 = placeholder)
372
+ // Firehose protobuf doesn't provide chain_id for transactions.
373
+ // Using 0 as placeholder since the transaction has already been validated on-chain.
374
+ chain_id : 0 ,
369
375
nonce,
370
376
gas_limit,
371
377
max_fee_per_gas : max_fee_per_gas_u128,
@@ -391,14 +397,31 @@ impl<'a> TryInto<Transaction<AnyTxEnvelope>> for TransactionTraceAt<'a> {
391
397
} ) ?;
392
398
393
399
// Convert set_code_authorizations to alloy authorization list
394
- // Note: Alloy's SignedAuthorization expects the full authorization data
395
- // For now, we'll leave this empty as converting the protobuf SetCodeAuthorization
396
- // to alloy's SignedAuthorization requires signature reconstruction which is complex.
397
- // The authorization data is available in self.trace.set_code_authorizations if needed.
398
- let authorization_list = Vec :: new ( ) ; // TODO(alloy_migration): Complex conversion from SetCodeAuthorization to alloy::consensus::SignedAuthorization
400
+ let authorization_list: Vec < alloy:: eips:: eip7702:: SignedAuthorization > = self
401
+ . trace
402
+ . set_code_authorizations
403
+ . iter ( )
404
+ . map ( |auth| {
405
+ let inner = alloy:: eips:: eip7702:: Authorization {
406
+ chain_id : U256 :: from_be_slice ( & auth. chain_id ) ,
407
+ address : Address :: from_slice ( & auth. address ) ,
408
+ nonce : auth. nonce ,
409
+ } ;
410
+
411
+ let r = U256 :: from_be_slice ( & auth. r ) ;
412
+ let s = U256 :: from_be_slice ( & auth. s ) ;
413
+ let y_parity = auth. v as u8 ;
414
+
415
+ alloy:: eips:: eip7702:: SignedAuthorization :: new_unchecked (
416
+ inner, y_parity, r, s,
417
+ )
418
+ } )
419
+ . collect ( ) ;
399
420
400
421
let tx = TxEip7702 {
401
- chain_id : 0 , // TODO(alloy_migration): extract actual chain_id from trace (0 = placeholder)
422
+ // Firehose protobuf doesn't provide chain_id for transactions.
423
+ // Using 0 as placeholder since the transaction has already been validated on-chain.
424
+ chain_id : 0 ,
402
425
nonce,
403
426
gas_limit,
404
427
max_fee_per_gas : max_fee_per_gas_u128,
0 commit comments