@@ -321,8 +321,6 @@ pub struct InnerTransaction {
321321 pub data : Option < String > ,
322322 pub extra_sections : HashMap < Id , Vec < u8 > > ,
323323 pub notes : u64 ,
324- // FIXME: should this be on the wrapper?
325- pub is_masp_fee_payment : bool ,
326324 pub exit_code : TransactionExitStatus ,
327325}
328326
@@ -337,7 +335,7 @@ impl InnerTransaction {
337335 pub fn was_successful ( & self , wrapper_tx : & WrapperTransaction ) -> bool {
338336 self . exit_code == TransactionExitStatus :: Applied
339337 && ( wrapper_tx. exit_code == TransactionExitStatus :: Applied
340- || self . is_masp_fee_payment )
338+ || wrapper_tx . fee . masp_fee_payment )
341339 }
342340
343341 pub fn is_ibc ( & self ) -> bool {
@@ -358,6 +356,7 @@ pub struct Fee {
358356 pub amount_per_gas_unit : String ,
359357 pub gas_payer : Id ,
360358 pub gas_token : Id ,
359+ pub masp_fee_payment : bool ,
361360}
362361
363362impl Transaction {
@@ -382,36 +381,7 @@ impl Transaction {
382381 match transaction. header ( ) . tx_type {
383382 TxType :: Wrapper ( wrapper) => {
384383 let wrapper_tx_id = Id :: from ( transaction. header_hash ( ) ) ;
385- let wrapper_tx_status =
386- block_results. is_wrapper_tx_applied ( & wrapper_tx_id) ;
387- let gas_used = block_results
388- . gas_used ( & wrapper_tx_id)
389- . map ( |gas| gas. parse :: < u64 > ( ) . unwrap ( ) ) ;
390-
391- let fee = Fee {
392- gas : Uint :: from ( wrapper. gas_limit ) . to_string ( ) ,
393- gas_used,
394- amount_per_gas_unit : wrapper
395- . fee
396- . amount_per_gas_unit
397- . to_string_precise ( ) ,
398- gas_payer : Id :: from ( wrapper. fee_payer ( ) ) ,
399- gas_token : Id :: from ( wrapper. fee . token ) ,
400- } ;
401-
402- let atomic = transaction. header ( ) . atomic ;
403-
404- let wrapper_tx = WrapperTransaction {
405- tx_id : wrapper_tx_id. clone ( ) ,
406- index,
407- fee,
408- atomic,
409- block_height,
410- exit_code : wrapper_tx_status. clone ( ) ,
411- total_signatures,
412- size : tx_size,
413- } ;
414-
384+ let mut masp_fee_payment = false ;
415385 let mut inner_txs = vec ! [ ] ;
416386
417387 for ( batch_index, tx_commitment) in
@@ -543,6 +513,10 @@ impl Transaction {
543513 } ,
544514 ) ;
545515
516+ if is_masp_fee_payment {
517+ masp_fee_payment = true ;
518+ }
519+
546520 let inner_tx = InnerTransaction {
547521 tx_id : inner_tx_id,
548522 index : batch_index,
@@ -553,12 +527,41 @@ impl Transaction {
553527 notes,
554528 exit_code : inner_tx_status,
555529 kind : tx_kind,
556- is_masp_fee_payment,
557530 } ;
558531
559532 inner_txs. push ( inner_tx) ;
560533 }
561534
535+ let wrapper_tx_status =
536+ block_results. is_wrapper_tx_applied ( & wrapper_tx_id) ;
537+ let gas_used = block_results
538+ . gas_used ( & wrapper_tx_id)
539+ . map ( |gas| gas. parse :: < u64 > ( ) . unwrap ( ) ) ;
540+ let atomic = transaction. header ( ) . atomic ;
541+
542+ let fee = Fee {
543+ gas : Uint :: from ( wrapper. gas_limit ) . to_string ( ) ,
544+ gas_used,
545+ amount_per_gas_unit : wrapper
546+ . fee
547+ . amount_per_gas_unit
548+ . to_string_precise ( ) ,
549+ gas_payer : Id :: from ( wrapper. fee_payer ( ) ) ,
550+ gas_token : Id :: from ( wrapper. fee . token ) ,
551+ masp_fee_payment,
552+ } ;
553+
554+ let wrapper_tx = WrapperTransaction {
555+ tx_id : wrapper_tx_id. clone ( ) ,
556+ index,
557+ fee,
558+ atomic,
559+ block_height,
560+ exit_code : wrapper_tx_status. clone ( ) ,
561+ total_signatures,
562+ size : tx_size,
563+ } ;
564+
562565 Ok ( ( wrapper_tx, inner_txs) )
563566 }
564567 TxType :: Raw => {
0 commit comments