Skip to content

Commit

Permalink
Revert on Json RPC error (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
pistomat authored Jul 1, 2024
1 parent 1951066 commit 17db5e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/protocols/EthJsonRPC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ contract EthJsonRPC {
bytes memory output = Suave.doHTTPRequest(request);

JSONParserLib.Item memory item = string(output).parse();
JSONParserLib.Item memory err = item.at('"error"');
if (!err.isUndefined()) {
revert(err.value());
}
return item.at('"result"');
}

Expand Down

0 comments on commit 17db5e0

Please sign in to comment.