Remove syncify (NodeJS only) (#349)

* Remove syncify (NodeJS only)

* Bump version (interface change)
This commit is contained in:
Jaco Greeff
2019-03-04 16:47:55 +01:00
committed by GitHub
parent 9974b27e52
commit 4f719ce377
14 changed files with 31 additions and 112 deletions
+4
View File
@@ -1,3 +1,7 @@
# 0.35.1
- Remove NodeJs-only `syncify` function, not exported by the package (with binary dependency for Node)
# 0.34.1
- Keyring now allows for ed25519 and sr25519 instances. Upon creation, you need to pass the `ed25519`or `sr25519` string to denote the type, i.e. `new Keyring({ type: 'sr25519' })`
+1 -1
View File
@@ -9,5 +9,5 @@
"packages": [
"packages/*"
],
"version": "0.34.41"
"version": "0.35.0"
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/chainspec",
"version": "0.34.41",
"version": "0.35.0",
"description": "Contains chain specifications for known chains",
"main": "index.js",
"keywords": [
@@ -29,6 +29,6 @@
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/chainspec#readme",
"dependencies": {
"@babel/runtime": "^7.3.4",
"@polkadot/util": "^0.34.41"
"@polkadot/util": "^0.35.0"
}
}
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/db",
"version": "0.34.41",
"version": "0.35.0",
"description": "Implementation of a basic sync in-memory and on-disk databases with overlays",
"main": "index.js",
"keywords": [
@@ -29,8 +29,8 @@
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/db#readme",
"dependencies": {
"@babel/runtime": "^7.3.4",
"@polkadot/trie-hash": "^0.34.41",
"@polkadot/util": "^0.34.41",
"@polkadot/trie-hash": "^0.35.0",
"@polkadot/util": "^0.35.0",
"@types/mkdirp": "^0.5.2",
"@types/rimraf": "^2.0.2",
"@types/snappy": "^6.0.0",
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/keyring",
"version": "0.34.41",
"version": "0.35.0",
"description": "Keyring management",
"main": "index.js",
"engines": {
@@ -31,8 +31,8 @@
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/keyring#readme",
"dependencies": {
"@babel/runtime": "^7.3.4",
"@polkadot/util": "^0.34.41",
"@polkadot/util-crypto": "^0.34.41",
"@polkadot/util": "^0.35.0",
"@polkadot/util-crypto": "^0.35.0",
"@types/bs58": "^4.0.0",
"bs58": "^4.0.1"
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/trie-codec",
"version": "0.34.41",
"version": "0.35.0",
"description": "This is an implementation of the codec for Substrate Trie",
"main": "index.js",
"keywords": [
@@ -29,6 +29,6 @@
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/trie-codec#readme",
"dependencies": {
"@babel/runtime": "^7.3.4",
"@polkadot/util": "^0.34.41"
"@polkadot/util": "^0.35.0"
}
}
+8 -8
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/trie-db",
"version": "0.34.41",
"version": "0.35.0",
"description": "This is an implementation of the modified merkle patricia tree as specified in Ethereum's yellow paper, adapted for Polkadot",
"main": "index.js",
"keywords": [
@@ -29,15 +29,15 @@
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/trie-db#readme",
"dependencies": {
"@babel/runtime": "^7.3.4",
"@polkadot/db": "^0.34.41",
"@polkadot/trie-codec": "^0.34.41",
"@polkadot/trie-hash": "^0.34.41",
"@polkadot/util": "^0.34.41",
"@polkadot/util-crypto": "^0.34.41"
"@polkadot/db": "^0.35.0",
"@polkadot/trie-codec": "^0.35.0",
"@polkadot/trie-hash": "^0.35.0",
"@polkadot/util": "^0.35.0",
"@polkadot/util-crypto": "^0.35.0"
},
"devDependencies": {
"@polkadot/chainspec": "^0.34.41",
"@polkadot/util-rlp": "^0.34.41",
"@polkadot/chainspec": "^0.35.0",
"@polkadot/util-rlp": "^0.35.0",
"ethereumjs-testing": "1.0.4"
}
}
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/trie-hash",
"version": "0.34.41",
"version": "0.35.0",
"description": "Generates trie roots from key-value pairs",
"main": "index.js",
"keywords": [
@@ -29,9 +29,9 @@
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/trie-hash#readme",
"dependencies": {
"@babel/runtime": "^7.3.4",
"@polkadot/util": "^0.34.41"
"@polkadot/util": "^0.35.0"
},
"devDependencies": {
"@polkadot/chainspec": "^0.34.41"
"@polkadot/chainspec": "^0.35.0"
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/util-crypto",
"version": "0.34.41",
"version": "0.35.0",
"description": "A collection of useful crypto utilities for @polkadot",
"main": "index.js",
"keywords": [
@@ -30,7 +30,7 @@
"dependencies": {
"@babel/runtime": "^7.3.4",
"@polkadot/schnorrkel-js": "^0.1.2-3",
"@polkadot/util": "^0.34.41",
"@polkadot/util": "^0.35.0",
"@types/bip39": "^2.4.2",
"@types/pbkdf2": "^3.0.0",
"@types/secp256k1": "^3.5.0",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/util-rlp",
"version": "0.34.41",
"version": "0.35.0",
"description": "RLP encoding and decoding",
"main": "index.js",
"keywords": [
@@ -31,7 +31,7 @@
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/util-rlp#readme",
"dependencies": {
"@babel/runtime": "^7.3.4",
"@polkadot/util": "^0.34.41"
"@polkadot/util": "^0.35.0"
},
"devDependencies": {
"ethereumjs-testing": "1.0.4"
+1 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/util",
"version": "0.34.41",
"version": "0.35.0",
"description": "A collection of useful utilities for @polkadot",
"main": "index.js",
"keywords": [
@@ -37,7 +37,6 @@
"camelcase": "^5.0.0",
"chalk": "^2.4.2",
"core-js": "^2.6.5",
"deasync": "^0.1.14",
"ip-regex": "^4.0.0",
"moment": "^2.24.0"
}
-31
View File
@@ -1,31 +0,0 @@
// Copyright 2017-2019 @polkadot/util authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import syncify from './syncify';
describe('syncify', () => {
it('returns the result of the promise', () => {
expect(
syncify(
new Promise((resolve) => {
setTimeout(() => {
resolve(12345);
}, 100);
})
)
).toEqual(12345);
});
it('throws promise exceptions', () => {
expect(
() => syncify(
new Promise((resolve, reject) => {
setTimeout(() => {
reject(new Error('test reject error'));
}, 100);
})
)
).toThrow(/test reject error/);
});
});
-35
View File
@@ -1,35 +0,0 @@
// Copyright 2017-2019 @polkadot/util authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import deasync from 'deasync';
import isError from './is/error';
// FIXME: This is currently for Node environments only - for Browser environments deasync is not available, we need a different solution.
export default function syncify (promise: Promise<any>): any {
let result: any;
let hasResult = false;
// tslint:disable-next-line
(async () => {
try {
result = await promise;
} catch (error) {
result = error;
}
hasResult = true;
})();
deasync.loopWhile(
() => hasResult === false
);
if (isError(result)) {
throw result;
}
return result;
}
-18
View File
@@ -2558,11 +2558,6 @@ bindings@^1.2.1, bindings@^1.3.1:
dependencies:
file-uri-to-path "1.0.0"
bindings@~1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.2.1.tgz#14ad6113812d2d37d72e67b4cacb4bb726505f11"
integrity sha1-FK1hE4EtLTfXLme0ystLtyZQXxE=
bip39@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/bip39/-/bip39-2.5.0.tgz#51cbd5179460504a63ea3c000db3f787ca051235"
@@ -3852,14 +3847,6 @@ de-indent@^1.0.2:
resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"
integrity sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0=
deasync@^0.1.14:
version "0.1.14"
resolved "https://registry.yarnpkg.com/deasync/-/deasync-0.1.14.tgz#232ea2252b443948cad033d792eb3b24b0a3d828"
integrity sha512-wN8sIuEqIwyQh72AG7oY6YQODCxIp1eXzEZlZznBuwDF8Q03Tdy9QNp1BNZXeadXoklNrw+Ip1fch+KXo/+ASw==
dependencies:
bindings "~1.2.1"
node-addon-api "^1.6.0"
debug@*, debug@^4.1.0, debug@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
@@ -7629,11 +7616,6 @@ node-abi@^2.7.0:
dependencies:
semver "^5.4.1"
node-addon-api@^1.6.0:
version "1.6.2"
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.6.2.tgz#d8aad9781a5cfc4132cc2fecdbdd982534265217"
integrity sha512-479Bjw9nTE5DdBSZZWprFryHGjUaQC31y1wHo19We/k0BZlrmhqQitWoUL0cD8+scljCbIUL+E58oRDEakdGGA==
node-dir@^0.1.16:
version "0.1.17"
resolved "https://registry.yarnpkg.com/node-dir/-/node-dir-0.1.17.tgz#5f5665d93351335caabef8f1c554516cf5f1e4e5"