Update NodeJS unit test to expect zero element when computeAggregateKzgProof is supplied an empty array of blobs

This commit is contained in:
dancoffman 2022-11-09 10:25:48 -08:00
parent 084fd2209e
commit 2232b02329
No known key found for this signature in database
GPG Key ID: 47B1F53E36A9B3CC
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "c-kzg",
"version": "0.0.9",
"version": "1.0.0",
"description": "NodeJS bindings for C-KZG",
"author": "Dan Coffman",
"license": "MIT",

View File

@ -38,8 +38,12 @@ describe("C-KZG", () => {
});
it("throws an error when blobs is an empty array", () => {
expect(() => computeAggregateKzgProof([])).toThrowError(
"Failed to compute proof",
expect(computeAggregateKzgProof([]).toString()).toEqual(
[
192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0,
].toString(),
);
});