Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor provable core #258

Merged
merged 9 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crypto/poseidon.unit-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { expect } from 'expect';
import { bigIntToBytes, parseHexString32 } from './bigint-helpers.js';
import { test, Random } from '../../lib/testing/property.js';
import { Test } from '../../snarky.js';
import { FieldConst } from '../../lib/field.js';
import { FieldConst } from '../../lib/provable-core/fieldvar.js';
import { MlArray } from '../../lib/ml/base.js';

function checkTestVectors(
Expand Down
4 changes: 2 additions & 2 deletions lib/binable.unit-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
withCheck,
withVersionNumber,
} from './binable.js';
import { PublicKey, Scalar } from '../../provable/curve-bigint.js';
import { Bool, Field, UInt64 } from '../../provable/field-bigint.js';
import { PublicKey, Scalar } from '../../mina-signer/src/curve-bigint.js';
import { Bool, Field, UInt64 } from '../../mina-signer/src/field-bigint.js';

// uint

Expand Down
11 changes: 5 additions & 6 deletions lib/generic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ type GenericProvable<T, Field> = {
sizeInFields(): number;
check: (x: T) => void;
};
interface GenericProvablePure<T, Field> extends GenericProvable<T, Field> {
toFields: (x: T) => Field[];
toAuxiliary: (x?: T) => any[];
type GenericProvablePure<T, Field> = Omit<
GenericProvable<T, Field>,
'fromFields'
> & {
fromFields: (x: Field[]) => T;
sizeInFields(): number;
check: (x: T) => void;
}
};

type GenericSignable<T, TJson, Field> = {
toInput: (x: T) => { fields?: Field[]; packed?: [Field, number][] };
Expand Down
76 changes: 0 additions & 76 deletions lib/provable-bigint.ts

This file was deleted.

102 changes: 0 additions & 102 deletions lib/provable-snarky.ts

This file was deleted.

6 changes: 3 additions & 3 deletions mina-transaction/transaction-leaves-bigint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import {
UInt32,
UInt64,
Sign,
} from '../../provable/field-bigint.js';
import { PublicKey } from '../../provable/curve-bigint.js';
} from '../../mina-signer/src/field-bigint.js';
import { PublicKey } from '../../mina-signer/src/curve-bigint.js';
import { derivedLeafTypesSignable } from './derived-leaves.js';
import { createEvents } from '../../lib/events.js';
import {
Poseidon,
HashHelpers,
packToFields,
} from '../../provable/poseidon-bigint.js';
} from '../../mina-signer/src/poseidon-bigint.js';
import { mocks, protocolVersions } from '../crypto/constants.js';

export { PublicKey, Field, Bool, AuthRequired, UInt64, UInt32, Sign, TokenId };
Expand Down
2 changes: 1 addition & 1 deletion mina-transaction/transaction-leaves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
packToFields,
emptyHashWithPrefix,
} from '../../lib/hash.js';
import { provable } from '../../lib/circuit-value.js';
import { provable } from '../../lib/provable-types/struct.js';
import { mocks, protocolVersions } from '../crypto/constants.js';

export { PublicKey, Field, Bool, AuthRequired, UInt64, UInt32, Sign, TokenId };
Expand Down
Loading