Skip to content

Commit

Permalink
estimate_gas should handle exit reason (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci authored Oct 27, 2020
1 parent d2084dd commit bb79f23
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rpc/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ impl<B, C, P, CT, BE, H: ExHashT> EthApiT for EthApi<B, C, P, CT, BE, H> where
.map_err(|err| internal_err(format!("runtime error: {:?}", err)))?
.map_err(|err| internal_err(format!("execution fatal: {:?}", err)))?;

error_on_execution_failure(&info.exit_reason, &info.value)?;

info.used_gas
},
None => {
Expand All @@ -591,6 +593,8 @@ impl<B, C, P, CT, BE, H: ExHashT> EthApiT for EthApi<B, C, P, CT, BE, H> where
.map_err(|err| internal_err(format!("runtime error: {:?}", err)))?
.map_err(|err| internal_err(format!("execution fatal: {:?}", err)))?;

error_on_execution_failure(&info.exit_reason, &[])?;

info.used_gas
},
};
Expand Down

0 comments on commit bb79f23

Please sign in to comment.