From 10cbcbbeb8303d26abc54ccbcfec5caa26201c9c Mon Sep 17 00:00:00 2001 From: Ermal Kaleci Date: Tue, 27 Oct 2020 14:31:52 +0100 Subject: [PATCH] estimate_gas should handle exit reason (#174) --- rpc/src/eth.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rpc/src/eth.rs b/rpc/src/eth.rs index d24c4f75c4..eb151a0fca 100644 --- a/rpc/src/eth.rs +++ b/rpc/src/eth.rs @@ -575,6 +575,8 @@ impl EthApiT for EthApi 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 => { @@ -591,6 +593,8 @@ impl EthApiT for EthApi 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 }, };