Test verifying aggregate proof of nothing
This commit is contained in:
parent
fe622a7171
commit
0b019d6a67
|
@ -40,7 +40,8 @@ describe("C-KZG", () => {
|
|||
});
|
||||
|
||||
it("returns the identity (aka zero, aka neutral) element when blobs is an empty array", () => {
|
||||
expect(computeAggregateKzgProof([]).toString()).toEqual(
|
||||
const aggregateProofOfNothing = computeAggregateKzgProof([]);
|
||||
expect(aggregateProofOfNothing.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,
|
||||
|
@ -49,6 +50,12 @@ describe("C-KZG", () => {
|
|||
);
|
||||
});
|
||||
|
||||
it("verifies the aggregate proof of empty blobs and commitments", () => {
|
||||
expect(verifyAggregateKzgProof([], [], computeAggregateKzgProof([]))).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
it("computes the aggregate proof when for a single blob", () => {
|
||||
let blobs = new Array(1).fill(0).map(generateRandomBlob);
|
||||
let commitments = blobs.map(blobToKzgCommitment);
|
||||
|
|
Loading…
Reference in New Issue