@@ -492,96 +492,6 @@ impl TypedTransaction {
492492 }
493493 }
494494
495- /// Returns a helper type that contains commonly used values as fields
496- pub fn essentials ( & self ) -> TransactionEssentials {
497- match self {
498- Self :: Legacy ( t) => TransactionEssentials {
499- kind : t. tx ( ) . to ,
500- input : t. tx ( ) . input . clone ( ) ,
501- nonce : t. tx ( ) . nonce ,
502- gas_limit : t. tx ( ) . gas_limit ,
503- gas_price : Some ( t. tx ( ) . gas_price ) ,
504- max_fee_per_gas : None ,
505- max_priority_fee_per_gas : None ,
506- max_fee_per_blob_gas : None ,
507- blob_versioned_hashes : None ,
508- value : t. tx ( ) . value ,
509- chain_id : t. tx ( ) . chain_id ,
510- access_list : Default :: default ( ) ,
511- } ,
512- Self :: EIP2930 ( t) => TransactionEssentials {
513- kind : t. tx ( ) . to ,
514- input : t. tx ( ) . input . clone ( ) ,
515- nonce : t. tx ( ) . nonce ,
516- gas_limit : t. tx ( ) . gas_limit ,
517- gas_price : Some ( t. tx ( ) . gas_price ) ,
518- max_fee_per_gas : None ,
519- max_priority_fee_per_gas : None ,
520- max_fee_per_blob_gas : None ,
521- blob_versioned_hashes : None ,
522- value : t. tx ( ) . value ,
523- chain_id : Some ( t. tx ( ) . chain_id ) ,
524- access_list : t. tx ( ) . access_list . clone ( ) ,
525- } ,
526- Self :: EIP1559 ( t) => TransactionEssentials {
527- kind : t. tx ( ) . to ,
528- input : t. tx ( ) . input . clone ( ) ,
529- nonce : t. tx ( ) . nonce ,
530- gas_limit : t. tx ( ) . gas_limit ,
531- gas_price : None ,
532- max_fee_per_gas : Some ( t. tx ( ) . max_fee_per_gas ) ,
533- max_priority_fee_per_gas : Some ( t. tx ( ) . max_priority_fee_per_gas ) ,
534- max_fee_per_blob_gas : None ,
535- blob_versioned_hashes : None ,
536- value : t. tx ( ) . value ,
537- chain_id : Some ( t. tx ( ) . chain_id ) ,
538- access_list : t. tx ( ) . access_list . clone ( ) ,
539- } ,
540- Self :: EIP4844 ( t) => TransactionEssentials {
541- kind : TxKind :: Call ( t. tx ( ) . tx ( ) . to ) ,
542- input : t. tx ( ) . tx ( ) . input . clone ( ) ,
543- nonce : t. tx ( ) . tx ( ) . nonce ,
544- gas_limit : t. tx ( ) . tx ( ) . gas_limit ,
545- gas_price : None ,
546- max_fee_per_gas : Some ( t. tx ( ) . tx ( ) . max_fee_per_gas ) ,
547- max_priority_fee_per_gas : Some ( t. tx ( ) . tx ( ) . max_priority_fee_per_gas ) ,
548- max_fee_per_blob_gas : Some ( t. tx ( ) . tx ( ) . max_fee_per_blob_gas ) ,
549- blob_versioned_hashes : Some ( t. tx ( ) . tx ( ) . blob_versioned_hashes . clone ( ) ) ,
550- value : t. tx ( ) . tx ( ) . value ,
551- chain_id : Some ( t. tx ( ) . tx ( ) . chain_id ) ,
552- access_list : t. tx ( ) . tx ( ) . access_list . clone ( ) ,
553- } ,
554- Self :: EIP7702 ( t) => TransactionEssentials {
555- kind : TxKind :: Call ( t. tx ( ) . to ) ,
556- input : t. tx ( ) . input . clone ( ) ,
557- nonce : t. tx ( ) . nonce ,
558- gas_limit : t. tx ( ) . gas_limit ,
559- gas_price : None ,
560- max_fee_per_gas : Some ( t. tx ( ) . max_fee_per_gas ) ,
561- max_priority_fee_per_gas : Some ( t. tx ( ) . max_priority_fee_per_gas ) ,
562- max_fee_per_blob_gas : None ,
563- blob_versioned_hashes : None ,
564- value : t. tx ( ) . value ,
565- chain_id : Some ( t. tx ( ) . chain_id ) ,
566- access_list : t. tx ( ) . access_list . clone ( ) ,
567- } ,
568- Self :: Deposit ( t) => TransactionEssentials {
569- kind : t. to ,
570- input : t. input . clone ( ) ,
571- nonce : 0 ,
572- gas_limit : t. gas_limit ,
573- gas_price : Some ( 0 ) ,
574- max_fee_per_gas : None ,
575- max_priority_fee_per_gas : None ,
576- max_fee_per_blob_gas : None ,
577- blob_versioned_hashes : None ,
578- value : t. value ,
579- chain_id : t. chain_id ( ) ,
580- access_list : Default :: default ( ) ,
581- } ,
582- }
583- }
584-
585495 pub fn as_legacy ( & self ) -> Option < & Signed < TxLegacy > > {
586496 match self {
587497 Self :: Legacy ( tx) => Some ( tx) ,
0 commit comments