diff --git a/packages/api-contract/src/index.ts b/packages/api-contract/src/index.ts index 22f9a0a331..f18b887016 100644 --- a/packages/api-contract/src/index.ts +++ b/packages/api-contract/src/index.ts @@ -2,6 +2,5 @@ // SPDX-License-Identifier: Apache-2.0 export { Abi } from './Abi'; - export { Blueprint as BlueprintRx, Code as CodeRx, Contract as ContractRx } from './rx'; export { Blueprint as BlueprintPromise, Code as CodePromise, Contract as ContractPromise } from './promise'; diff --git a/packages/api-derive/src/util/cacheImpl.ts b/packages/api-derive/src/util/cacheImpl.ts index da0c5fc256..cba31b9981 100644 --- a/packages/api-derive/src/util/cacheImpl.ts +++ b/packages/api-derive/src/util/cacheImpl.ts @@ -5,7 +5,7 @@ import type { DeriveCache } from './types'; const mapCache = new Map(); -const deriveMapCache: DeriveCache = { +export const deriveMapCache: DeriveCache = { del: (key: string): void => { mapCache.delete(key); }, @@ -24,11 +24,9 @@ const deriveMapCache: DeriveCache = { } }; -const deriveNoopCache: DeriveCache = { +export const deriveNoopCache: DeriveCache = { del: (): void => undefined, forEach: () => undefined, get: (): undefined => undefined, set: (_: string, value: unknown): unknown => value }; - -export { deriveMapCache, deriveNoopCache }; diff --git a/packages/api/src/base/Getters.ts b/packages/api/src/base/Getters.ts index 4649a09ab8..b23a0dda6c 100644 --- a/packages/api/src/base/Getters.ts +++ b/packages/api/src/base/Getters.ts @@ -9,7 +9,7 @@ import type { ApiInterfaceRx, ApiTypes, DecoratedErrors, DecoratedEvents, Decora import { assertReturn } from '@polkadot/util'; -import { packageInfo } from '../detectPackage'; +import { packageInfo } from '../packageInfo'; import { Init } from './Init'; interface PkgJson { diff --git a/packages/api/src/detectPackage.ts b/packages/api/src/detectPackage.ts index 555104b96f..75f6a1f176 100644 --- a/packages/api/src/detectPackage.ts +++ b/packages/api/src/detectPackage.ts @@ -21,5 +21,3 @@ import { detectPackage } from '@polkadot/util'; import { packageInfo } from './packageInfo'; detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname); - -export { packageInfo }; diff --git a/packages/api/src/index.ts b/packages/api/src/index.ts index 6ddb2050b4..7fdd20cb85 100644 --- a/packages/api/src/index.ts +++ b/packages/api/src/index.ts @@ -7,6 +7,5 @@ export { Keyring } from '@polkadot/keyring'; export { WsProvider } from '@polkadot/rpc-provider/ws'; export { ApiPromise } from './promise'; -export { ApiRx } from './rx'; - export { SubmittableResult } from './submittable'; +export { ApiRx } from './rx'; diff --git a/packages/metadata/src/decorate/index.ts b/packages/metadata/src/decorate/index.ts index 38119be99e..f6e081edc1 100644 --- a/packages/metadata/src/decorate/index.ts +++ b/packages/metadata/src/decorate/index.ts @@ -30,4 +30,4 @@ export function expandMetadata (registry: Registry, metadata: Metadata): Decorat }; } -export { decorateConstants, decorateExtrinsics, decorateStorage }; +export { decorateConstants, decorateErrors, decorateEvents, decorateExtrinsics, decorateStorage }; diff --git a/packages/metadata/src/detectPackage.ts b/packages/metadata/src/detectPackage.ts index f63c6fae99..3387d13f3d 100644 --- a/packages/metadata/src/detectPackage.ts +++ b/packages/metadata/src/detectPackage.ts @@ -21,5 +21,3 @@ import { detectPackage } from '@polkadot/util'; import { packageInfo } from './packageInfo'; detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname); - -export { packageInfo }; diff --git a/packages/rpc-provider/test/mockHttp.ts b/packages/rpc-provider/test/mockHttp.ts index dd92e4a7cc..85c1ee3bdb 100644 --- a/packages/rpc-provider/test/mockHttp.ts +++ b/packages/rpc-provider/test/mockHttp.ts @@ -5,9 +5,9 @@ import nock from 'nock'; -const TEST_HTTP_URL = 'http://localhost:9944'; +export const TEST_HTTP_URL = 'http://localhost:9944'; -function mockHttp (requests: any[]): any { +export function mockHttp (requests: any[]): any { nock.cleanAll(); return requests.reduce((scope, request: any): nock.Scope => { @@ -21,8 +21,3 @@ function mockHttp (requests: any[]): any { }); }, nock(TEST_HTTP_URL)); } - -export { - TEST_HTTP_URL, - mockHttp -}; diff --git a/packages/rpc-provider/test/mockWs.ts b/packages/rpc-provider/test/mockWs.ts index 72ddbba5be..a44593aa55 100644 --- a/packages/rpc-provider/test/mockWs.ts +++ b/packages/rpc-provider/test/mockWs.ts @@ -3,8 +3,6 @@ import { Server, WebSocket } from 'mock-socket'; -const TEST_WS_URL = 'ws://localhost:9955'; - interface Scope { body: { [index: string]: Record }; requests: number; @@ -29,6 +27,8 @@ interface ReplyDef { global.WebSocket = WebSocket; +export const TEST_WS_URL = 'ws://localhost:9955'; + // should be JSONRPC def return function createError ({ error: { code, message }, id }: ErrorDef): any { return { @@ -51,7 +51,7 @@ function createReply ({ id, reply: { result } }: ReplyDef): any { } // scope definition returned -function mockWs (requests: ({ method: string } & ErrorDef)[], wsUrl: string = TEST_WS_URL): Scope { +export function mockWs (requests: ({ method: string } & ErrorDef)[], wsUrl: string = TEST_WS_URL): Scope { const server = new Server(wsUrl); let requestCount = 0; @@ -85,8 +85,3 @@ function mockWs (requests: ({ method: string } & ErrorDef)[], wsUrl: string = TE return scope; } - -export { - TEST_WS_URL, - mockWs -}; diff --git a/packages/types/src/detectPackage.ts b/packages/types/src/detectPackage.ts index 2ad5f6d239..e66b6eb0a4 100644 --- a/packages/types/src/detectPackage.ts +++ b/packages/types/src/detectPackage.ts @@ -21,5 +21,3 @@ import { detectPackage } from '@polkadot/util'; import { packageInfo } from './packageInfo'; detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname); - -export { packageInfo }; diff --git a/packages/types/src/generic/ConsensusEngineId.ts b/packages/types/src/generic/ConsensusEngineId.ts index f41c040adf..7b16efd0f4 100644 --- a/packages/types/src/generic/ConsensusEngineId.ts +++ b/packages/types/src/generic/ConsensusEngineId.ts @@ -12,12 +12,10 @@ import { u32 } from '../primitive/U32'; // there are all reversed since it is actually encoded as u32, LE, // this means that FRNK has the bytes as KNRF -const CID_AURA = 0x61727561; // 'aura' -const CID_BABE = 0x45424142; // 'BABE' -const CID_GRPA = 0x4b4e5246; // 'FRNK' (don't ask, used to be afg1) -const CID_POW = 0x5f776f70; // 'pow_' - -export { CID_AURA, CID_BABE, CID_GRPA, CID_POW }; +export const CID_AURA = 0x61727561; // 'aura' +export const CID_BABE = 0x45424142; // 'BABE' +export const CID_GRPA = 0x4b4e5246; // 'FRNK' (don't ask, used to be afg1) +export const CID_POW = 0x5f776f70; // 'pow_' /** * @name GenericConsensusEngineId diff --git a/packages/types/src/interfaces/democracy/definitions.ts b/packages/types/src/interfaces/democracy/definitions.ts index 7a66854b89..c8ebfbedbe 100644 --- a/packages/types/src/interfaces/democracy/definitions.ts +++ b/packages/types/src/interfaces/democracy/definitions.ts @@ -6,7 +6,7 @@ import type { Definitions } from '../../types'; -const AllConvictions = [ +export const AllConvictions = [ // 0.1x votes, unlocked. 'None', // 1x votes, locked for an enactment period following a successful vote. @@ -23,8 +23,6 @@ const AllConvictions = [ 'Locked6x' ]; -export { AllConvictions }; - export default { rpc: {}, types: { diff --git a/packages/types/src/interfaces/metadata/definitions.ts b/packages/types/src/interfaces/metadata/definitions.ts index cf29ca506d..cbae008686 100644 --- a/packages/types/src/interfaces/metadata/definitions.ts +++ b/packages/types/src/interfaces/metadata/definitions.ts @@ -6,7 +6,7 @@ import type { Definitions } from '../../types'; -const AllHashers = { +export const AllHashers = { Blake2_128: null, // eslint-disable-line camelcase Blake2_256: null, // eslint-disable-line camelcase Blake2_128Concat: null, // eslint-disable-line camelcase @@ -17,8 +17,6 @@ const AllHashers = { Identity: null }; -export { AllHashers }; - export default { rpc: {}, types: {