diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 93f9735..818c574 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -9,13 +9,13 @@ module.exports = { 'eslint:recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', - 'plugin:snarkyjs/recommended', + 'plugin:o1js/recommended', ], parser: '@typescript-eslint/parser', parserOptions: { ecmaVersion: 'latest', }, - plugins: ['@typescript-eslint', 'snarkyjs'], + plugins: ['@typescript-eslint', 'o1js'], ignorePatterns: ['README.md'], rules: { 'no-constant-condition': 'off', diff --git a/jest-resolver.cjs b/jest-resolver.cjs index 6a0214a..11c8fc2 100644 --- a/jest-resolver.cjs +++ b/jest-resolver.cjs @@ -2,8 +2,8 @@ module.exports = (request, options) => { return options.defaultResolver(request, { ...options, packageFilter: (pkg) => { - // When importing snarkyjs, we specify the Node ESM import as Jest by default imports the web version - if (pkg.name === 'snarkyjs') { + // When importing o1js, we specify the Node ESM import as Jest by default imports the web version + if (pkg.name === 'o1js') { return { ...pkg, main: pkg.exports.node.import, diff --git a/jest.config.js b/jest.config.js index ee9f6a4..616cdef 100644 --- a/jest.config.js +++ b/jest.config.js @@ -15,7 +15,7 @@ export default { }, resolver: '/jest-resolver.cjs', transformIgnorePatterns: [ - '/node_modules/(?!(tslib|snarkyjs/node_modules/tslib))', + '/node_modules/(?!(tslib|o1js/node_modules/tslib))', ], modulePathIgnorePatterns: ['/build/'], moduleNameMapper: { diff --git a/package-lock.json b/package-lock.json index 4efa555..7f165d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "snarkyjs-pack", - "version": "0.2.1", + "version": "0.2.3-beta4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "snarkyjs-pack", - "version": "0.2.1", + "version": "0.2.3-beta4", "license": "Apache-2.0", "devDependencies": { "@babel/preset-env": "^7.16.4", @@ -15,7 +15,7 @@ "@typescript-eslint/eslint-plugin": "^5.5.0", "@typescript-eslint/parser": "^5.5.0", "eslint": "^8.7.0", - "eslint-plugin-snarkyjs": "^0.1.0", + "eslint-plugin-o1js": "^0.4.0", "husky": "^7.0.1", "jest": "^27.3.1", "lint-staged": "^11.0.1", @@ -24,7 +24,7 @@ "typescript": "^4.7.2" }, "peerDependencies": { - "snarkyjs": "^0.12.1" + "o1js": "^0.12.*" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -4205,10 +4205,10 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-plugin-snarkyjs": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-snarkyjs/-/eslint-plugin-snarkyjs-0.1.0.tgz", - "integrity": "sha512-wq23R8uAQcdBQwVyweI4hKPGtPExPSMCJXGNJggn4iYv7B4isuE29ETj3+Jpw9r3kmm4rng92HnqvZdl3c6ihQ==", + "node_modules/eslint-plugin-o1js": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-o1js/-/eslint-plugin-o1js-0.4.0.tgz", + "integrity": "sha512-12qI6OvAMtUIh8x9lB5uVzJbRMSR6tGrbCRM98fcCmll1FNvVSUIaat3CWhH17tkcjoyVSaFy0I/WzZcqPqaUA==", "dev": true }, "node_modules/eslint-scope": { @@ -7441,6 +7441,32 @@ "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", "dev": true }, + "node_modules/o1js": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/o1js/-/o1js-0.12.2.tgz", + "integrity": "sha512-DkGw2sqj2t8lXSZFhv7qQnkG7WEhL4VrHYCpIagckmt6xH1A9weJo1SUqFXRRko9zeWY1e76jy/+SocrEUS5Gw==", + "peer": true, + "dependencies": { + "blakejs": "1.2.1", + "detect-gpu": "^5.0.5", + "isomorphic-fetch": "^3.0.0", + "js-sha256": "^0.9.0", + "reflect-metadata": "^0.1.13", + "tslib": "^2.3.0" + }, + "bin": { + "snarky-run": "src/build/run.js" + }, + "engines": { + "node": ">=16.4.0" + } + }, + "node_modules/o1js/node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "peer": true + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -8167,32 +8193,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/snarkyjs": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/snarkyjs/-/snarkyjs-0.12.1.tgz", - "integrity": "sha512-Zv1tj+NBoid2O4Pewj1sUCcqYApoDJ4M6I/Lm7WzpRwf1HwU3h4rUF10mDfBaX4fb6A+9OXLI6cmR8P2URVehg==", - "peer": true, - "dependencies": { - "blakejs": "1.2.1", - "detect-gpu": "^5.0.5", - "isomorphic-fetch": "^3.0.0", - "js-sha256": "^0.9.0", - "reflect-metadata": "^0.1.13", - "tslib": "^2.3.0" - }, - "bin": { - "snarky-run": "src/build/run.js" - }, - "engines": { - "node": ">=16.4.0" - } - }, - "node_modules/snarkyjs/node_modules/tslib": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", - "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==", - "peer": true - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", diff --git a/package.json b/package.json index d91fee6..da44de5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "snarkyjs-pack", - "version": "0.2.3", + "version": "0.3.0", "description": "", "author": "45930", "license": "Apache-2.0", @@ -36,7 +36,7 @@ "@typescript-eslint/eslint-plugin": "^5.5.0", "@typescript-eslint/parser": "^5.5.0", "eslint": "^8.7.0", - "eslint-plugin-snarkyjs": "^0.1.0", + "eslint-plugin-o1js": "^0.4.0", "husky": "^7.0.1", "jest": "^27.3.1", "lint-staged": "^11.0.1", @@ -45,6 +45,6 @@ "typescript": "^4.7.2" }, "peerDependencies": { - "snarkyjs": "^0.12.1" + "o1js": "^0.12.*" } } diff --git a/src/lib/PackingPlant.ts b/src/lib/PackingPlant.ts index 6323ced..e61161b 100644 --- a/src/lib/PackingPlant.ts +++ b/src/lib/PackingPlant.ts @@ -5,7 +5,7 @@ import { provable, InferProvable, Provable, -} from 'snarkyjs'; +} from 'o1js'; const MAX_BITS_PER_FIELD = 254n; diff --git a/src/lib/packed-types/PackedBool.test.ts b/src/lib/packed-types/PackedBool.test.ts index 7efb324..6a548b3 100644 --- a/src/lib/packed-types/PackedBool.test.ts +++ b/src/lib/packed-types/PackedBool.test.ts @@ -1,4 +1,4 @@ -import { Bool, Provable } from 'snarkyjs'; +import { Bool, Provable } from 'o1js'; import { PackedBoolFactory } from './PackedBool'; describe('PackedBool', () => { diff --git a/src/lib/packed-types/PackedBool.ts b/src/lib/packed-types/PackedBool.ts index 5f870a0..ad7cdb4 100644 --- a/src/lib/packed-types/PackedBool.ts +++ b/src/lib/packed-types/PackedBool.ts @@ -1,4 +1,4 @@ -import { Field, Provable, Bool } from 'snarkyjs'; +import { Field, Provable, Bool } from 'o1js'; import { PackingPlant } from '../PackingPlant.js'; const SIZE_IN_BITS = 1n; diff --git a/src/lib/packed-types/PackedString.test.ts b/src/lib/packed-types/PackedString.test.ts index 460cb22..fc84b89 100644 --- a/src/lib/packed-types/PackedString.test.ts +++ b/src/lib/packed-types/PackedString.test.ts @@ -1,4 +1,4 @@ -import { Character, Field, Provable } from 'snarkyjs'; +import { Character, Field, Provable } from 'o1js'; import { PackedStringFactory } from './PackedString'; describe('PackedString', () => { diff --git a/src/lib/packed-types/PackedString.ts b/src/lib/packed-types/PackedString.ts index 5a9344a..1ccb9b9 100644 --- a/src/lib/packed-types/PackedString.ts +++ b/src/lib/packed-types/PackedString.ts @@ -1,4 +1,4 @@ -import { Field, Provable, Character } from 'snarkyjs'; +import { Field, Provable, Character } from 'o1js'; import { MultiPackingPlant } from '../PackingPlant.js'; const SIZE_IN_BITS = 16n; diff --git a/src/lib/packed-types/PackedUInt32.test.ts b/src/lib/packed-types/PackedUInt32.test.ts index 75e2a8a..54459f9 100644 --- a/src/lib/packed-types/PackedUInt32.test.ts +++ b/src/lib/packed-types/PackedUInt32.test.ts @@ -1,4 +1,4 @@ -import { Provable, UInt32 } from 'snarkyjs'; +import { Provable, UInt32 } from 'o1js'; import { PackedUInt32Factory } from './PackedUInt32'; describe('PackedUInt32', () => { diff --git a/src/lib/packed-types/PackedUInt32.ts b/src/lib/packed-types/PackedUInt32.ts index c176359..6837a10 100644 --- a/src/lib/packed-types/PackedUInt32.ts +++ b/src/lib/packed-types/PackedUInt32.ts @@ -1,4 +1,4 @@ -import { Field, Provable, UInt32 } from 'snarkyjs'; +import { Field, Provable, UInt32 } from 'o1js'; import { PackingPlant } from '../PackingPlant.js'; const SIZE_IN_BITS = 32n; diff --git a/tests/provable/end_to_end.test.ts b/tests/provable/end_to_end.test.ts index 516be3a..b6cd25c 100644 --- a/tests/provable/end_to_end.test.ts +++ b/tests/provable/end_to_end.test.ts @@ -1,4 +1,4 @@ -import { UInt32 } from 'snarkyjs'; +import { UInt32 } from 'o1js'; import { Votes, VotesProgram, VotesProof } from './example_circuit'; describe('End to End Votes Test', () => { diff --git a/tests/provable/example_circuit.ts b/tests/provable/example_circuit.ts index 5d22508..592200e 100644 --- a/tests/provable/example_circuit.ts +++ b/tests/provable/example_circuit.ts @@ -1,4 +1,4 @@ -import { Experimental, SelfProof } from 'snarkyjs'; +import { Experimental, SelfProof } from 'o1js'; import { PackedUInt32Factory } from '../../src/lib/packed-types/PackedUInt32'; export class Votes extends PackedUInt32Factory(2) {}