Skip to content

Commit d2cf1ba

Browse files
bhartnettchirag-parmar
authored andcommitted
Return EVM output data in eth_call when EVM execution reverts.
1 parent 9f371b3 commit d2cf1ba

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

nimbus_verified_proxy/rpc/rpc_eth_api.nim

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import
1111
results,
1212
chronicles,
13+
stew/byteutils,
1314
json_rpc/[rpcserver, rpcclient, rpcproxy],
1415
eth/common/accounts,
1516
web3/eth_api,
@@ -163,6 +164,13 @@ proc installEthApiHandlers*(vp: VerifiedRpcProxy) =
163164
let callResult = (await vp.evm.call(header, tx, optimisticStateFetch)).valueOr:
164165
raise newException(ValueError, error)
165166

167+
if callResult.error.len() > 0:
168+
raise (ref ApplicationError)(
169+
code: 3,
170+
msg: callResult.error,
171+
data: Opt.some(JsonString("\"" & callResult.output.to0xHex() & "\"")),
172+
)
173+
166174
return callResult.output
167175

168176
vp.proxy.rpc("eth_createAccessList") do(

0 commit comments

Comments
 (0)