Log init errors to the console (#11)

* Log init errors to the console

* Use stable @polkadot/util packages
This commit is contained in:
Jaco Greeff
2019-03-27 22:12:54 +01:00
committed by GitHub
parent a2e81acbd6
commit e668b96bca
9 changed files with 23 additions and 14 deletions
+4
View File
@@ -1,3 +1,7 @@
# 0.6.1
- Log init errors for both non-WebAssembly usage as well as WebAssembly errors
# 0.5.1
- Add password argument to bip39ToSeed
+1 -1
View File
@@ -9,5 +9,5 @@
"packages": [
"packages/*"
],
"version": "0.5.1"
"version": "0.6.0"
}
+1 -1
View File
@@ -22,6 +22,6 @@
"devDependencies": {
"@babel/core": "^7.4.0",
"@polkadot/dev": "^0.28.1",
"@polkadot/util": "^0.40.1"
"@polkadot/util": "^0.41.1"
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/wasm-crypto",
"version": "0.5.1",
"version": "0.6.0",
"author": "Jaco Greeff <jacogr@gmail.com>",
"files": [
"crypto-polyfill.js",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/wasm-dalek-ed25519",
"version": "0.5.1",
"version": "0.6.0",
"author": "Jaco Greeff <jacogr@gmail.com>",
"files": [
"index.d.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/wasm-schnorrkel",
"version": "0.5.1",
"version": "0.6.0",
"collaborators": [
"Jaco Greeff <jacogr@gmail.com>",
"kianenigma <Kian.peymani@gmail.com>"
+9 -3
View File
@@ -69,7 +69,7 @@ export function waitReady(): Promise<boolean>;
# create the init promise handler
echo "
const asm = null; // require('./wasm_asm');
const pkg = require('./package.json');
const bytes = require('./wasm_wasm');
const js = require('./wasm');
@@ -79,7 +79,10 @@ module.exports = async function createExportPromise () {
};
if (!WebAssembly) {
return asm;
console.error(`ERROR: Unable to initialize ${pkg.name}, WebAssembly is not available in this environment`);
// TODO: Return asm version when not detected
return null;
}
try {
@@ -87,7 +90,10 @@ module.exports = async function createExportPromise () {
return instance.exports;
} catch (error) {
return asm;
console.error(`ERROR: Unable to initialize ${pkg.name}:: ${error.message}`);
// TODO: Return asm version here as a fallback
return null;
}
}
" > $BGJ
+1 -2
View File
@@ -16,12 +16,11 @@ for PKG in "${PACKAGES[@]}"; do
../../scripts/build-package.sh
./adjust.sh
../../scripts/test-package.sh
rm -rf build/*-e build/package.json build/README.md
ls -al build
../../scripts/test-package.sh
cd ..
fi
done
+4 -4
View File
@@ -1579,10 +1579,10 @@
typescript "^3.3.4000"
vuepress "^1.0.0-alpha.44"
"@polkadot/util@^0.40.1":
version "0.40.1"
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.40.1.tgz#4a990d134ea394425e9b1ceb8a7f1fc0868a5a66"
integrity sha512-S9owTDNIB7sNFzon4lK/c9A+6O73XcoCPAIYA3TtNg494qA1X8exesenVJgVFzqht/Z3B/RAXLsEa8DSk9BycQ==
"@polkadot/util@^0.41.1":
version "0.41.1"
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.41.1.tgz#b67762a0a7408138d843adc7240944e704e819e7"
integrity sha512-1mFHxxdXyRgeFk0ygfJklzsf6HiEEMikrpUgr+3Dw5S7KromjPD8EbWkpcZQZ3Png5PTwGyjrx7MYY4Ajiu5xQ==
dependencies:
"@babel/runtime" "^7.4.0"
"@types/bn.js" "^4.11.4"