Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ca6575245 | ||
|
|
4cadf3bcb7 | ||
|
|
81f8f16b98 | ||
|
|
8edfb1139f | ||
|
|
69d1d896d1 | ||
|
|
3bc62adf6f | ||
|
|
691a8e9b18 | ||
|
|
fc812590e5 | ||
|
|
05499abcd5 | ||
|
|
e375dd8a9d | ||
|
|
3269883e8f | ||
|
|
c99129ee06 | ||
|
|
2514e107bf | ||
|
|
3c34a0e1f2 |
@@ -0,0 +1 @@
|
|||||||
|
9.7.1
|
||||||
+2
-1
@@ -27,4 +27,5 @@
|
|||||||
8.1.2
|
8.1.2
|
||||||
8.2.2
|
8.2.2
|
||||||
8.3.2
|
8.3.2
|
||||||
8.3.3
|
8.3.3
|
||||||
|
9.6.2
|
||||||
@@ -1,5 +1,21 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## 9.7.1 Jul 1, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Update signatures where `readonly` arrays are used
|
||||||
|
- Upgrade dependencies to latest stable versions
|
||||||
|
- Upgrade to `@polkadot/wasm-crypto` 6.2.1
|
||||||
|
|
||||||
|
|
||||||
|
## 9.6.2 Jun 25, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Fix `hexToU8a` where `0x` is not correctly converted
|
||||||
|
|
||||||
|
|
||||||
## 9.6.1 Jun 23, 2022
|
## 9.6.1 Jun 23, 2022
|
||||||
|
|
||||||
Changes:
|
Changes:
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
1384 Jaco 9.6.1 (#1565)
|
1391 Jaco 9.7.1 (#1572)
|
||||||
9 Antoine Estienne Add eth uri keyring test (#1291)
|
9 Antoine Estienne Add eth uri keyring test (#1291)
|
||||||
6 Amaury Martiny Add tests from Rust (#283)
|
6 Amaury Martiny Add tests from Rust (#283)
|
||||||
5 kwingram25 Add BN consts and timeToString (#610)
|
5 kwingram25 Add BN consts and timeToString (#610)
|
||||||
|
|||||||
+4
-4
@@ -10,7 +10,7 @@
|
|||||||
"url": "https://github.com/polkadot-js/common.git"
|
"url": "https://github.com/polkadot-js/common.git"
|
||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"version": "9.6.1",
|
"version": "9.7.1",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
],
|
],
|
||||||
@@ -27,9 +27,9 @@
|
|||||||
"test:one": "polkadot-dev-run-test --runInBand"
|
"test:one": "polkadot-dev-run-test --runInBand"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.18.5",
|
"@babel/core": "^7.18.6",
|
||||||
"@polkadot/dev": "^0.67.36",
|
"@polkadot/dev": "^0.67.46",
|
||||||
"@types/jest": "^28.1.3"
|
"@types/jest": "^28.1.4"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^4.7.4"
|
||||||
|
|||||||
@@ -16,16 +16,16 @@
|
|||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "9.6.1",
|
"version": "9.7.1",
|
||||||
"browser": "browser.js",
|
"browser": "browser.js",
|
||||||
"main": "node.js",
|
"main": "node.js",
|
||||||
"react-native": "react-native.js",
|
"react-native": "react-native.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.18.3",
|
"@babel/runtime": "^7.18.6",
|
||||||
"@ledgerhq/hw-transport": "^6.27.1",
|
"@ledgerhq/hw-transport": "^6.27.1",
|
||||||
"@ledgerhq/hw-transport-webhid": "^6.27.1",
|
"@ledgerhq/hw-transport-webhid": "^6.27.1",
|
||||||
"@ledgerhq/hw-transport-webusb": "^6.27.1",
|
"@ledgerhq/hw-transport-webusb": "^6.27.1",
|
||||||
"@polkadot/util": "9.6.1"
|
"@polkadot/util": "9.7.1"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@ledgerhq/hw-transport-node-hid-singleton": "^6.27.1"
|
"@ledgerhq/hw-transport-node-hid-singleton": "^6.27.1"
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/hw-ledger-transports', path: 'auto', type: 'auto', version: '9.6.1' };
|
export const packageInfo = { name: '@polkadot/hw-ledger-transports', path: 'auto', type: 'auto', version: '9.7.1' };
|
||||||
|
|||||||
@@ -19,13 +19,13 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "9.6.1",
|
"version": "9.7.1",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.18.3",
|
"@babel/runtime": "^7.18.6",
|
||||||
"@ledgerhq/hw-transport": "^6.27.1",
|
"@ledgerhq/hw-transport": "^6.27.1",
|
||||||
"@polkadot/hw-ledger-transports": "9.6.1",
|
"@polkadot/hw-ledger-transports": "9.7.1",
|
||||||
"@polkadot/util": "9.6.1",
|
"@polkadot/util": "9.7.1",
|
||||||
"@zondax/ledger-substrate": "^0.31.0"
|
"@zondax/ledger-substrate": "^0.31.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/hw-ledger', path: 'auto', type: 'auto', version: '9.6.1' };
|
export const packageInfo = { name: '@polkadot/hw-ledger', path: 'auto', type: 'auto', version: '9.7.1' };
|
||||||
|
|||||||
@@ -20,15 +20,15 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "9.6.1",
|
"version": "9.7.1",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.18.3",
|
"@babel/runtime": "^7.18.6",
|
||||||
"@polkadot/util": "9.6.1",
|
"@polkadot/util": "9.7.1",
|
||||||
"@polkadot/util-crypto": "9.6.1"
|
"@polkadot/util-crypto": "9.7.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@polkadot/util": "9.6.1",
|
"@polkadot/util": "9.7.1",
|
||||||
"@polkadot/util-crypto": "9.6.1"
|
"@polkadot/util-crypto": "9.7.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/keyring', path: 'auto', type: 'auto', version: '9.6.1' };
|
export const packageInfo = { name: '@polkadot/keyring', path: 'auto', type: 'auto', version: '9.7.1' };
|
||||||
|
|||||||
@@ -17,15 +17,15 @@
|
|||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "9.6.1",
|
"version": "9.7.1",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.18.3",
|
"@babel/runtime": "^7.18.6",
|
||||||
"@polkadot/util": "9.6.1",
|
"@polkadot/util": "9.7.1",
|
||||||
"@substrate/ss58-registry": "^1.22.0"
|
"@substrate/ss58-registry": "^1.23.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/hw-ledger": "9.6.1",
|
"@polkadot/hw-ledger": "9.7.1",
|
||||||
"@polkadot/x-fetch": "9.6.1"
|
"@polkadot/x-fetch": "9.7.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/networks', path: 'auto', type: 'auto', version: '9.6.1' };
|
export const packageInfo = { name: '@polkadot/networks', path: 'auto', type: 'auto', version: '9.7.1' };
|
||||||
|
|||||||
@@ -438,7 +438,7 @@
|
|||||||
"NODL"
|
"NODL"
|
||||||
],
|
],
|
||||||
"decimals": [
|
"decimals": [
|
||||||
18
|
11
|
||||||
],
|
],
|
||||||
"standardAccount": "*25519",
|
"standardAccount": "*25519",
|
||||||
"website": "https://nodle.io/"
|
"website": "https://nodle.io/"
|
||||||
@@ -659,6 +659,32 @@
|
|||||||
"standardAccount": "*25519",
|
"standardAccount": "*25519",
|
||||||
"website": "https://xx.network"
|
"website": "https://xx.network"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"prefix": 56,
|
||||||
|
"network": "pendulum",
|
||||||
|
"displayName": "Pendulum chain",
|
||||||
|
"symbols": [
|
||||||
|
"PEN"
|
||||||
|
],
|
||||||
|
"decimals": [
|
||||||
|
12
|
||||||
|
],
|
||||||
|
"standardAccount": "*25519",
|
||||||
|
"website": "https://pendulumchain.org/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"prefix": 57,
|
||||||
|
"network": "amplitude",
|
||||||
|
"displayName": "Amplitude chain",
|
||||||
|
"symbols": [
|
||||||
|
"AMPE"
|
||||||
|
],
|
||||||
|
"decimals": [
|
||||||
|
12
|
||||||
|
],
|
||||||
|
"standardAccount": "*25519",
|
||||||
|
"website": "https://pendulumchain.org/"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"prefix": 63,
|
"prefix": 63,
|
||||||
"network": "hydradx",
|
"network": "hydradx",
|
||||||
@@ -1036,6 +1062,32 @@
|
|||||||
"standardAccount": "Sr25519",
|
"standardAccount": "Sr25519",
|
||||||
"website": "https://efinity.io/"
|
"website": "https://efinity.io/"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"prefix": 1221,
|
||||||
|
"network": "peaq",
|
||||||
|
"displayName": "Peaq Network",
|
||||||
|
"symbols": [
|
||||||
|
"PEAQ"
|
||||||
|
],
|
||||||
|
"decimals": [
|
||||||
|
18
|
||||||
|
],
|
||||||
|
"standardAccount": "Sr25519",
|
||||||
|
"website": "https://www.peaq.network/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"prefix": 1222,
|
||||||
|
"network": "apex",
|
||||||
|
"displayName": "Apex Network",
|
||||||
|
"symbols": [
|
||||||
|
"APEX"
|
||||||
|
],
|
||||||
|
"decimals": [
|
||||||
|
18
|
||||||
|
],
|
||||||
|
"standardAccount": "Sr25519",
|
||||||
|
"website": "https://www.peaq.network/"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"prefix": 1284,
|
"prefix": 1284,
|
||||||
"network": "moonbeam",
|
"network": "moonbeam",
|
||||||
@@ -1244,6 +1296,21 @@
|
|||||||
"standardAccount": "*25519",
|
"standardAccount": "*25519",
|
||||||
"website": "https://ata.network"
|
"website": "https://ata.network"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"prefix": 15253,
|
||||||
|
"network": "ice-network",
|
||||||
|
"displayName": "ICE Network",
|
||||||
|
"symbols": [
|
||||||
|
"ICX",
|
||||||
|
"ICY"
|
||||||
|
],
|
||||||
|
"decimals": [
|
||||||
|
18,
|
||||||
|
18
|
||||||
|
],
|
||||||
|
"standardAccount": "*25519",
|
||||||
|
"website": "https://icenetwork.io"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"prefix": 12191,
|
"prefix": 12191,
|
||||||
"network": "nftmart",
|
"network": "nftmart",
|
||||||
|
|||||||
@@ -22,21 +22,21 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "9.6.1",
|
"version": "9.7.1",
|
||||||
"browser": {
|
"browser": {
|
||||||
"crypto": false,
|
"crypto": false,
|
||||||
"stream": false
|
"stream": false
|
||||||
},
|
},
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.18.3",
|
"@babel/runtime": "^7.18.6",
|
||||||
"@noble/hashes": "1.1.2",
|
"@noble/hashes": "1.1.2",
|
||||||
"@noble/secp256k1": "1.6.0",
|
"@noble/secp256k1": "1.6.0",
|
||||||
"@polkadot/networks": "9.6.1",
|
"@polkadot/networks": "9.7.1",
|
||||||
"@polkadot/util": "9.6.1",
|
"@polkadot/util": "9.7.1",
|
||||||
"@polkadot/wasm-crypto": "^6.1.5",
|
"@polkadot/wasm-crypto": "^6.2.1",
|
||||||
"@polkadot/x-bigint": "9.6.1",
|
"@polkadot/x-bigint": "9.7.1",
|
||||||
"@polkadot/x-randomvalues": "9.6.1",
|
"@polkadot/x-randomvalues": "9.7.1",
|
||||||
"@scure/base": "1.1.1",
|
"@scure/base": "1.1.1",
|
||||||
"ed2curve": "^0.3.0",
|
"ed2curve": "^0.3.0",
|
||||||
"tweetnacl": "^1.0.3"
|
"tweetnacl": "^1.0.3"
|
||||||
@@ -45,6 +45,6 @@
|
|||||||
"@types/ed2curve": "^0.2.2"
|
"@types/ed2curve": "^0.2.2"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@polkadot/util": "9.6.1"
|
"@polkadot/util": "9.7.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/util-crypto', path: 'auto', type: 'auto', version: '9.6.1' };
|
export const packageInfo = { name: '@polkadot/util-crypto', path: 'auto', type: 'auto', version: '9.7.1' };
|
||||||
|
|||||||
@@ -34,19 +34,19 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "9.6.1",
|
"version": "9.7.1",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.18.3",
|
"@babel/runtime": "^7.18.6",
|
||||||
"@polkadot/x-bigint": "9.6.1",
|
"@polkadot/x-bigint": "9.7.1",
|
||||||
"@polkadot/x-global": "9.6.1",
|
"@polkadot/x-global": "9.7.1",
|
||||||
"@polkadot/x-textdecoder": "9.6.1",
|
"@polkadot/x-textdecoder": "9.7.1",
|
||||||
"@polkadot/x-textencoder": "9.6.1",
|
"@polkadot/x-textencoder": "9.7.1",
|
||||||
"@types/bn.js": "^5.1.0",
|
"@types/bn.js": "^5.1.0",
|
||||||
"bn.js": "^5.2.1",
|
"bn.js": "^5.2.1",
|
||||||
"ip-regex": "^4.3.0"
|
"ip-regex": "^4.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/x-randomvalues": "9.6.1"
|
"@polkadot/x-randomvalues": "9.7.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
* arrayFilter([0, void 0, true, null, false, ''], false); // [0, true, false, '']
|
* arrayFilter([0, void 0, true, null, false, ''], false); // [0, true, false, '']
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export function arrayFilter <T = unknown> (array: (T | null | undefined)[], allowNulls = true): T[] {
|
export function arrayFilter <T = unknown> (array: readonly (T | null | undefined)[], allowNulls = true): T[] {
|
||||||
return array.filter((v): v is T =>
|
return array.filter((v): v is T =>
|
||||||
v !== undefined &&
|
v !== undefined &&
|
||||||
(allowNulls || v !== null)
|
(allowNulls || v !== null)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
* arrayFlatten([[1, 2], [3, 4], [5]]); // [1, 2, 3, 4, 5]
|
* arrayFlatten([[1, 2], [3, 4], [5]]); // [1, 2, 3, 4, 5]
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export function arrayFlatten <T> (arrays: T[][]): T[] {
|
export function arrayFlatten <T> (arrays: readonly T[][]): T[] {
|
||||||
// noop for the single-entry case
|
// noop for the single-entry case
|
||||||
if (arrays.length === 1) {
|
if (arrays.length === 1) {
|
||||||
return arrays[0];
|
return arrays[0];
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @name arrayZip
|
* @name arrayZip
|
||||||
* @description Combines 2 distinct key/value arrays into a single [K, V] array
|
* @description Combines 2 distinct key/value arrays into a single [K, V] array
|
||||||
*/
|
*/
|
||||||
export function arrayZip <K, V> (keys: K[], values: V[]): [K, V][] {
|
export function arrayZip <K, V> (keys: readonly K[], values: readonly V[]): [K, V][] {
|
||||||
const result = new Array<[K, V]>(keys.length);
|
const result = new Array<[K, V]>(keys.length);
|
||||||
|
|
||||||
for (let i = 0; i < keys.length; i++) {
|
for (let i = 0; i < keys.length; i++) {
|
||||||
|
|||||||
@@ -18,6 +18,12 @@ describe('hexToU8a', (): void => {
|
|||||||
).toHaveLength(0);
|
).toHaveLength(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('returns an empty Uint8Array when 0x provided', (): void => {
|
||||||
|
expect(
|
||||||
|
hexToU8a('0x')
|
||||||
|
).toHaveLength(0);
|
||||||
|
});
|
||||||
|
|
||||||
it('returns a Uint8Array with the correct values', (): void => {
|
it('returns a Uint8Array with the correct values', (): void => {
|
||||||
expect(
|
expect(
|
||||||
hexToU8a('0x80000a')
|
hexToU8a('0x80000a')
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ for (let i = 0; i < CHARS.length; i++) {
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export function hexToU8a (value?: HexString | string | null, bitLength = -1): Uint8Array {
|
export function hexToU8a (value?: HexString | string | null, bitLength = -1): Uint8Array {
|
||||||
if (!value) {
|
if (!value || value === '0x') {
|
||||||
return new Uint8Array();
|
return new Uint8Array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export function lazyMethod <T, K> (result: Record<string, T> | AnyFn, item: K, c
|
|||||||
* @description
|
* @description
|
||||||
* Creates lazy, on-demand getters for the specific values.
|
* Creates lazy, on-demand getters for the specific values.
|
||||||
*/
|
*/
|
||||||
export function lazyMethods <T, K> (result: Record<string, T>, items: K[], creator: (v: K) => T, getName?: (m: K) => string): Record<string, T> {
|
export function lazyMethods <T, K> (result: Record<string, T>, items: readonly K[], creator: (v: K) => T, getName?: (m: K) => string): Record<string, T> {
|
||||||
for (let i = 0; i < items.length; i++) {
|
for (let i = 0; i < items.length; i++) {
|
||||||
lazyMethod(result, items[i], creator, getName);
|
lazyMethod(result, items[i], creator, getName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ function isDebugOff (e: string, type: string): boolean {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDebugFlag (env: string[], type: string): boolean {
|
function getDebugFlag (env: readonly string[], type: string): boolean {
|
||||||
let flag = false;
|
let flag = false;
|
||||||
|
|
||||||
for (const e of env) {
|
for (const e of env) {
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/util', path: 'auto', type: 'auto', version: '9.6.1' };
|
export const packageInfo = { name: '@polkadot/util', path: 'auto', type: 'auto', version: '9.7.1' };
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import type { AnyString } from '../types';
|
|||||||
import { CC_TO_LO, CC_TO_UP } from './camelCase';
|
import { CC_TO_LO, CC_TO_UP } from './camelCase';
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
function converter (map: string[]): (value?: AnyString | null) => string {
|
function converter (map: readonly string[]): (value?: AnyString | null) => string {
|
||||||
return (value?: AnyString | null): string =>
|
return (value?: AnyString | null): string =>
|
||||||
value
|
value
|
||||||
? map[value.charCodeAt(0)] + value.slice(1)
|
? map[value.charCodeAt(0)] + value.slice(1)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ type ExecFn = (...params: any[]) => unknown;
|
|||||||
const NUM_PAD = 16;
|
const NUM_PAD = 16;
|
||||||
const PRE_PAD = 32;
|
const PRE_PAD = 32;
|
||||||
|
|
||||||
function loop (count: number, inputs: unknown[][], exec: ExecFn): [number, unknown[]] {
|
function loop (count: number, inputs: readonly unknown[][], exec: ExecFn): [number, unknown[]] {
|
||||||
const start = performance.now();
|
const start = performance.now();
|
||||||
const results = new Array<unknown>(inputs.length);
|
const results = new Array<unknown>(inputs.length);
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ ${formatFixed(ops).padStart(NUM_PAD + PRE_PAD + 1)} ops/s
|
|||||||
${formatFixed(micro).padStart(NUM_PAD + PRE_PAD + 1)} μs/op`;
|
${formatFixed(micro).padStart(NUM_PAD + PRE_PAD + 1)} μs/op`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function perf (name: string, count: number, inputs: unknown[][], exec: ExecFn): void {
|
export function perf (name: string, count: number, inputs: readonly unknown[][], exec: ExecFn): void {
|
||||||
if (process.env.GITHUB_REPOSITORY) {
|
if (process.env.GITHUB_REPOSITORY) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ ${`${name}:`.padStart(PRE_PAD)} ${time.toFixed(2).padStart(NUM_PAD)} ms${formatO
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function perfCmp (name: string, [first, second]: [string, string], count: number, inputs: unknown[][], exec: ExecFn): void {
|
export function perfCmp (name: string, [first, second]: [string, string], count: number, inputs: readonly unknown[][], exec: ExecFn): void {
|
||||||
if (process.env.GITHUB_REPOSITORY) {
|
if (process.env.GITHUB_REPOSITORY) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import { u8aToU8a } from './toU8a';
|
|||||||
* ); // [1, 2, 3, 4, 5, 6]
|
* ); // [1, 2, 3, 4, 5, 6]
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export function u8aConcat (...list: U8aLike[]): Uint8Array {
|
export function u8aConcat (...list: readonly U8aLike[]): Uint8Array {
|
||||||
const u8as = new Array<Uint8Array>(list.length);
|
const u8as = new Array<Uint8Array>(list.length);
|
||||||
let length = 0;
|
let length = 0;
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ export function u8aConcat (...list: U8aLike[]): Uint8Array {
|
|||||||
* @name u8aConcatStrict
|
* @name u8aConcatStrict
|
||||||
* @description A strict version of [[u8aConcat]], accepting only Uint8Array inputs
|
* @description A strict version of [[u8aConcat]], accepting only Uint8Array inputs
|
||||||
*/
|
*/
|
||||||
export function u8aConcatStrict (u8as: Uint8Array[], length = 0): Uint8Array {
|
export function u8aConcatStrict (u8as: readonly Uint8Array[], length = 0): Uint8Array {
|
||||||
let offset = 0;
|
let offset = 0;
|
||||||
|
|
||||||
if (!length) {
|
if (!length) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import { u8aToU8a } from './toU8a';
|
|||||||
* ); // [1, 2, 3, 4, 5, 6]
|
* ); // [1, 2, 3, 4, 5, 6]
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export function u8aConcat (...list: U8aLike[]): Uint8Array {
|
export function u8aConcat (...list: readonly U8aLike[]): Uint8Array {
|
||||||
const u8as = new Array<Uint8Array>(list.length);
|
const u8as = new Array<Uint8Array>(list.length);
|
||||||
|
|
||||||
for (let i = 0; i < list.length; i++) {
|
for (let i = 0; i < list.length; i++) {
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
import { perf } from '../test/performance';
|
import { perf } from '../test/performance';
|
||||||
import { u8aEmpty } from '.';
|
import { u8aEmpty } from '.';
|
||||||
|
|
||||||
const ztest = new Uint8Array(32);
|
|
||||||
|
|
||||||
describe('u8aEmpty', (): void => {
|
describe('u8aEmpty', (): void => {
|
||||||
it('returns true on zero length', (): void => {
|
it('returns true on zero length', (): void => {
|
||||||
expect(
|
expect(
|
||||||
@@ -25,5 +23,22 @@ describe('u8aEmpty', (): void => {
|
|||||||
).toEqual(false);
|
).toEqual(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
perf('u8aEmpty (32 cmp)', 1000000, [[ztest]], u8aEmpty);
|
it('returns false when value is found (256)', (): void => {
|
||||||
|
const test = new Uint8Array(256);
|
||||||
|
|
||||||
|
expect(
|
||||||
|
u8aEmpty(test)
|
||||||
|
).toEqual(true);
|
||||||
|
|
||||||
|
test[128] = 1;
|
||||||
|
|
||||||
|
expect(
|
||||||
|
u8aEmpty(test)
|
||||||
|
).toEqual(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
perf('u8aEmpty (32 cmp)', 1_000_000, [[new Uint8Array(32)]], u8aEmpty);
|
||||||
|
perf('u8aEmpty (64 cmp)', 500_000, [[new Uint8Array(64)]], u8aEmpty);
|
||||||
|
perf('u8aEmpty (128 cmp)', 250_000, [[new Uint8Array(128)]], u8aEmpty);
|
||||||
|
perf('u8aEmpty (256 cmp)', 125_000, [[new Uint8Array(256)]], u8aEmpty);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,10 +8,11 @@
|
|||||||
* Checks to see if the input `Uint8Array` has zero length or contains all 0 values.
|
* Checks to see if the input `Uint8Array` has zero length or contains all 0 values.
|
||||||
*/
|
*/
|
||||||
export function u8aEmpty (value: Uint8Array): boolean {
|
export function u8aEmpty (value: Uint8Array): boolean {
|
||||||
// on smaller values < 64 bytes, the byte-by-byte compare is faster than
|
const len = value.length;
|
||||||
// allocating yet another object for DataView (on large buffers the DataView
|
|
||||||
// is much faster)
|
// on smaller sizes, the byte-by-byte compare is faster than allocating
|
||||||
for (let i = 0; i < value.length; i++) {
|
// another object for DataView (on very large arrays the DataView is faster)
|
||||||
|
for (let i = 0; i < len; i++) {
|
||||||
if (value[i]) {
|
if (value[i]) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,9 +20,9 @@
|
|||||||
"./shim.cjs"
|
"./shim.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "9.6.1",
|
"version": "9.7.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.18.3",
|
"@babel/runtime": "^7.18.6",
|
||||||
"@polkadot/x-global": "9.6.1"
|
"@polkadot/x-global": "9.7.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/x-bigint', path: 'auto', type: 'auto', version: '9.6.1' };
|
export const packageInfo = { name: '@polkadot/x-bigint', path: 'auto', type: 'auto', version: '9.7.1' };
|
||||||
|
|||||||
@@ -17,11 +17,11 @@
|
|||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "9.6.1",
|
"version": "9.7.1",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.18.3",
|
"@babel/runtime": "^7.18.6",
|
||||||
"@polkadot/util": "9.6.1",
|
"@polkadot/util": "9.7.1",
|
||||||
"buffer-es6": "^4.9.3"
|
"buffer-es6": "^4.9.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/x-bundle', path: 'auto', type: 'auto', version: '9.6.1' };
|
export const packageInfo = { name: '@polkadot/x-bundle', path: 'auto', type: 'auto', version: '9.7.1' };
|
||||||
|
|||||||
@@ -17,13 +17,13 @@
|
|||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "9.6.1",
|
"version": "9.7.1",
|
||||||
"browser": "browser.js",
|
"browser": "browser.js",
|
||||||
"main": "node.js",
|
"main": "node.js",
|
||||||
"react-native": "react-native.js",
|
"react-native": "react-native.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.18.3",
|
"@babel/runtime": "^7.18.6",
|
||||||
"@polkadot/x-global": "9.6.1",
|
"@polkadot/x-global": "9.7.1",
|
||||||
"@types/node-fetch": "^2.6.2",
|
"@types/node-fetch": "^2.6.2",
|
||||||
"node-fetch": "^2.6.7"
|
"node-fetch": "^2.6.7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/x-fetch', path: 'auto', type: 'auto', version: '9.6.1' };
|
export const packageInfo = { name: '@polkadot/x-fetch', path: 'auto', type: 'auto', version: '9.7.1' };
|
||||||
|
|||||||
@@ -17,9 +17,9 @@
|
|||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "9.6.1",
|
"version": "9.7.1",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.18.3"
|
"@babel/runtime": "^7.18.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/x-global', path: 'auto', type: 'auto', version: '9.6.1' };
|
export const packageInfo = { name: '@polkadot/x-global', path: 'auto', type: 'auto', version: '9.7.1' };
|
||||||
|
|||||||
@@ -17,15 +17,15 @@
|
|||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "9.6.1",
|
"version": "9.7.1",
|
||||||
"browser": "browser.js",
|
"browser": "browser.js",
|
||||||
"main": "node.js",
|
"main": "node.js",
|
||||||
"react-native": "react-native.js",
|
"react-native": "react-native.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.18.3",
|
"@babel/runtime": "^7.18.6",
|
||||||
"@polkadot/x-global": "9.6.1"
|
"@polkadot/x-global": "9.7.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react-native": "^0.68.0"
|
"@types/react-native": "^0.69.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/x-randomvalues', path: 'auto', type: 'auto', version: '9.6.1' };
|
export const packageInfo = { name: '@polkadot/x-randomvalues', path: 'auto', type: 'auto', version: '9.7.1' };
|
||||||
|
|||||||
@@ -17,12 +17,12 @@
|
|||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "9.6.1",
|
"version": "9.7.1",
|
||||||
"browser": "browser.js",
|
"browser": "browser.js",
|
||||||
"main": "node.js",
|
"main": "node.js",
|
||||||
"react-native": "react-native.js",
|
"react-native": "react-native.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.18.3",
|
"@babel/runtime": "^7.18.6",
|
||||||
"@polkadot/x-global": "9.6.1"
|
"@polkadot/x-global": "9.7.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/x-textdecoder', path: 'auto', type: 'auto', version: '9.6.1' };
|
export const packageInfo = { name: '@polkadot/x-textdecoder', path: 'auto', type: 'auto', version: '9.7.1' };
|
||||||
|
|||||||
@@ -17,12 +17,12 @@
|
|||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "9.6.1",
|
"version": "9.7.1",
|
||||||
"browser": "browser.js",
|
"browser": "browser.js",
|
||||||
"main": "node.js",
|
"main": "node.js",
|
||||||
"react-native": "react-native.js",
|
"react-native": "react-native.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.18.3",
|
"@babel/runtime": "^7.18.6",
|
||||||
"@polkadot/x-global": "9.6.1"
|
"@polkadot/x-global": "9.7.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/x-textencoder', path: 'auto', type: 'auto', version: '9.6.1' };
|
export const packageInfo = { name: '@polkadot/x-textencoder', path: 'auto', type: 'auto', version: '9.7.1' };
|
||||||
|
|||||||
@@ -17,13 +17,13 @@
|
|||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "9.6.1",
|
"version": "9.7.1",
|
||||||
"browser": "browser.js",
|
"browser": "browser.js",
|
||||||
"main": "node.js",
|
"main": "node.js",
|
||||||
"react-native": "react-native.js",
|
"react-native": "react-native.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.18.3",
|
"@babel/runtime": "^7.18.6",
|
||||||
"@polkadot/x-global": "9.6.1",
|
"@polkadot/x-global": "9.7.1",
|
||||||
"@types/websocket": "^1.0.5",
|
"@types/websocket": "^1.0.5",
|
||||||
"websocket": "^1.0.34"
|
"websocket": "^1.0.34"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/x-ws', path: 'auto', type: 'auto', version: '9.6.1' };
|
export const packageInfo = { name: '@polkadot/x-ws', path: 'auto', type: 'auto', version: '9.7.1' };
|
||||||
|
|||||||
Reference in New Issue
Block a user