@@ -732,14 +732,6 @@ where
732732
733733 let result_code = ResultCode :: from_u32 ( processed_tx. result . code )
734734 . expect ( "Result code conversion should not fail" ) ;
735- // The number of the `tx_results` has to match the number of txs in
736- // request, otherwise Comet crashes consensus with "failed to apply
737- // block; error expected tx results length to match size of
738- // transactions in block."
739- tx_results. push ( tendermint:: abci:: types:: ExecTxResult {
740- code : result_code. into ( ) ,
741- ..Default :: default ( )
742- } ) ;
743735
744736 let tx_header = tx. header ( ) ;
745737 // If [`process_proposal`] rejected a Tx, emit an event here and
@@ -902,7 +894,18 @@ where
902894 let consumed_gas = tx_gas_meter. get_consumed_gas ( ) ;
903895
904896 // save the gas cost
905- self . update_tx_gas ( tx_hash, consumed_gas) ;
897+ self . update_tx_gas ( tx_hash, consumed_gas. clone ( ) ) ;
898+
899+ // The number of the `tx_results` has to match the number of txs in
900+ // request, otherwise Comet crashes consensus with "failed to apply
901+ // block; error expected tx results length to match size of
902+ // transactions in block."
903+ tx_results. push ( tendermint:: abci:: types:: ExecTxResult {
904+ code : result_code. into ( ) ,
905+ gas_used : i64:: try_from ( u64:: from ( consumed_gas) )
906+ . unwrap_or_default ( ) ,
907+ ..Default :: default ( )
908+ } ) ;
906909
907910 if let Some ( wrapper_cache) = self . evaluate_tx_result (
908911 events,
0 commit comments