* Decodes the result %%data%% (e.g. from an ``eth_call``) for the * specified error (see [[getError]] for valid values for * %%key%%). * * Most developers should prefer the [[parseCallResult]] method instead, * which will automatically detect a ``CALL_EXCEPTION`` and th
(fragment, data)
| 594 | * corresponding error. |
| 595 | */ |
| 596 | decodeErrorResult(fragment, data) { |
| 597 | if (typeof (fragment) === "string") { |
| 598 | const f = this.getError(fragment); |
| 599 | assertArgument(f, "unknown error", "fragment", fragment); |
| 600 | fragment = f; |
| 601 | } |
| 602 | assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data); |
| 603 | return this._decodeParams(fragment.inputs, dataSlice(data, 4)); |
| 604 | } |
| 605 | /** |
| 606 | * Encodes the transaction revert data for a call result that |
| 607 | * reverted from the the Contract with the sepcified %%error%% |
nothing calls this directly
no test coverage detected