diff --git a/packages/db/src/FileFlatDb/Compact.spec.ts b/packages/db/src/FileFlatDb/Compact.spec.ts index 34a9de18f..a9cf8bea8 100644 --- a/packages/db/src/FileFlatDb/Compact.spec.ts +++ b/packages/db/src/FileFlatDb/Compact.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import FileFlatDb from './index'; +import FileFlatDb from '.'; describe.skip('FileFlatDb (compacting)', () => { const combined = new FileFlatDb(process.cwd()); diff --git a/packages/db/src/FileFlatDb/Compact.ts b/packages/db/src/FileFlatDb/Compact.ts index ec017033e..90fa8b91c 100644 --- a/packages/db/src/FileFlatDb/Compact.ts +++ b/packages/db/src/FileFlatDb/Compact.ts @@ -6,7 +6,7 @@ import { ProgressCb } from '../types'; import { Slot } from './types'; import fs from 'fs'; -import { assert, logger } from '@polkadot/util/index'; +import { assert, logger } from '@polkadot/util'; import defaults from './defaults'; diff --git a/packages/db/src/FileFlatDb/File.ts b/packages/db/src/FileFlatDb/File.ts index 2fa4df805..8d6ab5bbc 100644 --- a/packages/db/src/FileFlatDb/File.ts +++ b/packages/db/src/FileFlatDb/File.ts @@ -7,7 +7,7 @@ import { BaseDbOptions } from '../types'; import fs from 'fs'; import mkdirp from 'mkdirp'; import path from 'path'; -import { assert, isUndefined } from '@polkadot/util/index'; +import { assert, isUndefined } from '@polkadot/util'; import Serialize from './Serialize'; import defaults from './defaults'; diff --git a/packages/db/src/FileFlatDb/Impl.ts b/packages/db/src/FileFlatDb/Impl.ts index b02a26662..36b21891b 100644 --- a/packages/db/src/FileFlatDb/Impl.ts +++ b/packages/db/src/FileFlatDb/Impl.ts @@ -5,7 +5,7 @@ import { Key, NibbleBuffer, Slot, Value } from './types'; import fs from 'fs'; -import { logger } from '@polkadot/util/index'; +import { logger } from '@polkadot/util'; import Cache from './Cache'; import defaults from './defaults'; diff --git a/packages/db/src/FileFlatDb/Serialize.ts b/packages/db/src/FileFlatDb/Serialize.ts index 4e91bf35d..0868498ba 100644 --- a/packages/db/src/FileFlatDb/Serialize.ts +++ b/packages/db/src/FileFlatDb/Serialize.ts @@ -6,7 +6,7 @@ import { NibbleBuffer } from './types'; import snappy from 'snappy'; import { toNibbles } from '@polkadot/trie-codec/util'; -import { assert, bufferToU8a, u8aToBuffer, u8aToHex } from '@polkadot/util/index'; +import { assert, bufferToU8a, u8aToBuffer, u8aToHex } from '@polkadot/util'; import defaults from './defaults'; diff --git a/packages/db/src/FileFlatDb/index.spec.ts b/packages/db/src/FileFlatDb/index.spec.ts index 633d3484e..3fb36ee72 100644 --- a/packages/db/src/FileFlatDb/index.spec.ts +++ b/packages/db/src/FileFlatDb/index.spec.ts @@ -6,7 +6,7 @@ import mkdirp from 'mkdirp'; import path from 'path'; import rimraf from 'rimraf'; -import FileFlatDb from './index'; +import FileFlatDb from '.'; const KEY_A = new Uint8Array([ 0x10, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/packages/db/src/FileFlatDb/index.ts b/packages/db/src/FileFlatDb/index.ts index 411e9b259..7cd2faeef 100644 --- a/packages/db/src/FileFlatDb/index.ts +++ b/packages/db/src/FileFlatDb/index.ts @@ -7,7 +7,7 @@ import { Key, NibbleBuffer, Value } from './types'; import fs from 'fs'; import path from 'path'; -import { logger } from '@polkadot/util/index'; +import { logger } from '@polkadot/util'; import defaults from './defaults'; import Compact from './Compact'; diff --git a/packages/db/src/engines/FileTreeDb.ts b/packages/db/src/engines/FileTreeDb.ts index 0188f2fc5..2895edae6 100644 --- a/packages/db/src/engines/FileTreeDb.ts +++ b/packages/db/src/engines/FileTreeDb.ts @@ -6,7 +6,7 @@ import { BaseDb, ProgressCb } from '../types'; import fs from 'fs'; import mkdirp from 'mkdirp'; -import { bufferToU8a, logger, u8aToBuffer, u8aToHex } from '@polkadot/util/index'; +import { bufferToU8a, logger, u8aToBuffer, u8aToHex } from '@polkadot/util'; type FilePath = { directory: string, diff --git a/packages/db/src/engines/LmDb.ts b/packages/db/src/engines/LmDb.ts index 933569c48..05dac9e6a 100644 --- a/packages/db/src/engines/LmDb.ts +++ b/packages/db/src/engines/LmDb.ts @@ -8,7 +8,7 @@ import fs from 'fs'; import mkdirp from 'mkdirp'; import lmdb from 'node-lmdb'; import path from 'path'; -import { bufferToU8a, logger, u8aToBuffer } from '@polkadot/util/index'; +import { bufferToU8a, logger, u8aToBuffer } from '@polkadot/util'; const GB = 1 * 1024 * 1024 * 1024; diff --git a/packages/db/src/engines/LruDb.ts b/packages/db/src/engines/LruDb.ts index b3f97b401..03276a95c 100644 --- a/packages/db/src/engines/LruDb.ts +++ b/packages/db/src/engines/LruDb.ts @@ -5,7 +5,7 @@ import { BaseDb, ProgressCb } from '../types'; import { LRUMap } from 'lru_map'; -import { logger } from '@polkadot/util/index'; +import { logger } from '@polkadot/util'; type CachedValue = { value: Uint8Array | null diff --git a/packages/db/src/engines/MemoryDb.ts b/packages/db/src/engines/MemoryDb.ts index a68c3daa0..cc738431f 100644 --- a/packages/db/src/engines/MemoryDb.ts +++ b/packages/db/src/engines/MemoryDb.ts @@ -4,7 +4,7 @@ import { BaseDb, BaseDbOptions, ProgressCb } from '../types'; -import { logger } from '@polkadot/util/index'; +import { logger } from '@polkadot/util'; type Storage = { [index: string]: Uint8Array diff --git a/packages/db/src/engines/TransactionDb.ts b/packages/db/src/engines/TransactionDb.ts index f4572c8bc..2e276213f 100644 --- a/packages/db/src/engines/TransactionDb.ts +++ b/packages/db/src/engines/TransactionDb.ts @@ -4,7 +4,7 @@ import { BaseDb, TxDb, ProgressCb } from '../types'; -import { assert, isNull, logger } from '@polkadot/util/index'; +import { assert, isNull, logger } from '@polkadot/util'; type Overlay = { [index: string]: { diff --git a/packages/db/src/engines/unused/RocksDb.spec.ts-unused b/packages/db/src/engines/unused/RocksDb.spec.ts-unused index f0879e16c..54a35c16e 100644 --- a/packages/db/src/engines/unused/RocksDb.spec.ts-unused +++ b/packages/db/src/engines/unused/RocksDb.spec.ts-unused @@ -5,7 +5,7 @@ import os from 'os'; import path from 'path'; import rimraf from 'rimraf'; -import { stringToU8a } from '@polkadot/util/index'; +import { stringToU8a } from '@polkadot/util'; import RocksDb from '../RocksDb'; diff --git a/packages/db/src/engines/unused/RocksDb.ts-unused b/packages/db/src/engines/unused/RocksDb.ts-unused index acd4d787d..c4e6ed611 100644 --- a/packages/db/src/engines/unused/RocksDb.ts-unused +++ b/packages/db/src/engines/unused/RocksDb.ts-unused @@ -14,7 +14,7 @@ import rocksdb, { RocksDb } from 'rocksdb-node'; import mkdirp from 'mkdirp'; import path from 'path'; // import snappy from 'snappy'; -import { bufferToU8a, logger, u8aToBuffer, u8aToHex } from '@polkadot/util/index'; +import { bufferToU8a, logger, u8aToBuffer, u8aToHex } from '@polkadot/util'; const l = logger('db/rocksdb'); diff --git a/packages/keyring/src/address/decode.ts b/packages/keyring/src/address/decode.ts index 68e9ece5c..fbb741472 100644 --- a/packages/keyring/src/address/decode.ts +++ b/packages/keyring/src/address/decode.ts @@ -7,8 +7,8 @@ import { Prefix } from './types'; // Original implementation: https://github.com/paritytech/polka-ui/blob/4858c094684769080f5811f32b081dd7780b0880/src/polkadot.js#L6 import bs58 from 'bs58'; -import { assert, bufferToU8a, isHex, isU8a, u8aToU8a } from '@polkadot/util/index'; -import { blake2AsU8a } from '@polkadot/util-crypto/index'; +import { assert, bufferToU8a, isHex, isU8a, u8aToU8a } from '@polkadot/util'; +import { blake2AsU8a } from '@polkadot/util-crypto'; import defaults from './defaults'; diff --git a/packages/keyring/src/address/encode.ts b/packages/keyring/src/address/encode.ts index 8eb258aa2..42022ff22 100644 --- a/packages/keyring/src/address/encode.ts +++ b/packages/keyring/src/address/encode.ts @@ -7,8 +7,8 @@ import { Prefix } from './types'; // Original implementation: https://github.com/paritytech/polka-ui/blob/4858c094684769080f5811f32b081dd7780b0880/src/polkadot.js#L34 import bs58 from 'bs58'; -import { assert, u8aConcat, u8aToBuffer, u8aToU8a } from '@polkadot/util/index'; -import { blake2AsU8a } from '@polkadot/util-crypto/index'; +import { assert, u8aConcat, u8aToBuffer, u8aToU8a } from '@polkadot/util'; +import { blake2AsU8a } from '@polkadot/util-crypto'; import defaults from './defaults'; diff --git a/packages/keyring/src/index.spec.ts b/packages/keyring/src/index.spec.ts index 3eda78cb2..ac24099fa 100644 --- a/packages/keyring/src/index.spec.ts +++ b/packages/keyring/src/index.spec.ts @@ -4,10 +4,10 @@ import '@polkadot/util-crypto/schnorrkel/test-polyfill'; -import { hexToU8a, stringToU8a } from '@polkadot/util/index'; -import { cryptoWaitReady } from '@polkadot/util-crypto/index'; +import { hexToU8a, stringToU8a } from '@polkadot/util'; +import { cryptoWaitReady } from '@polkadot/util-crypto'; -import Keyring from './index'; +import Keyring from '.'; import setPrefix from './address/setPrefix'; describe('keypair', () => { diff --git a/packages/keyring/src/index.ts b/packages/keyring/src/index.ts index 3f7a2db70..a4b5f371a 100644 --- a/packages/keyring/src/index.ts +++ b/packages/keyring/src/index.ts @@ -5,8 +5,8 @@ import { KeypairType } from '@polkadot/util-crypto/types'; import { KeyringInstance, KeyringPair, KeyringPair$Json, KeyringPair$Meta, KeyringOptions } from './types'; -import { assert, hexToU8a, isNumber, isHex, stringToU8a } from '@polkadot/util/index'; -import { keyExtract, mnemonicToSeed , naclKeypairFromSeed as naclFromSeed, schnorrkelKeypairFromSeed as schnorrkelFromSeed, mnemonicToMiniSecret, keyFromPath } from '@polkadot/util-crypto/index'; +import { assert, hexToU8a, isNumber, isHex, stringToU8a } from '@polkadot/util'; +import { keyExtract, mnemonicToSeed , naclKeypairFromSeed as naclFromSeed, schnorrkelKeypairFromSeed as schnorrkelFromSeed, mnemonicToMiniSecret, keyFromPath } from '@polkadot/util-crypto'; import { decodeAddress, encodeAddress, setAddressPrefix } from './address'; import createPair from './pair'; diff --git a/packages/keyring/src/pair/decode.ts b/packages/keyring/src/pair/decode.ts index 210ed690d..e104932a3 100644 --- a/packages/keyring/src/pair/decode.ts +++ b/packages/keyring/src/pair/decode.ts @@ -2,8 +2,8 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { assert, stringToU8a, u8aFixLength } from '@polkadot/util/index'; -import { naclDecrypt } from '@polkadot/util-crypto/index'; +import { assert, stringToU8a, u8aFixLength } from '@polkadot/util'; +import { naclDecrypt } from '@polkadot/util-crypto'; import { PairInfo } from './types'; import { KEY_LENGTH, NONCE_LENGTH, PKCS8_DIVIDER, PKCS8_HEADER } from './defaults'; diff --git a/packages/keyring/src/pair/encode.ts b/packages/keyring/src/pair/encode.ts index 6090c6a2b..8db408f9e 100644 --- a/packages/keyring/src/pair/encode.ts +++ b/packages/keyring/src/pair/encode.ts @@ -4,8 +4,8 @@ import { PairInfo } from './types'; -import { stringToU8a, u8aConcat, u8aFixLength, assert } from '@polkadot/util/index'; -import { naclEncrypt } from '@polkadot/util-crypto/index'; +import { stringToU8a, u8aConcat, u8aFixLength, assert } from '@polkadot/util'; +import { naclEncrypt } from '@polkadot/util-crypto'; import { PKCS8_DIVIDER, PKCS8_HEADER } from './defaults'; diff --git a/packages/keyring/src/pair/index.ts b/packages/keyring/src/pair/index.ts index ad136838b..394a2881d 100644 --- a/packages/keyring/src/pair/index.ts +++ b/packages/keyring/src/pair/index.ts @@ -6,7 +6,7 @@ import { Keypair, KeypairType } from '@polkadot/util-crypto/types'; import { KeyringPair, KeyringPair$Json, KeyringPair$Meta } from '../types'; import { PairInfo } from './types'; -import { naclKeypairFromSeed as naclFromSeed, naclSign, naclVerify, schnorrkelKeypairFromSeed as schnorrkelFromSeed, schnorrkelSign, schnorrkelVerify } from '@polkadot/util-crypto/index'; +import { naclKeypairFromSeed as naclFromSeed, naclSign, naclVerify, schnorrkelKeypairFromSeed as schnorrkelFromSeed, schnorrkelSign, schnorrkelVerify } from '@polkadot/util-crypto'; import { encodeAddress } from '../address'; import decode from './decode'; diff --git a/packages/keyring/src/pair/toJson.ts b/packages/keyring/src/pair/toJson.ts index b32022f3a..8ea9e43c6 100644 --- a/packages/keyring/src/pair/toJson.ts +++ b/packages/keyring/src/pair/toJson.ts @@ -5,7 +5,7 @@ import { KeypairType } from '@polkadot/util-crypto/types'; import { KeyringPair$Json, KeyringPair$Meta } from '../types'; -import { u8aToHex } from '@polkadot/util/index'; +import { u8aToHex } from '@polkadot/util'; import { encodeAddress } from '../address'; diff --git a/packages/keyring/src/pairs.ts b/packages/keyring/src/pairs.ts index 255e59bdf..45883b7bf 100644 --- a/packages/keyring/src/pairs.ts +++ b/packages/keyring/src/pairs.ts @@ -4,7 +4,7 @@ import { KeyringPairs, KeyringPair } from './types'; -import { assert, isHex, isU8a, u8aToHex, u8aToU8a } from '@polkadot/util/index'; +import { assert, isHex, isU8a, u8aToHex, u8aToU8a } from '@polkadot/util'; import addressDecode from './address/decode'; diff --git a/packages/keyring/src/suri.spec.ts b/packages/keyring/src/suri.spec.ts index 7bdeb890e..0efdf58d4 100644 --- a/packages/keyring/src/suri.spec.ts +++ b/packages/keyring/src/suri.spec.ts @@ -4,10 +4,10 @@ // From https://github.com/paritytech/substrate/wiki/Secret-URI-Test-Vectors -import { u8aToHex } from '@polkadot/util/index'; -import { cryptoWaitReady } from '@polkadot/util-crypto/index'; +import { u8aToHex } from '@polkadot/util'; +import { cryptoWaitReady } from '@polkadot/util-crypto'; -import Keyring from './index'; +import Keyring from '.'; const PHRASE = 'bottom drive obey lake curtain smoke basket hold race lonely fit walk'; diff --git a/packages/keyring/src/testing.ts b/packages/keyring/src/testing.ts index 68df31064..c88d7a37e 100644 --- a/packages/keyring/src/testing.ts +++ b/packages/keyring/src/testing.ts @@ -4,7 +4,7 @@ import { KeyringInstance, KeyringOptions } from './types'; -import Keyring from './index'; +import Keyring from '.'; const DEV_PHRASE = 'bottom drive obey lake curtain smoke basket hold race lonely fit walk'; const SEEDS = ['Alice', 'Bob', 'Charlie', 'Dave', 'Eve', 'Ferdie']; diff --git a/packages/trie-codec/src/decode.spec.ts b/packages/trie-codec/src/decode.spec.ts index f0ed0b9ba..22d93dbc3 100644 --- a/packages/trie-codec/src/decode.spec.ts +++ b/packages/trie-codec/src/decode.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { hexToU8a } from '@polkadot/util/index'; +import { hexToU8a } from '@polkadot/util'; import decode from './decode'; diff --git a/packages/trie-codec/src/decode.ts b/packages/trie-codec/src/decode.ts index ac6e433a2..e8137741f 100644 --- a/packages/trie-codec/src/decode.ts +++ b/packages/trie-codec/src/decode.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { compactStripLength, logger } from '@polkadot/util/index'; +import { compactStripLength, logger } from '@polkadot/util'; import NodeHeader, { BranchHeader, NibbleHeader } from './NodeHeader'; import { NODE_TYPE_NULL, NODE_TYPE_BRANCH, NODE_TYPE_EXT, NODE_TYPE_LEAF } from './constants'; diff --git a/packages/trie-codec/src/encode.spec.ts b/packages/trie-codec/src/encode.spec.ts index f66b09137..42aa2b6b5 100644 --- a/packages/trie-codec/src/encode.spec.ts +++ b/packages/trie-codec/src/encode.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { hexToU8a } from '@polkadot/util/index'; +import { hexToU8a } from '@polkadot/util'; import encode from './encode'; diff --git a/packages/trie-codec/src/encode.ts b/packages/trie-codec/src/encode.ts index 06b3cead6..ba41baa9d 100644 --- a/packages/trie-codec/src/encode.ts +++ b/packages/trie-codec/src/encode.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { compactAddLength, u8aConcat, isU8a, logger } from '@polkadot/util/index'; +import { compactAddLength, u8aConcat, isU8a, logger } from '@polkadot/util'; import NodeHeader from './NodeHeader'; import { NODE_TYPE_BRANCH, NODE_TYPE_EXT, NODE_TYPE_LEAF, NODE_TYPE_NULL } from './constants'; diff --git a/packages/trie-codec/src/hashing.ts b/packages/trie-codec/src/hashing.ts index d5b7e1219..6b647a82c 100644 --- a/packages/trie-codec/src/hashing.ts +++ b/packages/trie-codec/src/hashing.ts @@ -2,6 +2,6 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { blake2AsU8a as hashing } from '@polkadot/util-crypto/index'; +import { blake2AsU8a as hashing } from '@polkadot/util-crypto'; export default hashing; diff --git a/packages/trie-codec/src/stream/createBranch.ts b/packages/trie-codec/src/stream/createBranch.ts index 6a434a5e5..9d0793535 100644 --- a/packages/trie-codec/src/stream/createBranch.ts +++ b/packages/trie-codec/src/stream/createBranch.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aConcat } from '@polkadot/util/index'; +import { u8aConcat } from '@polkadot/util'; import { BRANCH_NODE_NO_VALUE, BRANCH_NODE_WITH_VALUE } from '../constants'; import createValue from './createValue'; diff --git a/packages/trie-codec/src/stream/createLeaf.ts b/packages/trie-codec/src/stream/createLeaf.ts index 2fc4bc8ed..bd1165913 100644 --- a/packages/trie-codec/src/stream/createLeaf.ts +++ b/packages/trie-codec/src/stream/createLeaf.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aConcat } from '@polkadot/util/index'; +import { u8aConcat } from '@polkadot/util'; import { fuseNibbles } from '../util'; import createValue from './createValue'; diff --git a/packages/trie-codec/src/stream/createValue.ts b/packages/trie-codec/src/stream/createValue.ts index 78f7c6d89..1101c2256 100644 --- a/packages/trie-codec/src/stream/createValue.ts +++ b/packages/trie-codec/src/stream/createValue.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { compactAddLength } from '@polkadot/util/index'; +import { compactAddLength } from '@polkadot/util'; const NO_VALUE = new Uint8Array(); diff --git a/packages/trie-codec/src/util/fuseNibbles.ts b/packages/trie-codec/src/util/fuseNibbles.ts index 5c02a1adf..216d28728 100644 --- a/packages/trie-codec/src/util/fuseNibbles.ts +++ b/packages/trie-codec/src/util/fuseNibbles.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { assert, u8aConcat } from '@polkadot/util/index'; +import { assert, u8aConcat } from '@polkadot/util'; import { EXTENSION_NODE_BIG, EXTENSION_NODE_OFFSET, LEAF_NODE_BIG, LEAF_NODE_OFFSET } from '../constants'; import fromNibbles from './fromNibbles'; diff --git a/packages/trie-db/src/Impl.ts b/packages/trie-db/src/Impl.ts index f892fc1dd..a65c4cdee 100644 --- a/packages/trie-db/src/Impl.ts +++ b/packages/trie-db/src/Impl.ts @@ -6,9 +6,9 @@ import { TxDb, ProgressCb } from '@polkadot/db/types'; import { Codec } from '@polkadot/trie-codec/types'; import { EncodedPath, TrieDb, Node, NodeBranch, NodeEncodedOrEmpty, NodeKv, NodeNotEmpty, NodeType } from './types'; -import substrateCodec from '@polkadot/trie-codec/index'; +import substrateCodec from '@polkadot/trie-codec'; import { decodeNibbles, encodeNibbles, extractNodeKey } from '@polkadot/trie-codec/nibbles'; -import { isNull, logger , u8aConcat, u8aToHex } from '@polkadot/util/index'; +import { isNull, logger , u8aConcat, u8aToHex } from '@polkadot/util'; import { isBranchNode, isEmptyNode, isExtensionNode, isKvNode, isLeafNode } from './util/is'; import { keyEquals, keyStartsWith, computeExtensionKey, computeLeafKey, consumeCommonPrefix } from './util/key'; diff --git a/packages/trie-db/src/constants.ts b/packages/trie-db/src/constants.ts index 6fce42a0b..38a3d20dd 100644 --- a/packages/trie-db/src/constants.ts +++ b/packages/trie-db/src/constants.ts @@ -4,7 +4,7 @@ import { Codec } from '@polkadot/trie-codec/types'; -import { trieRoot } from '@polkadot/trie-hash/index'; +import { trieRoot } from '@polkadot/trie-hash'; export type Constants = { EMPTY_NODE: Uint8Array, diff --git a/packages/trie-db/src/ethereum.spec.ts b/packages/trie-db/src/ethereum.spec.ts index 14b461e29..075b6a7e4 100644 --- a/packages/trie-db/src/ethereum.spec.ts +++ b/packages/trie-db/src/ethereum.spec.ts @@ -6,7 +6,7 @@ import toU8a from '@polkadot/util/u8a/toU8a'; import u8aToHex from '@polkadot/util/u8a/toHex'; import ethereumCodec from './ethereumCodec'; -import Trie from './index'; +import Trie from '.'; import getTests from '../../util-rlp/test/getTests'; // const trietest = getTests('TrieTests/trietest.json'); diff --git a/packages/trie-db/src/ethereumCodec.ts b/packages/trie-db/src/ethereumCodec.ts index ac707c9f9..2ae9b37a9 100644 --- a/packages/trie-db/src/ethereumCodec.ts +++ b/packages/trie-db/src/ethereumCodec.ts @@ -4,8 +4,8 @@ import { Codec } from '@polkadot/trie-codec/types'; -import { blake2AsU8a } from '@polkadot/util-crypto/index'; -import { decode, encode } from '@polkadot/util-rlp/index'; +import { blake2AsU8a } from '@polkadot/util-crypto'; +import { decode, encode } from '@polkadot/util-rlp'; const codec: Codec = { decode, diff --git a/packages/trie-db/src/genesis.spec.ts b/packages/trie-db/src/genesis.spec.ts index 6622c099b..602e4ea99 100644 --- a/packages/trie-db/src/genesis.spec.ts +++ b/packages/trie-db/src/genesis.spec.ts @@ -2,10 +2,10 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { alexander, driedDanta } from '@polkadot/chainspec/index'; -import { hexToU8a, u8aToHex } from '@polkadot/util/index'; +import { alexander, driedDanta } from '@polkadot/chainspec'; +import { hexToU8a, u8aToHex } from '@polkadot/util'; -import Trie from './index'; +import Trie from '.'; describe('genesis roots', () => { [alexander, driedDanta].forEach(({ genesis: { raw }, genesisRoot, name }) => { diff --git a/packages/trie-db/src/index.spec.ts b/packages/trie-db/src/index.spec.ts index 8738570e4..b49c59d4a 100644 --- a/packages/trie-db/src/index.spec.ts +++ b/packages/trie-db/src/index.spec.ts @@ -7,7 +7,7 @@ import u8aToHex from '@polkadot/util/u8a/toHex'; import toU8a from '@polkadot/util/u8a/toU8a'; import ethereumCodec from './ethereumCodec'; -import Trie from './index'; +import Trie from '.'; // FIXME These are not working, the trie-hash implementation is now substrate-specific describe.skip('Ethereum', () => { diff --git a/packages/trie-db/src/index.ts b/packages/trie-db/src/index.ts index 54b26b37e..ce85a308b 100644 --- a/packages/trie-db/src/index.ts +++ b/packages/trie-db/src/index.ts @@ -8,7 +8,7 @@ import { TrieDb, Node } from './types'; import MemoryDb from '@polkadot/db/Memory'; import { toNibbles } from '@polkadot/trie-codec/util'; -import { isNull, logger, u8aToHex } from '@polkadot/util/index'; +import { isNull, logger, u8aToHex } from '@polkadot/util'; import Impl from './Impl'; import constants from './constants'; diff --git a/packages/trie-db/src/snapshot.spec.ts b/packages/trie-db/src/snapshot.spec.ts index c644dda79..f15bcafcb 100644 --- a/packages/trie-db/src/snapshot.spec.ts +++ b/packages/trie-db/src/snapshot.spec.ts @@ -2,10 +2,10 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { trieRoot } from '@polkadot/trie-hash/index'; -import { u8aToHex, u8aToU8a as toU8a } from '@polkadot/util/index'; +import { trieRoot } from '@polkadot/trie-hash'; +import { u8aToHex, u8aToU8a as toU8a } from '@polkadot/util'; -import Trie from './index'; +import Trie from '.'; describe('snapshots', () => { let trie: Trie; diff --git a/packages/trie-db/src/subtrate.spec.ts b/packages/trie-db/src/subtrate.spec.ts index 1cc4be79a..1d1f39af8 100644 --- a/packages/trie-db/src/subtrate.spec.ts +++ b/packages/trie-db/src/subtrate.spec.ts @@ -2,10 +2,10 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aToHex } from '@polkadot/util/index'; +import { u8aToHex } from '@polkadot/util'; import testdata, { TestData } from '../../trie-hash/test/data'; -import Trie from './index'; +import Trie from '.'; describe('substrate tests', () => { let trie: Trie; diff --git a/packages/trie-db/src/util/is.ts b/packages/trie-db/src/util/is.ts index 2fcfc5f0a..f0705910d 100644 --- a/packages/trie-db/src/util/is.ts +++ b/packages/trie-db/src/util/is.ts @@ -4,7 +4,7 @@ import { Node, NodeBranch, NodeKv, NodeEmpty, NodeType } from '../types'; -import { isNull } from '@polkadot/util/index'; +import { isNull } from '@polkadot/util'; import { getNodeType } from './node'; diff --git a/packages/trie-db/src/util/key.ts b/packages/trie-db/src/util/key.ts index 134ebb62a..ff30a79a2 100644 --- a/packages/trie-db/src/util/key.ts +++ b/packages/trie-db/src/util/key.ts @@ -3,7 +3,7 @@ // of the Apache-2.0 license. See the LICENSE file for details. import { addNibblesTerminator, encodeNibbles } from '@polkadot/trie-codec/nibbles'; -import { isNull } from '@polkadot/util/index'; +import { isNull } from '@polkadot/util'; import { EncodedPath } from '../types'; diff --git a/packages/trie-db/src/util/node.ts b/packages/trie-db/src/util/node.ts index 847d46ca2..1a81dbbd6 100644 --- a/packages/trie-db/src/util/node.ts +++ b/packages/trie-db/src/util/node.ts @@ -6,7 +6,7 @@ import { Codec } from '@polkadot/trie-codec/types'; import { Node, NodeType, NodeNotEmpty } from '../types'; import { decodeNibbles, isNibblesTerminated } from '@polkadot/trie-codec/nibbles'; -import { isNull } from '@polkadot/util/index'; +import { isNull } from '@polkadot/util'; import { isBranchNode, isEmptyNode, isKvNode } from './is'; diff --git a/packages/trie-hash/src/buildTrie.ts b/packages/trie-hash/src/buildTrie.ts index 269903b0c..2cc14d392 100644 --- a/packages/trie-hash/src/buildTrie.ts +++ b/packages/trie-hash/src/buildTrie.ts @@ -5,7 +5,7 @@ import { Codec } from '@polkadot/trie-codec/types'; import { sharedPrefixLength } from '@polkadot/trie-codec/util'; -import { u8aConcat } from '@polkadot/util/index'; +import { u8aConcat } from '@polkadot/util'; import { DEFAULT_CODEC, DEFAULT_STREAM } from './defaults'; diff --git a/packages/trie-hash/src/defaults.ts b/packages/trie-hash/src/defaults.ts index 22a72eb9f..cef4f14f5 100644 --- a/packages/trie-hash/src/defaults.ts +++ b/packages/trie-hash/src/defaults.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import DEFAULT_CODEC, { stream as DEFAULT_STREAM } from '@polkadot/trie-codec/index'; +import DEFAULT_CODEC, { stream as DEFAULT_STREAM } from '@polkadot/trie-codec'; export { DEFAULT_CODEC, diff --git a/packages/trie-hash/src/genesis.spec.ts b/packages/trie-hash/src/genesis.spec.ts index fcf00b209..6cd97b7f0 100644 --- a/packages/trie-hash/src/genesis.spec.ts +++ b/packages/trie-hash/src/genesis.spec.ts @@ -2,8 +2,8 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { alexander, driedDanta } from '@polkadot/chainspec/index'; -import { hexToU8a, u8aToHex } from '@polkadot/util/index'; +import { alexander, driedDanta } from '@polkadot/chainspec'; +import { hexToU8a, u8aToHex } from '@polkadot/util'; import trieRoot from './trieRoot'; diff --git a/packages/trie-hash/src/trieRoot.spec.ts b/packages/trie-hash/src/trieRoot.spec.ts index c920fd10b..5de8ed992 100644 --- a/packages/trie-hash/src/trieRoot.spec.ts +++ b/packages/trie-hash/src/trieRoot.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aToHex } from '@polkadot/util/index'; +import { u8aToHex } from '@polkadot/util'; import trieRoot from './trieRoot'; import testdata from '../test/data'; diff --git a/packages/trie-hash/src/trieRootOrdered.spec.ts b/packages/trie-hash/src/trieRootOrdered.spec.ts index 99992b250..35abec5b9 100644 --- a/packages/trie-hash/src/trieRootOrdered.spec.ts +++ b/packages/trie-hash/src/trieRootOrdered.spec.ts @@ -2,9 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { stringToU8a, u8aToHex } from '@polkadot/util/index'; +import { stringToU8a, u8aToHex } from '@polkadot/util'; -import { trieRootOrdered } from './index'; +import { trieRootOrdered } from '.'; describe('trieRootOrdered', () => { it('encodes values', () => { diff --git a/packages/trie-hash/src/trieRootOrdered.ts b/packages/trie-hash/src/trieRootOrdered.ts index c8be27ef8..284d1ac13 100644 --- a/packages/trie-hash/src/trieRootOrdered.ts +++ b/packages/trie-hash/src/trieRootOrdered.ts @@ -4,7 +4,7 @@ import { Codec } from '@polkadot/trie-codec/types'; -import { compactToU8a } from '@polkadot/util/index'; +import { compactToU8a } from '@polkadot/util'; import { DEFAULT_CODEC } from './defaults'; import trieRoot from './trieRoot'; diff --git a/packages/trie-hash/src/unhashedTrie.spec.ts b/packages/trie-hash/src/unhashedTrie.spec.ts index 9d09dc4ea..bce39b6c1 100644 --- a/packages/trie-hash/src/unhashedTrie.spec.ts +++ b/packages/trie-hash/src/unhashedTrie.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aToHex } from '@polkadot/util/index'; +import { u8aToHex } from '@polkadot/util'; import unhashedTrie from './unhashedTrie'; import testdata from '../test/data'; diff --git a/packages/trie-hash/src/unhashedTrie.ts b/packages/trie-hash/src/unhashedTrie.ts index 617a263e2..0c663b90b 100644 --- a/packages/trie-hash/src/unhashedTrie.ts +++ b/packages/trie-hash/src/unhashedTrie.ts @@ -6,7 +6,7 @@ import { Codec } from '@polkadot/trie-codec/types'; import { TriePair } from './types'; import { toNibbles } from '@polkadot/trie-codec/util'; -import { u8aToHex } from '@polkadot/util/index'; +import { u8aToHex } from '@polkadot/util'; import buildTrie from './buildTrie'; import { DEFAULT_CODEC } from './defaults'; diff --git a/packages/trie-hash/test/data.ts b/packages/trie-hash/test/data.ts index 4ae78e694..c5ddfe94b 100644 --- a/packages/trie-hash/test/data.ts +++ b/packages/trie-hash/test/data.ts @@ -4,7 +4,7 @@ import { TriePair } from '../src/types'; -import { hexToU8a, stringToU8a } from '@polkadot/util/index'; +import { hexToU8a, stringToU8a } from '@polkadot/util'; export type TestData = { desc: string, diff --git a/packages/util-crypto/src/blake2/asHex.spec.ts b/packages/util-crypto/src/blake2/asHex.spec.ts index 10600e43f..bd0888f39 100644 --- a/packages/util-crypto/src/blake2/asHex.spec.ts +++ b/packages/util-crypto/src/blake2/asHex.spec.ts @@ -4,7 +4,7 @@ import hexToU8a from '@polkadot/util/hex/toU8a'; -import { blake2AsHex } from './index'; +import { blake2AsHex } from '.'; describe('blake2AsHex', () => { it('returns a 64-bit value (specified)', () => { diff --git a/packages/util-crypto/src/blake2/asU8a.spec.ts b/packages/util-crypto/src/blake2/asU8a.spec.ts index 0227a847c..9fa99660f 100644 --- a/packages/util-crypto/src/blake2/asU8a.spec.ts +++ b/packages/util-crypto/src/blake2/asU8a.spec.ts @@ -4,7 +4,7 @@ import hexToU8a from '@polkadot/util/hex/toU8a'; -import { blake2AsU8a } from './index'; +import { blake2AsU8a } from '.'; describe('blake2AsU8a', () => { it('returns a 64-bit value by default', () => { diff --git a/packages/util-crypto/src/blake2/blake2b/asHex.spec.ts b/packages/util-crypto/src/blake2/blake2b/asHex.spec.ts index 0271fab64..51e97f697 100644 --- a/packages/util-crypto/src/blake2/blake2b/asHex.spec.ts +++ b/packages/util-crypto/src/blake2/blake2b/asHex.spec.ts @@ -4,7 +4,7 @@ import hexToU8a from '@polkadot/util/hex/toU8a'; -import { blake2bAsHex } from './index'; +import { blake2bAsHex } from '.'; describe('blake2bAsHex', () => { it('creates the correct hash', () => { diff --git a/packages/util-crypto/src/blake2/blake2b/asHex.ts b/packages/util-crypto/src/blake2/blake2b/asHex.ts index 72be7a790..0e3524a7b 100644 --- a/packages/util-crypto/src/blake2/blake2b/asHex.ts +++ b/packages/util-crypto/src/blake2/blake2b/asHex.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aToHex } from '@polkadot/util/index'; +import { u8aToHex } from '@polkadot/util'; import blake2bAsU8a from './asU8a'; diff --git a/packages/util-crypto/src/blake2/blake2b/asU8a.spec.ts b/packages/util-crypto/src/blake2/blake2b/asU8a.spec.ts index 7f043f58f..fb576d309 100644 --- a/packages/util-crypto/src/blake2/blake2b/asU8a.spec.ts +++ b/packages/util-crypto/src/blake2/blake2b/asU8a.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { blake2bAsU8a } from './index'; +import { blake2bAsU8a } from '.'; describe('blake2bAsU8a', () => { it('creates the correct hash (default length)', () => { diff --git a/packages/util-crypto/src/keccak/asHex.spec.ts b/packages/util-crypto/src/keccak/asHex.spec.ts index a38efea5a..f20d09aa2 100644 --- a/packages/util-crypto/src/keccak/asHex.spec.ts +++ b/packages/util-crypto/src/keccak/asHex.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { keccakAsHex } from './index'; +import { keccakAsHex } from '.'; const value = 'test value'; const result = '2d07364b5c231c56ce63d49430e085ea3033c750688ba532b24029124c26ca5e'; diff --git a/packages/util-crypto/src/keccak/asHex.ts b/packages/util-crypto/src/keccak/asHex.ts index 3bbb3e2a4..61e4038a8 100644 --- a/packages/util-crypto/src/keccak/asHex.ts +++ b/packages/util-crypto/src/keccak/asHex.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aToHex } from '@polkadot/util/index'; +import { u8aToHex } from '@polkadot/util'; import keccakAsU8a from './asU8a'; diff --git a/packages/util-crypto/src/keccak/asU8a.spec.ts b/packages/util-crypto/src/keccak/asU8a.spec.ts index 06e6a2160..7bf3421b4 100644 --- a/packages/util-crypto/src/keccak/asU8a.spec.ts +++ b/packages/util-crypto/src/keccak/asU8a.spec.ts @@ -2,9 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { hexToU8a, stringToU8a } from '@polkadot/util/index'; +import { hexToU8a, stringToU8a } from '@polkadot/util'; -import { keccakAsU8a } from './index'; +import { keccakAsU8a } from '.'; describe('keccakAsU8a', () => { const input = 'test value'; diff --git a/packages/util-crypto/src/key/DeriveJunction.ts b/packages/util-crypto/src/key/DeriveJunction.ts index ed8254c8f..15941699b 100644 --- a/packages/util-crypto/src/key/DeriveJunction.ts +++ b/packages/util-crypto/src/key/DeriveJunction.ts @@ -3,7 +3,7 @@ // of the Apache-2.0 license. See the LICENSE file for details. import BN from 'bn.js'; -import { bnToHex, compactAddLength, hexToU8a, isBn, isHex, isNumber, isString, stringToU8a } from '@polkadot/util/index'; +import { bnToHex, compactAddLength, hexToU8a, isBn, isHex, isNumber, isString, stringToU8a } from '@polkadot/util'; import blake2AsU8a from '../blake2/asU8a'; diff --git a/packages/util-crypto/src/key/extract.ts b/packages/util-crypto/src/key/extract.ts index b6997fbec..cd6f41f0c 100644 --- a/packages/util-crypto/src/key/extract.ts +++ b/packages/util-crypto/src/key/extract.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { assert, isNull } from '@polkadot/util/index'; +import { assert, isNull } from '@polkadot/util'; import DeriveJunction from './DeriveJunction'; diff --git a/packages/util-crypto/src/key/hdkdEd25519.ts b/packages/util-crypto/src/key/hdkdEd25519.ts index d298268d6..d0e898210 100644 --- a/packages/util-crypto/src/key/hdkdEd25519.ts +++ b/packages/util-crypto/src/key/hdkdEd25519.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { assert, compactAddLength, stringToU8a, u8aConcat } from '@polkadot/util/index'; +import { assert, compactAddLength, stringToU8a, u8aConcat } from '@polkadot/util'; import blake2AsU8a from '../blake2/asU8a'; import DeriveJunction from './DeriveJunction'; diff --git a/packages/util-crypto/src/key/hdkdSr25519.ts b/packages/util-crypto/src/key/hdkdSr25519.ts index 583812e6c..076e53833 100644 --- a/packages/util-crypto/src/key/hdkdSr25519.ts +++ b/packages/util-crypto/src/key/hdkdSr25519.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { stringToU8a, u8aConcat } from '@polkadot/util/index'; +import { stringToU8a, u8aConcat } from '@polkadot/util'; import blake2AsU8a from '../blake2/asU8a'; import DeriveJunction from './DeriveJunction'; diff --git a/packages/util-crypto/src/mnemonic/toEntropy.spec.ts b/packages/util-crypto/src/mnemonic/toEntropy.spec.ts index 15b173bd1..59132f8e1 100644 --- a/packages/util-crypto/src/mnemonic/toEntropy.spec.ts +++ b/packages/util-crypto/src/mnemonic/toEntropy.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aToHex } from '@polkadot/util/index'; +import { u8aToHex } from '@polkadot/util'; import toEntropy from './toEntropy'; import tests from '../schnorrkel/keypair/testing'; diff --git a/packages/util-crypto/src/mnemonic/toEntropy.ts b/packages/util-crypto/src/mnemonic/toEntropy.ts index a3bcf4752..aae7e7110 100644 --- a/packages/util-crypto/src/mnemonic/toEntropy.ts +++ b/packages/util-crypto/src/mnemonic/toEntropy.ts @@ -3,7 +3,7 @@ // of the Apache-2.0 license. See the LICENSE file for details. import { mnemonicToEntropy } from 'bip39'; -import { hexAddPrefix, hexToU8a } from '@polkadot/util/index'; +import { hexAddPrefix, hexToU8a } from '@polkadot/util'; export default function toEntropy (mnemonic: string): Uint8Array { return hexToU8a( diff --git a/packages/util-crypto/src/mnemonic/toMiniSecret.spec.ts b/packages/util-crypto/src/mnemonic/toMiniSecret.spec.ts index f977b3cbc..53fc36f67 100644 --- a/packages/util-crypto/src/mnemonic/toMiniSecret.spec.ts +++ b/packages/util-crypto/src/mnemonic/toMiniSecret.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aToHex } from '@polkadot/util/index'; +import { u8aToHex } from '@polkadot/util'; import mnemonicToMiniSecret from './toMiniSecret'; import tests from '../schnorrkel/keypair/testing'; diff --git a/packages/util-crypto/src/mnemonic/toMiniSecret.ts b/packages/util-crypto/src/mnemonic/toMiniSecret.ts index 376fe32d9..eacf19776 100644 --- a/packages/util-crypto/src/mnemonic/toMiniSecret.ts +++ b/packages/util-crypto/src/mnemonic/toMiniSecret.ts @@ -3,7 +3,7 @@ // of the Apache-2.0 license. See the LICENSE file for details. import { pbkdf2Sync } from 'pbkdf2'; -import { bufferToU8a, stringToU8a, u8aToBuffer } from '@polkadot/util/index'; +import { bufferToU8a, stringToU8a, u8aToBuffer } from '@polkadot/util'; import toEntropy from './toEntropy'; diff --git a/packages/util-crypto/src/mnemonic/toSecret.ts b/packages/util-crypto/src/mnemonic/toSecret.ts index 6566b4515..f6499974b 100644 --- a/packages/util-crypto/src/mnemonic/toSecret.ts +++ b/packages/util-crypto/src/mnemonic/toSecret.ts @@ -3,7 +3,7 @@ // of the Apache-2.0 license. See the LICENSE file for details. import { mnemonicToSeed } from 'bip39'; -import { bufferToU8a } from '@polkadot/util/index'; +import { bufferToU8a } from '@polkadot/util'; export default function toSecret (mnemonic: string): Uint8Array { return bufferToU8a( diff --git a/packages/util-crypto/src/nacl/decrypt.spec.ts b/packages/util-crypto/src/nacl/decrypt.spec.ts index f17b32551..9289babcf 100644 --- a/packages/util-crypto/src/nacl/decrypt.spec.ts +++ b/packages/util-crypto/src/nacl/decrypt.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { naclDecrypt, naclEncrypt } from './index'; +import { naclDecrypt, naclEncrypt } from '.'; describe('naclDecrypt', () => { it('decrypts a encrypted message', () => { diff --git a/packages/util-crypto/src/nacl/encrypt.spec.ts b/packages/util-crypto/src/nacl/encrypt.spec.ts index eaf323ded..2a4b4715f 100644 --- a/packages/util-crypto/src/nacl/encrypt.spec.ts +++ b/packages/util-crypto/src/nacl/encrypt.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { naclEncrypt } from './index'; +import { naclEncrypt } from '.'; describe('naclEncrypt', () => { it('encrypts a message', () => { diff --git a/packages/util-crypto/src/nacl/keypair/fromRandom.spec.ts b/packages/util-crypto/src/nacl/keypair/fromRandom.spec.ts index f95676b66..ee020d6b3 100644 --- a/packages/util-crypto/src/nacl/keypair/fromRandom.spec.ts +++ b/packages/util-crypto/src/nacl/keypair/fromRandom.spec.ts @@ -4,7 +4,7 @@ import { Keypair } from '../../types'; -import { naclKeypairFromRandom } from '../index'; +import { naclKeypairFromRandom } from '..'; describe('naclKeypairFromRandom', () => { let keypair: Keypair; diff --git a/packages/util-crypto/src/nacl/keypair/fromSecret.spec.ts b/packages/util-crypto/src/nacl/keypair/fromSecret.spec.ts index d733fbff1..d2f280fc0 100644 --- a/packages/util-crypto/src/nacl/keypair/fromSecret.spec.ts +++ b/packages/util-crypto/src/nacl/keypair/fromSecret.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { naclKeypairFromSecret } from '../index'; +import { naclKeypairFromSecret } from '..'; describe('naclKeypairFromSecret', () => { const secretKey = new Uint8Array([ diff --git a/packages/util-crypto/src/nacl/keypair/fromSeed.spec.ts b/packages/util-crypto/src/nacl/keypair/fromSeed.spec.ts index 4fc778372..fd8c30813 100644 --- a/packages/util-crypto/src/nacl/keypair/fromSeed.spec.ts +++ b/packages/util-crypto/src/nacl/keypair/fromSeed.spec.ts @@ -2,9 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { stringToU8a } from '@polkadot/util/index'; +import { stringToU8a } from '@polkadot/util'; -import { naclKeypairFromSeed } from '../index'; +import { naclKeypairFromSeed } from '..'; describe('naclKeypairFromSeed', () => { // NOTE: Aligned with Rust test, b"12345678901234567890123456789012" diff --git a/packages/util-crypto/src/nacl/keypair/fromString.spec.ts b/packages/util-crypto/src/nacl/keypair/fromString.spec.ts index 330dbe3b2..a1a2c3e0b 100644 --- a/packages/util-crypto/src/nacl/keypair/fromString.spec.ts +++ b/packages/util-crypto/src/nacl/keypair/fromString.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { naclKeypairFromString } from '../index'; +import { naclKeypairFromString } from '..'; describe('naclKeypairFromSeed', () => { it('generates a valid publicKey/secretKey pair', () => { diff --git a/packages/util-crypto/src/nacl/keypair/fromString.ts b/packages/util-crypto/src/nacl/keypair/fromString.ts index 108ddd3ca..f634eec87 100644 --- a/packages/util-crypto/src/nacl/keypair/fromString.ts +++ b/packages/util-crypto/src/nacl/keypair/fromString.ts @@ -4,7 +4,7 @@ import { Keypair } from '../../types'; -import { stringToU8a } from '@polkadot/util/index'; +import { stringToU8a } from '@polkadot/util'; import blake2AsU8a from '../../blake2/asU8a'; import fromSeed from './fromSeed'; diff --git a/packages/util-crypto/src/nacl/sign.spec.ts b/packages/util-crypto/src/nacl/sign.spec.ts index 38fc59fbd..dbb450e58 100644 --- a/packages/util-crypto/src/nacl/sign.spec.ts +++ b/packages/util-crypto/src/nacl/sign.spec.ts @@ -2,9 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { stringToU8a } from '@polkadot/util/index'; +import { stringToU8a } from '@polkadot/util'; -import { naclSign, naclKeypairFromSeed } from './index'; +import { naclSign, naclKeypairFromSeed } from '.'; describe('naclSign', () => { let secretKey: Uint8Array; diff --git a/packages/util-crypto/src/nacl/sign.ts b/packages/util-crypto/src/nacl/sign.ts index ef5e82c24..60329d780 100644 --- a/packages/util-crypto/src/nacl/sign.ts +++ b/packages/util-crypto/src/nacl/sign.ts @@ -5,7 +5,7 @@ import { Keypair } from '../types'; import nacl from 'tweetnacl'; -import { assert } from '@polkadot/util/index'; +import { assert } from '@polkadot/util'; /** * @name naclSign diff --git a/packages/util-crypto/src/nacl/verify.spec.ts b/packages/util-crypto/src/nacl/verify.spec.ts index 7ab030de9..6a4246949 100644 --- a/packages/util-crypto/src/nacl/verify.spec.ts +++ b/packages/util-crypto/src/nacl/verify.spec.ts @@ -2,9 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { stringToU8a } from '@polkadot/util/index'; +import { stringToU8a } from '@polkadot/util'; -import { naclVerify, naclKeypairFromSeed } from './index'; +import { naclVerify, naclKeypairFromSeed } from '.'; describe('naclSign', () => { let publicKey: Uint8Array; diff --git a/packages/util-crypto/src/random/asHex.spec.ts b/packages/util-crypto/src/random/asHex.spec.ts index e7f84ab01..a3ea20523 100644 --- a/packages/util-crypto/src/random/asHex.spec.ts +++ b/packages/util-crypto/src/random/asHex.spec.ts @@ -2,9 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isHex } from '@polkadot/util/index'; +import { isHex } from '@polkadot/util'; -import { randomAsHex } from './index'; +import { randomAsHex } from '.'; describe('randomAsBuffer', () => { it('generated results does not match', () => { diff --git a/packages/util-crypto/src/random/asHex.ts b/packages/util-crypto/src/random/asHex.ts index 3581f8801..5be472227 100644 --- a/packages/util-crypto/src/random/asHex.ts +++ b/packages/util-crypto/src/random/asHex.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aToHex } from '@polkadot/util/index'; +import { u8aToHex } from '@polkadot/util'; import randomAsU8a from './asU8a'; diff --git a/packages/util-crypto/src/random/asNumber.spec.ts b/packages/util-crypto/src/random/asNumber.spec.ts index 0736003a0..0ceb26d2b 100644 --- a/packages/util-crypto/src/random/asNumber.spec.ts +++ b/packages/util-crypto/src/random/asNumber.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { randomAsNumber } from './index'; +import { randomAsNumber } from '.'; describe('randomAsNumber', () => { it('generates subsequent non-matching numbers', () => { diff --git a/packages/util-crypto/src/random/asNumber.ts b/packages/util-crypto/src/random/asNumber.ts index 01f77f54a..cc69b9489 100644 --- a/packages/util-crypto/src/random/asNumber.ts +++ b/packages/util-crypto/src/random/asNumber.ts @@ -3,7 +3,7 @@ // of the Apache-2.0 license. See the LICENSE file for details. import BN from 'bn.js'; -import { hexToBn } from '@polkadot/util/index'; +import { hexToBn } from '@polkadot/util'; import randomAsHex from './asHex'; diff --git a/packages/util-crypto/src/random/asU8a.spec.ts b/packages/util-crypto/src/random/asU8a.spec.ts index d2257601d..746dfd929 100644 --- a/packages/util-crypto/src/random/asU8a.spec.ts +++ b/packages/util-crypto/src/random/asU8a.spec.ts @@ -2,9 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isU8a } from '@polkadot/util/index'; +import { isU8a } from '@polkadot/util'; -import { randomAsU8a } from './index'; +import { randomAsU8a } from '.'; describe('randomAsU8a', () => { it('generates a Uint8Array', () => { diff --git a/packages/util-crypto/src/schnorrkel/keypair/fromSeed.spec.ts b/packages/util-crypto/src/schnorrkel/keypair/fromSeed.spec.ts index 3ccf1c6ac..9823c7635 100644 --- a/packages/util-crypto/src/schnorrkel/keypair/fromSeed.spec.ts +++ b/packages/util-crypto/src/schnorrkel/keypair/fromSeed.spec.ts @@ -4,10 +4,10 @@ import '../test-polyfill'; -import { stringToU8a, u8aToHex } from '@polkadot/util/index'; +import { stringToU8a, u8aToHex } from '@polkadot/util'; import { mnemonicToMiniSecret } from '../../mnemonic'; -import { schnorrkelKeypairFromSeed, schnorrkelWaitReady } from '../index'; +import { schnorrkelKeypairFromSeed, schnorrkelWaitReady } from '..'; import tests from './testing'; describe('schnorrkelKeypairFromSeed', () => { diff --git a/packages/util-crypto/src/schnorrkel/sign.ts b/packages/util-crypto/src/schnorrkel/sign.ts index ae69fb217..894d8c821 100644 --- a/packages/util-crypto/src/schnorrkel/sign.ts +++ b/packages/util-crypto/src/schnorrkel/sign.ts @@ -4,7 +4,7 @@ import { Keypair } from '../types'; -import { assert } from '@polkadot/util/index'; +import { assert } from '@polkadot/util'; import schnorrkel from '@polkadot/schnorrkel-js'; diff --git a/packages/util-crypto/src/schnorrkel/signVerify.spec.ts b/packages/util-crypto/src/schnorrkel/signVerify.spec.ts index 37a0855c7..4c30f8abb 100644 --- a/packages/util-crypto/src/schnorrkel/signVerify.spec.ts +++ b/packages/util-crypto/src/schnorrkel/signVerify.spec.ts @@ -4,7 +4,7 @@ import './test-polyfill'; -import { stringToU8a } from '@polkadot/util/index'; +import { stringToU8a } from '@polkadot/util'; import randomAsU8a from '../random/asU8a'; import pairFromSeed from './keypair/fromSeed'; diff --git a/packages/util-crypto/src/secp256k1/recover.ts b/packages/util-crypto/src/secp256k1/recover.ts index d66778508..507792f7d 100644 --- a/packages/util-crypto/src/secp256k1/recover.ts +++ b/packages/util-crypto/src/secp256k1/recover.ts @@ -3,7 +3,7 @@ // of the Apache-2.0 license. See the LICENSE file for details. import secp256k1 from 'secp256k1'; -import { bufferToU8a, u8aToBuffer } from '@polkadot/util/index'; +import { bufferToU8a, u8aToBuffer } from '@polkadot/util'; /** * @name secp256k1Recover diff --git a/packages/util-crypto/src/sha512/asU8a.spec.ts b/packages/util-crypto/src/sha512/asU8a.spec.ts index b3ced6d51..6c990f1ba 100644 --- a/packages/util-crypto/src/sha512/asU8a.spec.ts +++ b/packages/util-crypto/src/sha512/asU8a.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { sha512AsU8a } from './index'; +import { sha512AsU8a } from '.'; describe('sha512AsU8a', () => { it('creates a sha-512 hash', () => { diff --git a/packages/util-crypto/src/xxhash/asHex.spec.ts b/packages/util-crypto/src/xxhash/asHex.spec.ts index 367d64e76..73bb00f53 100644 --- a/packages/util-crypto/src/xxhash/asHex.spec.ts +++ b/packages/util-crypto/src/xxhash/asHex.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { xxhashAsHex } from './index'; +import { xxhashAsHex } from '.'; describe('xxhashAsHex', () => { it('returns a 64-bit value by default', () => { diff --git a/packages/util-crypto/src/xxhash/asHex.ts b/packages/util-crypto/src/xxhash/asHex.ts index f32a0314a..2765431ae 100644 --- a/packages/util-crypto/src/xxhash/asHex.ts +++ b/packages/util-crypto/src/xxhash/asHex.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aToHex } from '@polkadot/util/index'; +import { u8aToHex } from '@polkadot/util'; import xxhashAsU8a from './asU8a'; diff --git a/packages/util-crypto/src/xxhash/asU8a.spec.ts b/packages/util-crypto/src/xxhash/asU8a.spec.ts index 7a6c07773..6b87c02f2 100644 --- a/packages/util-crypto/src/xxhash/asU8a.spec.ts +++ b/packages/util-crypto/src/xxhash/asU8a.spec.ts @@ -2,9 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { hexToU8a } from '@polkadot/util/index'; +import { hexToU8a } from '@polkadot/util'; -import { xxhashAsU8a } from './index'; +import { xxhashAsU8a } from '.'; describe('xxhashAsU8a', () => { it('returns a 64-bit value by default', () => { diff --git a/packages/util-crypto/src/xxhash/xxhash64/asBn.spec.ts b/packages/util-crypto/src/xxhash/xxhash64/asBn.spec.ts index 670942248..9d803e4f9 100644 --- a/packages/util-crypto/src/xxhash/xxhash64/asBn.spec.ts +++ b/packages/util-crypto/src/xxhash/xxhash64/asBn.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { xxhash64AsBn } from './index'; +import { xxhash64AsBn } from '.'; describe('xxhash64AsBn', () => { it('creates the correct BN output', () => { diff --git a/packages/util-crypto/src/xxhash/xxhash64/asHex.spec.ts b/packages/util-crypto/src/xxhash/xxhash64/asHex.spec.ts index 65762e370..6d9d941f2 100644 --- a/packages/util-crypto/src/xxhash/xxhash64/asHex.spec.ts +++ b/packages/util-crypto/src/xxhash/xxhash64/asHex.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { xxhash64AsHex } from './index'; +import { xxhash64AsHex } from '.'; describe('xxhash64AsHex', () => { it('creates the correct hex output', () => { diff --git a/packages/util-crypto/src/xxhash/xxhash64/asHex.ts b/packages/util-crypto/src/xxhash/xxhash64/asHex.ts index 614ac62ae..409c56ef9 100644 --- a/packages/util-crypto/src/xxhash/xxhash64/asHex.ts +++ b/packages/util-crypto/src/xxhash/xxhash64/asHex.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { hexAddPrefix } from '@polkadot/util/index'; +import { hexAddPrefix } from '@polkadot/util'; import xxhash64AsRaw from './asRaw'; diff --git a/packages/util-crypto/src/xxhash/xxhash64/asRaw.spec.ts b/packages/util-crypto/src/xxhash/xxhash64/asRaw.spec.ts index 1937e1a42..94f8d9b22 100644 --- a/packages/util-crypto/src/xxhash/xxhash64/asRaw.spec.ts +++ b/packages/util-crypto/src/xxhash/xxhash64/asRaw.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { xxhash64AsRaw } from './index'; +import { xxhash64AsRaw } from '.'; describe('xxhash64AsRaw', () => { it('creates the correct non-prefixed hex output', () => { diff --git a/packages/util-crypto/src/xxhash/xxhash64/asValue.ts b/packages/util-crypto/src/xxhash/xxhash64/asValue.ts index e799a7fd5..38fc3dd12 100644 --- a/packages/util-crypto/src/xxhash/xxhash64/asValue.ts +++ b/packages/util-crypto/src/xxhash/xxhash64/asValue.ts @@ -3,7 +3,7 @@ // of the Apache-2.0 license. See the LICENSE file for details. import xxhashjs from 'xxhashjs'; -import { isBuffer, isString, u8aToBuffer } from '@polkadot/util/index'; +import { isBuffer, isString, u8aToBuffer } from '@polkadot/util'; /** * @name xxhash64AsValue diff --git a/packages/util-rlp/README.md b/packages/util-rlp/README.md index 054df937b..ba3e69331 100644 --- a/packages/util-rlp/README.md +++ b/packages/util-rlp/README.md @@ -1,6 +1,6 @@ # @polkadot/util-rlp -Utility methods for encoding and decoding [Ethereum RLP structures](https://github.com/ethereum/wiki/wiki/%5BEnglish%5D-RLP). This is port adapted from the original [EthereumJS RLP](https://github.com/ethereumjs/rlp/blob/0ce09db81fc303fcee593f7cc094ba44015f9b92/index.js) implementation to cater for `Uint8Array` outputs (instead of `Buffer`) in addition to typings. +Utility methods for encoding and decoding [Ethereum RLP structures](https://github.com/ethereum/wiki/wiki/%5BEnglish%5D-RLP). This is port adapted from the original [EthereumJS RLP](https://github.com/ethereumjs/rlp/blob/0ce09db81fc303fcee593f7cc094ba44015f9b92.js) implementation to cater for `Uint8Array` outputs (instead of `Buffer`) in addition to typings. ## Usage diff --git a/packages/util-rlp/src/decode.spec.ts b/packages/util-rlp/src/decode.spec.ts index 22d766230..29164ece9 100644 --- a/packages/util-rlp/src/decode.spec.ts +++ b/packages/util-rlp/src/decode.spec.ts @@ -2,9 +2,9 @@ // This software may be modified and distributed under the terms // of the MPL-2.0 license. See the LICENSE file for details. -import { hexToU8a, u8aToHex } from '@polkadot/util/index'; +import { hexToU8a, u8aToHex } from '@polkadot/util'; -import { decode, encode } from './index'; +import { decode, encode } from '.'; import getTests from '../test/getTests'; diff --git a/packages/util-rlp/src/decoder/decode.ts b/packages/util-rlp/src/decoder/decode.ts index be791c1a4..43ec715a2 100644 --- a/packages/util-rlp/src/decoder/decode.ts +++ b/packages/util-rlp/src/decoder/decode.ts @@ -4,7 +4,7 @@ import { DecodeFunc, DecodeOutput } from './types'; -import { assert } from '@polkadot/util/index'; +import { assert } from '@polkadot/util'; import decodeListLong from './listLong'; import decodeListShort from './listShort'; diff --git a/packages/util-rlp/src/decoder/index.ts b/packages/util-rlp/src/decoder/index.ts index 3a50bb277..1913274ae 100644 --- a/packages/util-rlp/src/decoder/index.ts +++ b/packages/util-rlp/src/decoder/index.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the MPL-2.0 license. See the LICENSE file for details. -import { assert, u8aToHex } from '@polkadot/util/index'; +import { assert, u8aToHex } from '@polkadot/util'; import internalDecode from './decode'; diff --git a/packages/util-rlp/src/decoder/listLong.ts b/packages/util-rlp/src/decoder/listLong.ts index 6194f7491..46ccfce57 100644 --- a/packages/util-rlp/src/decoder/listLong.ts +++ b/packages/util-rlp/src/decoder/listLong.ts @@ -4,7 +4,7 @@ import { DecodeFunc, DecodeOutput } from './types'; -import { assert } from '@polkadot/util/index'; +import { assert } from '@polkadot/util'; import safeParseInt from './safeParseInt'; diff --git a/packages/util-rlp/src/decoder/number.ts b/packages/util-rlp/src/decoder/number.ts index 381fac3b4..5d387e659 100644 --- a/packages/util-rlp/src/decoder/number.ts +++ b/packages/util-rlp/src/decoder/number.ts @@ -4,7 +4,7 @@ import { DecodeFunc, DecodeOutput } from './types'; -import { assert } from '@polkadot/util/index'; +import { assert } from '@polkadot/util'; import safeParseInt from './safeParseInt'; diff --git a/packages/util-rlp/src/decoder/safeParseInt.ts b/packages/util-rlp/src/decoder/safeParseInt.ts index 8a079ba1a..80356c841 100644 --- a/packages/util-rlp/src/decoder/safeParseInt.ts +++ b/packages/util-rlp/src/decoder/safeParseInt.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the MPL-2.0 license. See the LICENSE file for details. -import { assert } from '@polkadot/util/index'; +import { assert } from '@polkadot/util'; export default function safeParseInt (input: Uint8Array): number { assert(input[0] > 0, 'invalid rlp, extra zeros found'); diff --git a/packages/util-rlp/src/decoder/string.ts b/packages/util-rlp/src/decoder/string.ts index 9fafb9283..d6a8aace4 100644 --- a/packages/util-rlp/src/decoder/string.ts +++ b/packages/util-rlp/src/decoder/string.ts @@ -4,7 +4,7 @@ import { DecodeFunc, DecodeOutput } from './types'; -import { assert } from '@polkadot/util/index'; +import { assert } from '@polkadot/util'; export default function decodeString (decode: DecodeFunc, input: Uint8Array): DecodeOutput { const firstByte = input[0]; diff --git a/packages/util-rlp/src/encode.spec.ts b/packages/util-rlp/src/encode.spec.ts index 383344386..6c1ec0a65 100644 --- a/packages/util-rlp/src/encode.spec.ts +++ b/packages/util-rlp/src/encode.spec.ts @@ -2,9 +2,9 @@ // This software may be modified and distributed under the terms // of the MPL-2.0 license. See the LICENSE file for details. -import { u8aToHex } from '@polkadot/util/index'; +import { u8aToHex } from '@polkadot/util'; -import { encode } from './index'; +import { encode } from '.'; import getTests from '../test/getTests'; diff --git a/packages/util-rlp/src/encoder/array.ts b/packages/util-rlp/src/encoder/array.ts index 31b2ed6eb..f5cd6b196 100644 --- a/packages/util-rlp/src/encoder/array.ts +++ b/packages/util-rlp/src/encoder/array.ts @@ -4,7 +4,7 @@ import { EncodeFunc } from './types'; -import { u8aConcat } from '@polkadot/util/index'; +import { u8aConcat } from '@polkadot/util'; import encodeLength from './length'; diff --git a/packages/util-rlp/src/encoder/length.ts b/packages/util-rlp/src/encoder/length.ts index 3f97551e0..478a329cd 100644 --- a/packages/util-rlp/src/encoder/length.ts +++ b/packages/util-rlp/src/encoder/length.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the MPL-2.0 license. See the LICENSE file for details. -import { hexToU8a, numberToHex } from '@polkadot/util/index'; +import { hexToU8a, numberToHex } from '@polkadot/util'; export default function encodeLength (length: number, offset: number): Uint8Array { if (length < 56) { diff --git a/packages/util-rlp/src/encoder/toU8a.ts b/packages/util-rlp/src/encoder/toU8a.ts index 27bc0586a..2b6010b0d 100644 --- a/packages/util-rlp/src/encoder/toU8a.ts +++ b/packages/util-rlp/src/encoder/toU8a.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the MPL-2.0 license. See the LICENSE file for details. -import { assert, bnToU8a, bufferToU8a, hexHasPrefix, hexToU8a, isBn, isBuffer, isNull, isNumber, isString, isU8a, isUndefined, numberToU8a, stringToU8a } from '@polkadot/util/index'; +import { assert, bnToU8a, bufferToU8a, hexHasPrefix, hexToU8a, isBn, isBuffer, isNull, isNumber, isString, isU8a, isUndefined, numberToU8a, stringToU8a } from '@polkadot/util'; type Encoder = { check: (value: any) => boolean, diff --git a/packages/util-rlp/src/encoder/u8a.ts b/packages/util-rlp/src/encoder/u8a.ts index 2835d1b42..2bbee454e 100644 --- a/packages/util-rlp/src/encoder/u8a.ts +++ b/packages/util-rlp/src/encoder/u8a.ts @@ -4,7 +4,7 @@ import { EncodeFunc } from './types'; -import { u8aConcat } from '@polkadot/util/index'; +import { u8aConcat } from '@polkadot/util'; import encodeLength from './length'; diff --git a/packages/util-rlp/src/index.ts b/packages/util-rlp/src/index.ts index f4d58f75d..65e6e2056 100644 --- a/packages/util-rlp/src/index.ts +++ b/packages/util-rlp/src/index.ts @@ -3,7 +3,7 @@ // of the MPL-2.0 license. See the LICENSE file for details. /** - * @summary Utility methods to encode and decode [Ethereum RLP](https://github.com/ethereum/wiki/wiki/RLP). Adapted from the [EthereumJS implementation](https://github.com/ethereumjs/rlp/blob/0ce09db81fc303fcee593f7cc094ba44015f9b92/index.js) + * @summary Utility methods to encode and decode [Ethereum RLP](https://github.com/ethereum/wiki/wiki/RLP). Adapted from the [EthereumJS implementation](https://github.com/ethereumjs/rlp/blob/0ce09db81fc303fcee593f7cc094ba44015f9b92.js) */ export { default as decode } from './decode'; diff --git a/packages/util/src/array/filter.spec.ts b/packages/util/src/array/filter.spec.ts index 329bd3d18..77a236610 100644 --- a/packages/util/src/array/filter.spec.ts +++ b/packages/util/src/array/filter.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { arrayFilter } from './index'; +import { arrayFilter } from '.'; describe('filterArray', () => { it('filters arrays, removing undefined', () => { diff --git a/packages/util/src/assert.spec.ts b/packages/util/src/assert.spec.ts index 962264dcd..4fecd6724 100644 --- a/packages/util/src/assert.spec.ts +++ b/packages/util/src/assert.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { assert } from './index'; +import { assert } from '.'; describe('assert', () => { it('should not throw an error when test is true', () => { diff --git a/packages/util/src/bn/fromHex.spec.ts b/packages/util/src/bn/fromHex.spec.ts index 43c18fbfd..cd5db3aff 100644 --- a/packages/util/src/bn/fromHex.spec.ts +++ b/packages/util/src/bn/fromHex.spec.ts @@ -4,7 +4,7 @@ import isFunction from '../is/function'; -import { bnFromHex } from './index'; +import { bnFromHex } from '.'; describe('bnFromHex', () => { it('exists as a function', () => { diff --git a/packages/util/src/bn/toBn.spec.ts b/packages/util/src/bn/toBn.spec.ts index 2f0249b92..194245485 100644 --- a/packages/util/src/bn/toBn.spec.ts +++ b/packages/util/src/bn/toBn.spec.ts @@ -4,7 +4,7 @@ import BN from 'bn.js'; -import { bnToBn } from './index'; +import { bnToBn } from '.'; describe('bnToBn', () => { it('converts null values to 0x00', () => { diff --git a/packages/util/src/bn/toHex.spec.ts b/packages/util/src/bn/toHex.spec.ts index 80a0bd9b4..a34bc00df 100644 --- a/packages/util/src/bn/toHex.spec.ts +++ b/packages/util/src/bn/toHex.spec.ts @@ -4,7 +4,7 @@ import BN from 'bn.js'; -import { bnToHex } from './index'; +import { bnToHex } from '.'; describe('bnToHex', () => { it('converts null values to 0x00', () => { diff --git a/packages/util/src/bn/toU8a.spec.ts b/packages/util/src/bn/toU8a.spec.ts index a959158d9..998479ef5 100644 --- a/packages/util/src/bn/toU8a.spec.ts +++ b/packages/util/src/bn/toU8a.spec.ts @@ -4,7 +4,7 @@ import BN from 'bn.js'; -import { bnToU8a } from './index'; +import { bnToU8a } from '.'; describe('bnToU8a', () => { it('converts null values to 0x00', () => { diff --git a/packages/util/src/buffer/toU8a.spec.ts b/packages/util/src/buffer/toU8a.spec.ts index 6f51b9f1b..1f6f991e1 100644 --- a/packages/util/src/buffer/toU8a.spec.ts +++ b/packages/util/src/buffer/toU8a.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { bufferToU8a } from './index'; +import { bufferToU8a } from '.'; describe('bufferToU8a', () => { it('returns an empty buffer when null provided', () => { diff --git a/packages/util/src/ext/error.spec.ts b/packages/util/src/ext/error.spec.ts index e65a65b01..e2402025f 100644 --- a/packages/util/src/ext/error.spec.ts +++ b/packages/util/src/ext/error.spec.ts @@ -3,7 +3,7 @@ // of the Apache-2.0 license. See the LICENSE file for details. import isError from '../is/error'; -import { ExtError } from './index'; +import { ExtError } from '.'; describe('ExtError', () => { describe('constructor', () => { diff --git a/packages/util/src/hex/addPrefix.spec.ts b/packages/util/src/hex/addPrefix.spec.ts index 7db21e545..fda83d2a0 100644 --- a/packages/util/src/hex/addPrefix.spec.ts +++ b/packages/util/src/hex/addPrefix.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { hexAddPrefix } from './index'; +import { hexAddPrefix } from '.'; describe('hexAddPrefix', () => { it('does not add when prefix is available', () => { diff --git a/packages/util/src/hex/fixLength.spec.ts b/packages/util/src/hex/fixLength.spec.ts index 8df19a2b5..93bc99aeb 100644 --- a/packages/util/src/hex/fixLength.spec.ts +++ b/packages/util/src/hex/fixLength.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { hexFixLength } from './index'; +import { hexFixLength } from '.'; describe('hexFixLength', () => { it('returns bitLength === -1 as-is', () => { diff --git a/packages/util/src/hex/hasPrefix.spec.ts b/packages/util/src/hex/hasPrefix.spec.ts index e65348a73..bb10a86a9 100644 --- a/packages/util/src/hex/hasPrefix.spec.ts +++ b/packages/util/src/hex/hasPrefix.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { hexHasPrefix } from './index'; +import { hexHasPrefix } from '.'; describe('hexHasPrefix', () => { it('returns true when hex prefix is found', () => { diff --git a/packages/util/src/hex/stripPrefix.spec.ts b/packages/util/src/hex/stripPrefix.spec.ts index e022fe31a..46aca5155 100644 --- a/packages/util/src/hex/stripPrefix.spec.ts +++ b/packages/util/src/hex/stripPrefix.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { hexStripPrefix } from './index'; +import { hexStripPrefix } from '.'; describe('hexStripPrefix', () => { it('returns an empty string when null value supplied', () => { diff --git a/packages/util/src/hex/toBn.spec.ts b/packages/util/src/hex/toBn.spec.ts index c5ad410a5..41f4cead1 100644 --- a/packages/util/src/hex/toBn.spec.ts +++ b/packages/util/src/hex/toBn.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { hexToBn } from './index'; +import { hexToBn } from '.'; describe('hexToBn', () => { it('converts prefixed hex values to BN', () => { diff --git a/packages/util/src/hex/toNumber.spec.ts b/packages/util/src/hex/toNumber.spec.ts index 97975867e..5e67dfbd1 100644 --- a/packages/util/src/hex/toNumber.spec.ts +++ b/packages/util/src/hex/toNumber.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { hexToNumber } from './index'; +import { hexToNumber } from '.'; describe('hexToNumber', () => { it('converts an empty to NaN', () => { diff --git a/packages/util/src/hex/toU8a.spec.ts b/packages/util/src/hex/toU8a.spec.ts index efeedf9ee..f43b88af7 100644 --- a/packages/util/src/hex/toU8a.spec.ts +++ b/packages/util/src/hex/toU8a.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { hexToU8a } from './index'; +import { hexToU8a } from '.'; describe('hexToU8a', () => { it('returns an empty Uint8Array when null provided', () => { diff --git a/packages/util/src/index.spec.ts b/packages/util/src/index.spec.ts index df7f19996..2ae6940ea 100644 --- a/packages/util/src/index.spec.ts +++ b/packages/util/src/index.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { assert } from './index'; +import { assert } from '.'; describe('index', () => { it('exports ok', () => { diff --git a/packages/util/src/is/bn.spec.ts b/packages/util/src/is/bn.spec.ts index 1cf24b15a..3bfc85ea2 100644 --- a/packages/util/src/is/bn.spec.ts +++ b/packages/util/src/is/bn.spec.ts @@ -4,7 +4,7 @@ import BN from 'bn.js'; -import { isBn } from './index'; +import { isBn } from '.'; describe('isBN', () => { it('returns true when a BN value', () => { diff --git a/packages/util/src/is/boolean.spec.ts b/packages/util/src/is/boolean.spec.ts index 1503eab81..914d8ff7d 100644 --- a/packages/util/src/is/boolean.spec.ts +++ b/packages/util/src/is/boolean.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isBoolean } from './index'; +import { isBoolean } from '.'; describe('isBoolean', () => { it('returns true on false', () => { diff --git a/packages/util/src/is/buffer.spec.ts b/packages/util/src/is/buffer.spec.ts index d92258193..670404481 100644 --- a/packages/util/src/is/buffer.spec.ts +++ b/packages/util/src/is/buffer.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isBuffer } from './index'; +import { isBuffer } from '.'; describe('isBuffer', () => { it('returns true when a Buffer value', () => { diff --git a/packages/util/src/is/error.spec.ts b/packages/util/src/is/error.spec.ts index d9efe6e92..f34c337b9 100644 --- a/packages/util/src/is/error.spec.ts +++ b/packages/util/src/is/error.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isError } from './index'; +import { isError } from '.'; describe('isError', () => { it('returns true when an Error value', () => { diff --git a/packages/util/src/is/function.spec.ts b/packages/util/src/is/function.spec.ts index 7764da358..9b06bca20 100644 --- a/packages/util/src/is/function.spec.ts +++ b/packages/util/src/is/function.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isFunction } from './index'; +import { isFunction } from '.'; describe('isFunction', () => { it('returns true on valid functions', () => { diff --git a/packages/util/src/is/hex.spec.ts b/packages/util/src/is/hex.spec.ts index ccfd3bec4..342016a36 100644 --- a/packages/util/src/is/hex.spec.ts +++ b/packages/util/src/is/hex.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isHex } from './index'; +import { isHex } from '.'; describe('isHex', () => { const test = '1234abcd'; diff --git a/packages/util/src/is/instanceOf.spec.ts b/packages/util/src/is/instanceOf.spec.ts index 6c8d7696b..c83384044 100644 --- a/packages/util/src/is/instanceOf.spec.ts +++ b/packages/util/src/is/instanceOf.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isInstanceOf } from './index'; +import { isInstanceOf } from '.'; describe('isInstanceOf', () => { it('returns true on real instances', () => { diff --git a/packages/util/src/is/ip.spec.ts b/packages/util/src/is/ip.spec.ts index 727e018b8..1a9210c1d 100644 --- a/packages/util/src/is/ip.spec.ts +++ b/packages/util/src/is/ip.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isIp } from './index'; +import { isIp } from '.'; describe('isIp', () => { it('returns false when non-ip found', () => { diff --git a/packages/util/src/is/jsonObject.spec.ts b/packages/util/src/is/jsonObject.spec.ts index c31c97bf3..002a9457d 100644 --- a/packages/util/src/is/jsonObject.spec.ts +++ b/packages/util/src/is/jsonObject.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isJsonObject } from './index'; +import { isJsonObject } from '.'; const jsonObject = `{ "Test": "1234", diff --git a/packages/util/src/is/null.spec.ts b/packages/util/src/is/null.spec.ts index 5845e39e9..96bde2dba 100644 --- a/packages/util/src/is/null.spec.ts +++ b/packages/util/src/is/null.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isNull } from './index'; +import { isNull } from '.'; describe('isNull', () => { it('returns true when a null value', () => { diff --git a/packages/util/src/is/number.spec.ts b/packages/util/src/is/number.spec.ts index 0ddf6fea5..2617550db 100644 --- a/packages/util/src/is/number.spec.ts +++ b/packages/util/src/is/number.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isNumber } from './index'; +import { isNumber } from '.'; describe('isNumber', () => { it('returns true on valid numbers', () => { diff --git a/packages/util/src/is/object.spec.ts b/packages/util/src/is/object.spec.ts index d90b83fa6..d0ea408f5 100644 --- a/packages/util/src/is/object.spec.ts +++ b/packages/util/src/is/object.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isObject } from './index'; +import { isObject } from '.'; describe('isObject', () => { it('returns true on valid objects', () => { diff --git a/packages/util/src/is/observable.spec.ts b/packages/util/src/is/observable.spec.ts index 2f60649be..e697272dc 100644 --- a/packages/util/src/is/observable.spec.ts +++ b/packages/util/src/is/observable.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isObservable } from './index'; +import { isObservable } from '.'; describe('isObservable', () => { it('returns true on valid observables', () => { diff --git a/packages/util/src/is/string.spec.ts b/packages/util/src/is/string.spec.ts index 279f25b70..0f2e17fee 100644 --- a/packages/util/src/is/string.spec.ts +++ b/packages/util/src/is/string.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isString } from './index'; +import { isString } from '.'; describe('isString', () => { it('returns true on valid strings', () => { diff --git a/packages/util/src/is/u8a.spec.ts b/packages/util/src/is/u8a.spec.ts index 063e2dc77..f1196b61c 100644 --- a/packages/util/src/is/u8a.spec.ts +++ b/packages/util/src/is/u8a.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isU8a } from './index'; +import { isU8a } from '.'; describe('isUint8Array', () => { it('returns false on undefined values', () => { diff --git a/packages/util/src/is/undefined.spec.ts b/packages/util/src/is/undefined.spec.ts index 0929b9a8e..84a1226c7 100644 --- a/packages/util/src/is/undefined.spec.ts +++ b/packages/util/src/is/undefined.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { isUndefined } from './index'; +import { isUndefined } from '.'; describe('isUndefined', () => { it('returns true on undefined values', () => { diff --git a/packages/util/src/logger.spec.ts b/packages/util/src/logger.spec.ts index f7a0a1fe0..dafb2eb86 100644 --- a/packages/util/src/logger.spec.ts +++ b/packages/util/src/logger.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { logger } from './index'; +import { logger } from '.'; import { format } from './logger'; describe('logger', () => { diff --git a/packages/util/src/number/toHex.spec.ts b/packages/util/src/number/toHex.spec.ts index 52070fb3b..016db9126 100644 --- a/packages/util/src/number/toHex.spec.ts +++ b/packages/util/src/number/toHex.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { numberToHex } from './index'; +import { numberToHex } from '.'; describe('numberToHex', () => { it('converts undefined to 0x', () => { diff --git a/packages/util/src/number/toU8a.spec.ts b/packages/util/src/number/toU8a.spec.ts index 97ba8494c..310d941ac 100644 --- a/packages/util/src/number/toU8a.spec.ts +++ b/packages/util/src/number/toU8a.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { numberToU8a } from './index'; +import { numberToU8a } from '.'; describe('numberToU8a', () => { it('converts 0 to empty', () => { diff --git a/packages/util/src/promisify.spec.ts b/packages/util/src/promisify.spec.ts index b02135b13..d7bdbdb5e 100644 --- a/packages/util/src/promisify.spec.ts +++ b/packages/util/src/promisify.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { promisify } from './index'; +import { promisify } from '.'; describe('promisify', () => { it('handles functions with no parameters (resolve)', () => { diff --git a/packages/util/src/string/camelCase.spec.ts b/packages/util/src/string/camelCase.spec.ts index b61eccab6..bdb6e2897 100644 --- a/packages/util/src/string/camelCase.spec.ts +++ b/packages/util/src/string/camelCase.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { stringCamelCase } from './index'; +import { stringCamelCase } from '.'; describe('stringCamelCase', () => { it('works correctly', () => { diff --git a/packages/util/src/string/lowerFirst.spec.ts b/packages/util/src/string/lowerFirst.spec.ts index ae741ccf1..a777db707 100644 --- a/packages/util/src/string/lowerFirst.spec.ts +++ b/packages/util/src/string/lowerFirst.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { stringLowerFirst } from './index'; +import { stringLowerFirst } from '.'; describe('stringLowerFirst', () => { it("lowers the first letter if it's a capital letter", () => { diff --git a/packages/util/src/string/shorten.spec.ts b/packages/util/src/string/shorten.spec.ts index 9e8cb215c..7783dd5af 100644 --- a/packages/util/src/string/shorten.spec.ts +++ b/packages/util/src/string/shorten.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { stringShorten } from './index'; +import { stringShorten } from '.'; describe('stringShorten', () => { it('returns the value as-is when <= maxLength', () => { diff --git a/packages/util/src/string/toU8a.spec.ts b/packages/util/src/string/toU8a.spec.ts index 229502a2a..5f906a9c9 100644 --- a/packages/util/src/string/toU8a.spec.ts +++ b/packages/util/src/string/toU8a.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { stringToU8a } from '../index'; +import { stringToU8a } from '..'; describe('stringToU8a', () => { it('decodes to an empty string for undefined', () => { diff --git a/packages/util/src/u8a/concat.spec.ts b/packages/util/src/u8a/concat.spec.ts index ea34e879b..4665fbb44 100644 --- a/packages/util/src/u8a/concat.spec.ts +++ b/packages/util/src/u8a/concat.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aConcat } from './index'; +import { u8aConcat } from '.'; describe('u8aConcat', () => { it('concatenates arrays', () => { diff --git a/packages/util/src/u8a/fixLength.spec.ts b/packages/util/src/u8a/fixLength.spec.ts index 9dc7660c6..4b2c435a2 100644 --- a/packages/util/src/u8a/fixLength.spec.ts +++ b/packages/util/src/u8a/fixLength.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aFixLength } from './index'; +import { u8aFixLength } from '.'; describe('u8aFixLength', () => { it('returns bitLength === -1 as-is', () => { diff --git a/packages/util/src/u8a/toBn.spec.ts b/packages/util/src/u8a/toBn.spec.ts index e453ea830..172a485db 100644 --- a/packages/util/src/u8a/toBn.spec.ts +++ b/packages/util/src/u8a/toBn.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aToBn } from './index'; +import { u8aToBn } from '.'; describe('u8aToBn', () => { it('converts little-endian by default', () => { diff --git a/packages/util/src/u8a/toBuffer.spec.ts b/packages/util/src/u8a/toBuffer.spec.ts index 0b3e2e019..9e67ad37b 100644 --- a/packages/util/src/u8a/toBuffer.spec.ts +++ b/packages/util/src/u8a/toBuffer.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aToBuffer } from './index'; +import { u8aToBuffer } from '.'; describe('u8aToBuffer', () => { it('returns [] when the buffer is null', () => { diff --git a/packages/util/src/u8a/toHex.spec.ts b/packages/util/src/u8a/toHex.spec.ts index 88b7455bb..17575d4aa 100644 --- a/packages/util/src/u8a/toHex.spec.ts +++ b/packages/util/src/u8a/toHex.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aToHex } from './index'; +import { u8aToHex } from '.'; describe('u8aToHex', () => { it('returns empty as 0x', () => { diff --git a/packages/util/src/u8a/toString.spec.ts b/packages/util/src/u8a/toString.spec.ts index 207826e81..c0ebc9d3c 100644 --- a/packages/util/src/u8a/toString.spec.ts +++ b/packages/util/src/u8a/toString.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aToString } from '../index'; +import { u8aToString } from '..'; describe('u8aToString', () => { it('decodes to an empty string for undefined', () => { diff --git a/packages/util/src/u8a/toU8a.spec.ts b/packages/util/src/u8a/toU8a.spec.ts index 8f96458fb..df4eed5a6 100644 --- a/packages/util/src/u8a/toU8a.spec.ts +++ b/packages/util/src/u8a/toU8a.spec.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { u8aToU8a } from './index'; +import { u8aToU8a } from '.'; describe('u8aToU8a', () => { it('returns an empty Uint8Array when null provided', () => { diff --git a/tsconfig.json b/tsconfig.json index 3f2f4626b..8d9d48747 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,14 +3,23 @@ "compilerOptions": { "baseUrl": ".", "paths": { + "@polkadot/chainspec": [ "packages/chainspec/src" ], "@polkadot/chainspec/*": [ "packages/chainspec/src/*" ], + "@polkadot/db": [ "packages/db/src" ], "@polkadot/db/*": [ "packages/db/src/*" ], + "@polkadot/keyring": [ "packages/keyring/src" ], "@polkadot/keyring/*": [ "packages/keyring/src/*" ], + "@polkadot/trie-codec": [ "packages/trie-codec/src" ], "@polkadot/trie-codec/*": [ "packages/trie-codec/src/*" ], + "@polkadot/trie-db": [ "packages/trie-db/src" ], "@polkadot/trie-db/*": [ "packages/trie-db/src/*" ], + "@polkadot/trie-hash": [ "packages/trie-hash/src" ], "@polkadot/trie-hash/*": [ "packages/trie-hash/src/*" ], + "@polkadot/util-crypto": [ "packages/util-crypto/src" ], "@polkadot/util-crypto/*": [ "packages/util-crypto/src/*" ], + "@polkadot/util-rlp": [ "packages/util-rlp/src" ], "@polkadot/util-rlp/*": [ "packages/util-rlp/src/*" ], + "@polkadot/util": [ "packages/util/src" ], "@polkadot/util/*": [ "packages/util/src/*" ] }, "typeRoots": [