Skip to content

Commit 3d7a180

Browse files
committed
bindings: initialize native conversion
1 parent 1947848 commit 3d7a180

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/bindings/crypto/bindings.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { oraclesConversion } from './bindings/conversion-oracles.js';
1717
import { jsEnvironment } from './bindings/env.js';
1818
import { srs } from './bindings/srs.js';
1919

20-
export { getRustConversion, RustConversion, Wasm };
20+
export { getRustConversion, RustConversion, Wasm, createNativeRustConversion };
2121

2222
const tsBindings = {
2323
jsEnvironment,
@@ -31,6 +31,7 @@ const tsBindings = {
3131
...FpVectorBindings,
3232
...FqVectorBindings,
3333
rustConversion: createRustConversion,
34+
nativeRustConversion: createNativeRustConversion,
3435
srs: (wasm: Wasm) => srs(wasm, getRustConversion(wasm)),
3536
};
3637

@@ -39,7 +40,15 @@ const tsBindings = {
3940

4041
type Wasm = typeof wasmNamespace;
4142

43+
function createNativeRustConversion(wasm: Wasm) {
44+
return buildConversion(wasm);
45+
}
46+
4247
function createRustConversion(wasm: Wasm) {
48+
return buildConversion(wasm);
49+
}
50+
51+
function buildConversion(wasm: Wasm) {
4352
let core = conversionCore(wasm);
4453
let verifierIndex = verifierIndexConversion(wasm, core);
4554
let oracles = oraclesConversion(wasm);
@@ -55,7 +64,7 @@ function createRustConversion(wasm: Wasm) {
5564
};
5665
}
5766

58-
type RustConversion = ReturnType<typeof createRustConversion>;
67+
type RustConversion = ReturnType<typeof buildConversion>;
5968

6069
let rustConversion: RustConversion | undefined;
6170

0 commit comments

Comments
 (0)