MCPcopy Create free account
hub / github.com/PageLeay/celestial-runtime / parseError

Method parseError

src.ts/abi/interface.ts:1234–1243  ·  view source on GitHub ↗

* Parses a revert data, finding the matching error and extracts * the parameter values along with other useful error details. * * If the matching error cannot be found, returns null.

(data: BytesLike)

Source from the content-addressed store, hash-verified

1232 * If the matching error cannot be found, returns null.
1233 */
1234 parseError(data: BytesLike): null | ErrorDescription {
1235 const hexData = hexlify(data);
1236
1237 const fragment = this.getError(dataSlice(hexData, 0, 4));
1238
1239 if (!fragment) { return null; }
1240
1241 const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4));
1242 return new ErrorDescription(fragment, fragment.selector, args);
1243 }
1244
1245 /**
1246 * Creates a new [[Interface]] from the ABI %%value%%.

Callers

nothing calls this directly

Calls 4

getErrorMethod · 0.95
hexlifyFunction · 0.90
dataSliceFunction · 0.90
decodeMethod · 0.45

Tested by

no test coverage detected