Skip to content

Commit 4cf78e7

Browse files
Simplify WASM instantiation
1 parent 4a4733c commit 4cf78e7

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

packages/examples/packages/wasm/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "n/JVqBQfO2/1ojbBN1WFNddejGlTvGduO9VgxYGYQQg=",
10+
"shasum": "YtnZetn37cq3RA2PdwjDBPOjvxDSAQ5vSzOqC2zjBNw=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/snaps-cli/src/webpack/loaders/wasm.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ const loader: LoaderDefinitionFunction = async function loader(
115115
}
116116
117117
const bytes = decode(b64);
118-
const module = await WebAssembly.compile(bytes);
119-
const instance = new WebAssembly.Instance(module, {
118+
const { instance } = await WebAssembly.instantiate(bytes, {
120119
${getModuleImports(imports)}
121120
});
122121

0 commit comments

Comments
 (0)