Skip to content

Commit

Permalink
pr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Jul 15, 2024
1 parent ebca393 commit 4326a9c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/lib/candid/types/reference/service/canister_function/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ type FunctionInfo = {
returnCandidType: CandidType;
};

type ServiceCall = (
notify: boolean,
callFunction: CallRawFunction | NotifyRawFunction,
cycles: bigint,
args: any[]
) => void | Promise<any>;

export interface ServiceFunctionInfo {
[key: string]: FunctionInfo;
}
Expand Down Expand Up @@ -113,12 +120,12 @@ function createUpdateOrQueryFunctionIdlType(
functionInfo.paramCandidTypes,
parents
);
const returnIdlTypes = toIdlTypeArray(
const returnIdlType = toIdlTypeArray(
functionInfo.returnCandidType,
parents
);

return IDL.Func(paramIdlTypes, returnIdlTypes, annotations);
return IDL.Func(paramIdlTypes, returnIdlType, annotations);
}

function createCallbacks(
Expand Down Expand Up @@ -150,7 +157,7 @@ function createCanisterFunctionBase(
callFunction: CallRawFunction | NotifyRawFunction,
cycles: bigint,
args: any[]
): void | Promise<any> => {
): ReturnType<ServiceCall> => {
return serviceCall(
principal as any,
key,
Expand All @@ -170,13 +177,6 @@ function createCanisterFunctionBase(
};
}

type ServiceCall = (
notify: boolean,
callFunction: CallRawFunction | NotifyRawFunction,
cycles: bigint,
args: any[]
) => void | Promise<any>;

function serviceCall(
canisterId: Principal,
methodName: string,
Expand Down

0 comments on commit 4326a9c

Please sign in to comment.