Skip to content

Commit

Permalink
Simplify WASM instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikBolding committed Dec 9, 2024
1 parent 4a4733c commit 4cf78e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/examples/packages/wasm/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "n/JVqBQfO2/1ojbBN1WFNddejGlTvGduO9VgxYGYQQg=",
"shasum": "YtnZetn37cq3RA2PdwjDBPOjvxDSAQ5vSzOqC2zjBNw=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
3 changes: 1 addition & 2 deletions packages/snaps-cli/src/webpack/loaders/wasm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ const loader: LoaderDefinitionFunction = async function loader(
}
const bytes = decode(b64);
const module = await WebAssembly.compile(bytes);
const instance = new WebAssembly.Instance(module, {
const { instance } = await WebAssembly.instantiate(bytes, {
${getModuleImports(imports)}
});
Expand Down

0 comments on commit 4cf78e7

Please sign in to comment.