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

Method encodeFunctionResult

lib.commonjs/abi/interface.js:826–833  ·  view source on GitHub ↗

* Encodes the result data (e.g. from an ``eth_call``) for the * specified function (see [[getFunction]] for valid values * for %%fragment%%) with %%values%%. * * This is generally not used by most developers, unless trying to mock * a result from a Contract.

(fragment, values)

Source from the content-addressed store, hash-verified

824 * a result from a Contract.
825 */
826 encodeFunctionResult(fragment, values) {
827 if (typeof (fragment) === "string") {
828 const f = this.getFunction(fragment);
829 (0, index_js_3.assertArgument)(f, "unknown function", "fragment", fragment);
830 fragment = f;
831 }
832 return (0, index_js_3.hexlify)(this.#abiCoder.encode(fragment.outputs, values || []));
833 }
834 /*
835 spelunk(inputs: Array<ParamType>, values: ReadonlyArray<any>, processfunc: (type: string, value: any) => Promise<any>): Promise<Array<any>> {
836 const promises: Array<Promise<>> = [ ];

Callers 1

test-abi.jsFile · 0.45

Calls 2

getFunctionMethod · 0.95
encodeMethod · 0.45

Tested by

no test coverage detected