Skip to content

Commit

Permalink
Run KZG tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Sep 18, 2024
1 parent fac32e4 commit bb0702e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,10 @@ const publicKey = recoverPublicKeyTyped(signature, typedData);

```ts
import { KZG } from 'micro-eth-signer/kzg';
import { trustedSetup } from 'trusted-setups'; // 400kb, 4-sec init
import { trustedSetup as fastSetup } from 'trusted-setups/fast.js'; // 800kb, instant init
// 400kb, 4-sec init
import { trustedSetup } from '@paulmillr/trusted-setups';
// 800kb, instant init
import { trustedSetup as fastSetup } from '@paulmillr/trusted-setups/fast.js';

const kzg = new KZG(trustedSetup);

Expand Down
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"devDependencies": {
"@paulmillr/jsbt": "0.2.1",
"@paulmillr/trusted-setups": "0.1.0",
"micro-bmark": "0.3.1",
"micro-ftch": "0.4.0",
"micro-should": "0.4.0",
Expand Down
20 changes: 10 additions & 10 deletions test/kzg.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { describe, should } from 'micro-should';
import { KZG } from '../kzg.js';
import { jsonGZ } from './util.js';
import { default as KZG_VERIFY_PROOF } from './vectors/kzg/go_kzg_4844_verify_kzg_proof.json' with { type: 'json' };
// import { trustedSetup as s_small } from 'trusted-setups';
// import { trustedSetup as s_fast } from 'trusted-setups/fast.js';
import { trustedSetup as s_small } from '@paulmillr/trusted-setups';
import { trustedSetup as s_fast } from '@paulmillr/trusted-setups/fast.js';
import ROOTS_UN from './vectors/kzg/roots_of_unity.json' with { type: "json" };

// These are same as millions of yaml files in official repo, but easier to use
Expand Down Expand Up @@ -95,14 +95,14 @@ function run(kzg) {
}

// Comment-out until package is published
// describe('KZG', () => {
// describe('trusted_setups/index.js', () => {
// run(new KZG(s_small));
// });
// describe('trusted_setups/fast.js', () => {
// run(new KZG(s_fast));
// });
// });
describe('KZG', () => {
describe('trusted_setups/index.js', () => {
run(new KZG(s_small));
});
describe('trusted_setups/fast.js', () => {
run(new KZG(s_fast));
});
});

// ESM is broken.
import url from 'node:url';
Expand Down

0 comments on commit bb0702e

Please sign in to comment.