Skip to content
Draft
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
1 change: 1 addition & 0 deletions sdk/src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export {
VerifyingKey,
ViewKey,
initThreadPool,
setConsensusVersionTestHeights,
verifyFunctionExecution,
} from "./wasm.js";

Expand Down
11 changes: 11 additions & 0 deletions sdk/src/node.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
import "./node-polyfill.js";
import { setConsensusVersionTestHeights } from "./browser.js";
export * from "./browser.js";

// Attempt to set the default test heights for the consensus versions from the CONSENSUS_VERSION_HEIGHTS envar when nodeJS loads its wasm module.
function setDefaultTestHeights() {
const consensusVersionHeights = process.env["CONSENSUS_VERSION_HEIGHTS"];
if (consensusVersionHeights) {
setConsensusVersionTestHeights(consensusVersionHeights)
}
}

setDefaultTestHeights()
1 change: 1 addition & 0 deletions sdk/src/wasm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ export {
VerifyingKey,
ViewKey,
initThreadPool,
setConsensusVersionTestHeights,
verifyFunctionExecution,
} from "@provablehq/wasm/%%NETWORK%%.js";
2 changes: 1 addition & 1 deletion sdk/tests/wasm.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from "chai";
import { Address, AleoNetworkClient, CREDITS_PROGRAM_KEYS, Field, FunctionKeyPair, PrivateKey, ViewKey, Signature, RecordCiphertext, RecordPlaintext, PrivateKeyCiphertext, EncryptionToolkit, Transition, VerifyingKey, AleoKeyProvider} from "../src/node.js";
import { Address, AleoNetworkClient, CREDITS_PROGRAM_KEYS, Field, FunctionKeyPair, PrivateKey, ViewKey, Signature, RecordCiphertext, RecordPlaintext, PrivateKeyCiphertext, EncryptionToolkit, Transition, VerifyingKey, AleoKeyProvider, setConsensusVersionTestHeights} from "../src/node.js";
import {
seed,
message,
Expand Down
Loading
Loading