* 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: ErrorFragment | string, data: BytesLike)
| 812 | * corresponding error. |
| 813 | */ |
| 814 | decodeErrorResult(fragment: ErrorFragment | string, data: BytesLike): Result { |
| 815 | if (typeof(fragment) === "string") { |
| 816 | const f = this.getError(fragment); |
| 817 | assertArgument(f, "unknown error", "fragment", fragment); |
| 818 | fragment = f; |
| 819 | } |
| 820 | |
| 821 | assertArgument(dataSlice(data, 0, 4) === fragment.selector, |
| 822 | `data signature does not match error ${ fragment.name }.`, "data", data); |
| 823 | |
| 824 | return this._decodeParams(fragment.inputs, dataSlice(data, 4)); |
| 825 | } |
| 826 | |
| 827 | /** |
| 828 | * Encodes the transaction revert data for a call result that |
nothing calls this directly
no test coverage detected