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

Method encodeErrorResult

js/src/static_dependencies/ethers/interface.js:613–623  ·  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

611 * a result from a Contract.
612 */
613 encodeErrorResult(fragment, values) {
614 if (typeof (fragment) === "string") {
615 const f = this.getError(fragment);
616 assertArgument(f, "unknown error", "fragment", fragment);
617 fragment = f;
618 }
619 return concat([
620 fragment.selector,
621 this._encodeParams(fragment.inputs, values || [])
622 ]);
623 }
624 /**
625 * Decodes the %%data%% from a transaction ``tx.data`` for
626 * 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