MCPcopy Create free account
hub / github.com/ccxt/ccxt / encodeErrorResult

Method encodeErrorResult

ts/src/static_dependencies/ethers/interface.ts:835–846  ·  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: ErrorFragment | string, values?: ReadonlyArray<any>)

Source from the content-addressed store, hash-verified

833 * a result from a Contract.
834 */
835 encodeErrorResult(fragment: ErrorFragment | string, values?: ReadonlyArray<any>): string {
836 if (typeof(fragment) === "string") {
837 const f = this.getError(fragment);
838 assertArgument(f, "unknown error", "fragment", fragment);
839 fragment = f;
840 }
841
842 return concat([
843 fragment.selector,
844 this._encodeParams(fragment.inputs, values || [ ])
845 ]);
846 }
847
848 /**
849 * Decodes the %%data%% from a transaction ``tx.data`` for

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