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

Method encodeErrorResult

lib.esm/abi/interface.js:702–712  ·  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

700 * a result from a Contract.
701 */
702 encodeErrorResult(fragment, values) {
703 if (typeof (fragment) === "string") {
704 const f = this.getError(fragment);
705 assertArgument(f, "unknown error", "fragment", fragment);
706 fragment = f;
707 }
708 return concat([
709 fragment.selector,
710 this._encodeParams(fragment.inputs, values || [])
711 ]);
712 }
713 /**
714 * Decodes the %%data%% from a transaction ``tx.data`` for
715 * the function specified (see [[getFunction]] for valid values

Callers

nothing calls this directly

Calls 4

getErrorMethod · 0.95
_encodeParamsMethod · 0.95
assertArgumentFunction · 0.90
concatFunction · 0.90

Tested by

no test coverage detected