Allow proper promise failure (#316)
* Allow proper promise failure * Remove unneeded dep
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/util-crypto#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.3.1",
|
||||
"@parity/schnorrkel-js": "^0.1.2",
|
||||
"@polkadot/util": "^0.34.16",
|
||||
"@types/bip39": "^2.4.2",
|
||||
"@types/webassembly-js-api": "^0.0.2",
|
||||
|
||||
@@ -258,7 +258,6 @@ const createPromise = require('./schnorrkel_js_bg');
|
||||
const wasmPromise = createPromise(wasmImports);
|
||||
|
||||
module.exports.isReady = function () { return !!wasm; }
|
||||
module.exports.waitReady = function () { return wasmPromise.then(() => true); }
|
||||
|
||||
wasmPromise.then((_wasm) => { wasm = _wasm });
|
||||
module.exports.waitReady = function () { return wasmPromise.then(() => !!wasm); }
|
||||
|
||||
wasmPromise.then((_wasm) => { wasm = _wasm }).catch(() => {});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
const bytes = require('./schnorrkel_js_wasm');
|
||||
|
||||
module.exports = function createExportPromise (wasmImports) {
|
||||
module.exports = async function createExportPromise (wasmImports) {
|
||||
const imports = {
|
||||
'./schnorrkel_js': wasmImports
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user