Skip to content

Commit

Permalink
RPC: throw error with data in eth_call
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottyPoi committed Jul 26, 2024
1 parent 978dff0 commit a86e07d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/client/src/rpc/modules/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,13 @@ export class Eth {
block,
}
const { execResult } = await vm.evm.runCall(runCallOpts)
if (execResult.exceptionError !== undefined) {
throw {
code: 3,
data: bytesToHex(execResult.returnValue),
message: execResult.exceptionError.error,
}
}
return bytesToHex(execResult.returnValue)
}

Expand Down

0 comments on commit a86e07d

Please sign in to comment.