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

Add async initiation to JS glue code #37

Merged
merged 10 commits into from
Mar 20, 2024
Merged

Conversation

acolytec3
Copy link
Contributor

@acolytec3 acolytec3 commented Mar 19, 2024

This updates how the WASM is instantiated in rust_verkle_wasm.js to load the WASM as a base64 string and then instantiate it through an async initiation function which is then called by the consuming application.

TODOs

  • Decide whether to keep current hack that appends the initVerkleWasm function directly to the compiled JS glue code or do something more elegant
  • Revise CJS build to be transpilation from ESM using Babel
  • Define types for initVerkleWasm

beforeAll(() => {
ffi = new VerkleFFI()
let ffi: Context;
let verkle;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that this initVerkleWasm() returns void, we can probably not assign it right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Have removed.

@gabrocheleau gabrocheleau merged commit da493a8 into master Mar 20, 2024
3 checks passed
@holgerd77 holgerd77 deleted the switch-to-async-init branch March 21, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants