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

Method encodeErrorResult

lib.commonjs/abi/interface.js:710–720  ·  view source on GitHub ↗

* Encodes the transaction revert data for a call result that * reverted from the the Contract with the sepcified %%error%% * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. * * This is generally not used by most developers, unless trying to mock

(fragment, values)

Source from the content-addressed store, hash-verified

708 * a result from a Contract.
709 */
710 encodeErrorResult(fragment, values) {
711 if (typeof (fragment) === "string") {
712 const f = this.getError(fragment);
713 (0, index_js_3.assertArgument)(f, "unknown error", "fragment", fragment);
714 fragment = f;
715 }
716 return (0, index_js_3.concat)([
717 fragment.selector,
718 this._encodeParams(fragment.inputs, values || [])
719 ]);
720 }
721 /**
722 * Decodes the %%data%% from a transaction ``tx.data`` for
723 * the function specified (see [[getFunction]] for valid values

Callers

nothing calls this directly

Calls 2

getErrorMethod · 0.95
_encodeParamsMethod · 0.95

Tested by

no test coverage detected