Fix comments

This commit is contained in:
Akim Mamedov
2023-11-16 17:49:28 +07:00
parent 6ab6e9d636
commit e647ab0f2d
7 changed files with 28 additions and 71 deletions

View File

@ -27,7 +27,6 @@ import {
aqua2ts,
ts2aqua,
wrapFunction,
wrapServiceFunction,
} from "./compilerSupport/conversions.js";
import { ServiceImpl } from "./compilerSupport/types.js";
import { FluencePeer } from "./jsPeer/FluencePeer.js";
@ -43,7 +42,7 @@ import { callAquaFunction, Fluence, registerService } from "./index.js";
* @param script - air script with function execution logic generated by the Aqua compiler
*/
export const v5_callFunction = async (
args: (JSONValue | ((...args: JSONValue[]) => JSONValue))[],
args: (JSONValue | ServiceImpl[string])[],
def: FunctionCallDef,
script: string,
): Promise<unknown> => {
@ -75,9 +74,7 @@ export const v5_callFunction = async (
);
}
const callArgs = Object.fromEntries<
JSONValue | ((...args: JSONValue[]) => JSONValue)
>(
const callArgs = Object.fromEntries<JSONValue | ServiceImpl[string]>(
args.slice(0, argCount).map((arg, i) => {
const argSchema = functionArgs[argNames[i]];
@ -160,7 +157,7 @@ export const v5_registerService = (args: unknown[], def: ServiceDef): void => {
const wrappedServiceImpl = Object.fromEntries(
Object.entries(serviceImpl).map(([name, func]) => {
return [name, wrapServiceFunction(func, serviceSchema[name])];
return [name, wrapFunction(func, serviceSchema[name])];
}),
);