mirror of
https://github.com/status-im/c-kzg-4844.git
synced 2025-02-22 23:08:32 +00:00
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", () => {
|
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,
|
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, 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", () => {
|
it("computes the aggregate proof when for a single blob", () => {
|
||||||
let blobs = new Array(1).fill(0).map(generateRandomBlob);
|
let blobs = new Array(1).fill(0).map(generateRandomBlob);
|
||||||
let commitments = blobs.map(blobToKzgCommitment);
|
let commitments = blobs.map(blobToKzgCommitment);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user