Small Enum/EnumType cleanups for consistency (#759)

This commit is contained in:
Jaco Greeff
2019-03-06 12:29:34 +01:00
committed by GitHub
parent 89cd9323e7
commit cc65bb53d6
10 changed files with 39 additions and 32 deletions
+1 -1
View File
@@ -26,7 +26,7 @@
"@babel/register": "^7.0.0",
"@babel/runtime": "^7.3.4",
"@polkadot/dev": "^0.25.12",
"@polkadot/ts": "^0.1.55",
"@polkadot/ts": "^0.1.56",
"gh-pages": "^2.0.1"
}
}
+1 -1
View File
@@ -36,6 +36,6 @@
"@polkadot/rpc-rx": "^0.46.4",
"@polkadot/storage": "^0.46.4",
"@polkadot/types": "^0.46.4",
"@polkadot/util-crypto": "^0.35.1"
"@polkadot/util-crypto": "^0.35.4"
}
}
+1 -1
View File
@@ -33,6 +33,6 @@
"@polkadot/jsonrpc": "^0.46.4",
"@polkadot/rpc-provider": "^0.46.4",
"@polkadot/types": "^0.46.4",
"@polkadot/util": "^0.35.1"
"@polkadot/util": "^0.35.4"
}
}
+3 -3
View File
@@ -30,10 +30,10 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
"dependencies": {
"@babel/runtime": "^7.3.4",
"@polkadot/keyring": "^0.35.1",
"@polkadot/keyring": "^0.35.4",
"@polkadot/storage": "^0.46.4",
"@polkadot/util": "^0.35.1",
"@polkadot/util-crypto": "^0.35.1",
"@polkadot/util": "^0.35.4",
"@polkadot/util-crypto": "^0.35.4",
"@types/nock": "^9.3.1",
"eventemitter3": "^3.1.0",
"isomorphic-fetch": "^2.2.1",
+1 -1
View File
@@ -12,6 +12,6 @@
"dependencies": {
"@babel/runtime": "^7.3.4",
"@polkadot/types": "^0.46.4",
"@polkadot/util": "^0.35.1"
"@polkadot/util": "^0.35.4"
}
}
+3 -3
View File
@@ -30,9 +30,9 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-storage#readme",
"dependencies": {
"@babel/runtime": "^7.3.4",
"@polkadot/keyring": "^0.35.1",
"@polkadot/keyring": "^0.35.4",
"@polkadot/types": "^0.46.4",
"@polkadot/util": "^0.35.1",
"@polkadot/util-crypto": "^0.35.1"
"@polkadot/util": "^0.35.4",
"@polkadot/util-crypto": "^0.35.4"
}
}
+2 -2
View File
@@ -30,8 +30,8 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
"dependencies": {
"@babel/runtime": "^7.3.4",
"@polkadot/keyring": "^0.35.1",
"@polkadot/util": "^0.35.1",
"@polkadot/keyring": "^0.35.4",
"@polkadot/util": "^0.35.4",
"core-js": "^2.6.5"
}
}
+7
View File
@@ -65,6 +65,13 @@ export default class Enum extends Base<number> implements Codec {
return 1;
}
/**
* @description Returns the index for this value (equivalent to toNumber)
*/
get index (): number {
return this.raw;
}
/**
* @description Checks if the value is an empty value (always false)
*/
+1 -1
View File
@@ -133,7 +133,7 @@ export default class EnumType<T> extends Base<Codec> implements Codec {
* @description Checks if the Enum points to a [[Null]] type
*/
get isNone (): boolean {
return this.raw instanceof Null;
return this.isNull;
}
/**
+19 -19
View File
@@ -1429,14 +1429,14 @@
typescript "^3.3.3333"
vuepress "^1.0.0-alpha.40"
"@polkadot/keyring@^0.35.1":
version "0.35.1"
resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-0.35.1.tgz#04a61da22eccee11d704911a719d9b29130bf1ea"
integrity sha512-jbKI7W/YO8YRo7Op7BaLypzERHwvNbkoWGLVHApS3TB2Jiog2lbMYAcZc7LdSJ/iJmq9qq32YwdW/X9enshmmw==
"@polkadot/keyring@^0.35.4":
version "0.35.4"
resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-0.35.4.tgz#c7a6eca79a53c0468fa2a32b4647e5866460f9de"
integrity sha512-muqVxGXigwW+ahQKBCDc0vdeOatP82vbcu4p7tz/LIzgfKmHX85JBWi63lcNTWljabJSRf9mqlf3jaU7L4OXlw==
dependencies:
"@babel/runtime" "^7.3.4"
"@polkadot/util" "^0.35.1"
"@polkadot/util-crypto" "^0.35.1"
"@polkadot/util" "^0.35.4"
"@polkadot/util-crypto" "^0.35.4"
"@types/bs58" "^4.0.0"
bs58 "^4.0.1"
@@ -1445,19 +1445,19 @@
resolved "https://registry.yarnpkg.com/@polkadot/schnorrkel-js/-/schnorrkel-js-0.1.2-3.tgz#9117ac5126b465a1cf53c2b6bb68a17efc7e0390"
integrity sha512-1LgF4wtER3q5uqY67CdOsQQ/SBqT6v0ZKQIS3cOTVByF16WtApD6U324uCJyMdie+GZFv0xr/40I4Ni2It+8jw==
"@polkadot/ts@^0.1.55":
version "0.1.55"
resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.1.55.tgz#6bd5840035e8bde0e53932b136253e90398313b7"
integrity sha512-OWB9GTS3BUVY1VU5JtDnN02RytchS+nN5WJg/aLhGR1BMU4DNqef7rgDonhJEaEbZzlQ/j+S+colK/0MYzQ9Bw==
"@polkadot/ts@^0.1.56":
version "0.1.56"
resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.1.56.tgz#ffd6e9c95704a7fb90b918193b9dc5c440114b27"
integrity sha512-wnt4zXxZXyz6WaubTO/I+nUElwV2DogFzdl6CrKfVn2PTWp8uHN06W9s40FH57ORtmQfDr9rLRP8Nq+oIyElbg==
"@polkadot/util-crypto@^0.35.1":
version "0.35.1"
resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-0.35.1.tgz#ffab577638f3f2e5344920664687fad31ab7e4a5"
integrity sha512-sicQrYAbaRPkcVAmGinE619e+CO5zwHgBLzLap9bWiKl5TDIjhnr1464yUFvDHcfVmyetsTBDEvqMVkUBhjL7w==
"@polkadot/util-crypto@^0.35.4":
version "0.35.4"
resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-0.35.4.tgz#f63d9a0fb1527b506e391ec77e51edcbfb5597f5"
integrity sha512-CsdP2u+OEzk7zIuptHY6OEJpCvamgb2p+n80qO3g+VCF9144ArB/UzOE1Zw0ixNHOs6Dj6M2qYUMZf8hUrIvAg==
dependencies:
"@babel/runtime" "^7.3.4"
"@polkadot/schnorrkel-js" "^0.1.2-3"
"@polkadot/util" "^0.35.1"
"@polkadot/util" "^0.35.4"
"@types/bip39" "^2.4.2"
"@types/pbkdf2" "^3.0.0"
"@types/secp256k1" "^3.5.0"
@@ -1470,10 +1470,10 @@
tweetnacl "^1.0.1"
xxhashjs "^0.2.2"
"@polkadot/util@^0.35.1":
version "0.35.1"
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.35.1.tgz#77df48a38c67d7eee62f797673b74cdf8c145879"
integrity sha512-F5SFQNvEOEV3DInXUpjfwP22N2+W5yaFuo6gTB+7JyrqIU46V/ilqFgc8FG/I1EHDMnYuvdelNmij1XJli2YEQ==
"@polkadot/util@^0.35.4":
version "0.35.4"
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.35.4.tgz#1e84ca76c08768b8ac7d73c84308c1d7d1077295"
integrity sha512-JhhfqDBcxHud3dlBt6xqDvnCS52mz7RN1QJOZMiOTrf12vyq3GN6NrEUcTOgiTGy3mUyB2t+5zx24VX8HrTeKA==
dependencies:
"@babel/runtime" "^7.3.4"
"@types/bn.js" "^4.11.4"