Skip to content

Commit

Permalink
tests into tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mitschabaude committed Mar 26, 2024
1 parent 7b83362 commit 393123a
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/lib/provable/gadgets/foreign-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Unconstrained } from '../types/unconstrained.js';
import { Field } from '../field.js';
import { Gates, foreignFieldAdd } from '../gates.js';
import { exists } from '../core/exists.js';
import { modifiedField } from '../fields.js';
import { modifiedField } from '../types/fields.js';
import { Tuple, TupleN } from '../../util/types.js';
import { assertOneOf } from './basic.js';
import { assert, bitSlice, toVar, toVars } from './common.js';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/provable/packed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Field } from './field.js';
import { assert } from './gadgets/common.js';
import { Poseidon, ProvableHashable, packToFields } from './crypto/poseidon.js';
import { Provable } from './provable.js';
import { fields, modifiedField } from './fields.js';
import { fields, modifiedField } from './types/fields.js';

export { Packed, Hashed };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {
record,
} from '../../testing/equivalent.js';
import { Field } from '../wrapped.js';
import { Gadgets } from './gadgets.js';
import { Gadgets } from '../gadgets/gadgets.js';
import { provable } from '../types/struct.js';
import { assert } from './common.js';
import { assert } from '../gadgets/common.js';

let Arithmetic = ZkProgram({
name: 'arithmetic',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '../../testing/equivalent.js';
import { Fp, mod } from '../../../bindings/crypto/finite-field.js';
import { Field } from '../wrapped.js';
import { Gadgets } from './gadgets.js';
import { Gadgets } from '../gadgets/gadgets.js';
import { Random } from '../../testing/property.js';
import {
constraintSystem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import {
Point,
initialAggregator,
verifyEcdsaConstant,
} from './elliptic-curve.js';
import { Field3 } from './foreign-field.js';
} from '../gadgets/elliptic-curve.js';
import { Field3 } from '../gadgets/foreign-field.js';
import { CurveParams } from '../../../bindings/crypto/elliptic-curve-examples.js';
import { Provable } from '../provable.js';
import { ZkProgram } from '../../proof-system/zkprogram.js';
import { assert } from './common.js';
import { assert } from '../gadgets/common.js';
import { foreignField, uniformForeignField } from './test-utils.js';
import {
First,
Expand All @@ -22,7 +22,7 @@ import {
oneOf,
record,
} from '../../testing/equivalent.js';
import { Bool } from '../../provable/bool.js';
import { Bool } from '../bool.js';
import { Random } from '../../testing/random.js';

// quick tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ import {
unit,
} from '../../testing/equivalent.js';
import { Random } from '../../testing/random.js';
import { assert } from './common.js';
import { EllipticCurve, Point, simpleMapToCurve } from './elliptic-curve.js';
import { assert } from '../gadgets/common.js';
import {
EllipticCurve,
Point,
simpleMapToCurve,
} from '../gadgets/elliptic-curve.js';
import { foreignField, throwError } from './test-utils.js';

// provable equivalence tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import {
unit,
} from '../../testing/equivalent.js';
import { Random } from '../../testing/random.js';
import { Field3, Gadgets } from './gadgets.js';
import { Field3, Gadgets } from '../gadgets/gadgets.js';
import { ZkProgram } from '../../proof-system/zkprogram.js';
import { Provable } from '../provable.js';
import { assert } from './common.js';
import { assert } from '../gadgets/common.js';
import {
allConstant,
and,
Expand All @@ -33,7 +33,7 @@ import {
throwError,
unreducedForeignField,
} from './test-utils.js';
import { l2 } from './range-check.js';
import { l2 } from '../gadgets/range-check.js';

const { ForeignField } = Gadgets;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/provable/test/keccak.unit-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
sha3_512,
} from '@noble/hashes/sha3';
import { Bytes } from '../wrapped-classes.js';
import { bytes } from '../gadgets/test-utils.js';
import { bytes } from './test-utils.js';
import { UInt8 } from '../int.js';
import { test, Random, sample } from '../../testing/property.js';
import { expect } from 'expect';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
fieldWithRng,
} from '../../testing/equivalent.js';
import { Random } from '../../testing/property.js';
import { assert } from './common.js';
import { Gadgets } from './gadgets.js';
import { l } from './range-check.js';
import { assert } from '../gadgets/common.js';
import { Gadgets } from '../gadgets/gadgets.js';
import { l } from '../gadgets/range-check.js';
import {
constraintSystem,
contains,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ZkProgram } from '../../proof-system/zkprogram.js';
import { Bytes } from '../wrapped-classes.js';
import { Gadgets } from './gadgets.js';
import { Gadgets } from '../gadgets/gadgets.js';
import { sha256 as nobleSha256 } from '@noble/hashes/sha256';
import { bytes } from './test-utils.js';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { FiniteField } from '../../../bindings/crypto/finite-field.js';
import { ProvableSpec, spec } from '../../testing/equivalent.js';
import { Random } from '../../testing/random.js';
import { Field3 } from './gadgets.js';
import { assert } from './common.js';
import { Field3 } from '../gadgets/gadgets.js';
import { assert } from '../gadgets/common.js';
import { Bytes } from '../wrapped-classes.js';

export {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ProvablePureExtended } from './types/struct.js';
import { Field } from './field.js';
import { ProvablePureExtended } from './struct.js';
import { Field } from '../field.js';

export { modifiedField, fields };

Expand Down

0 comments on commit 393123a

Please sign in to comment.