From 83bed363d25e8068c615a56f3ad249ed01b32294 Mon Sep 17 00:00:00 2001 From: dancoffman Date: Thu, 3 Nov 2022 21:54:59 -0700 Subject: [PATCH] Add return types --- bindings/node.js/kzg.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bindings/node.js/kzg.ts b/bindings/node.js/kzg.ts index 145934f..c5f84e4 100644 --- a/bindings/node.js/kzg.ts +++ b/bindings/node.js/kzg.ts @@ -54,7 +54,7 @@ export const BYTES_PER_FIELD = kzg.BYTES_PER_FIELD; // Stored as internal state let setupHandle: SetupHandle | undefined; -export function loadTrustedSetup(filePath: string) { +export function loadTrustedSetup(filePath: string): void { if (setupHandle) { throw new Error( "Call freeTrustedSetup before loading a new trusted setup." @@ -63,7 +63,7 @@ export function loadTrustedSetup(filePath: string) { setupHandle = kzg.loadTrustedSetup(filePath); } -export function freeTrustedSetup() { +export function freeTrustedSetup(): void { if (!setupHandle) { throw new Error("You must call loadTrustedSetup before freeTrustedSetup."); } @@ -71,14 +71,14 @@ export function freeTrustedSetup() { setupHandle = undefined; } -export function blobToKzgCommitment(blob: Blob) { +export function blobToKzgCommitment(blob: Blob): KZGCommitment { if (!setupHandle) { throw new Error("You must call loadTrustedSetup to initialize KZG."); } return kzg.blobToKzgCommitment(blob, setupHandle); } -export function computeAggregateKzgProof(blobs: Blob[]) { +export function computeAggregateKzgProof(blobs: Blob[]): KZGProof { if (!setupHandle) { throw new Error("You must call loadTrustedSetup to initialize KZG."); } @@ -89,7 +89,7 @@ export function verifyAggregateKzgProof( blobs: Blob[], expectedKzgCommitments: KZGCommitment[], kzgAggregatedProof: KZGProof -) { +): boolean { if (!setupHandle) { throw new Error("You must call loadTrustedSetup to initialize KZG."); }