From e19d377eecf169d26093375d1f1ad7d8e8556488 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 19 Feb 2019 16:02:45 +0100 Subject: [PATCH] Remove test polyfill, only include in tests (#322) * Remove test polyfill, only include in tests * Test polyfill for keyring --- packages/keyring/src/index.spec.ts | 2 ++ packages/util-crypto/src/schnorrkel/keypair/fromSeed.spec.ts | 2 ++ packages/util-crypto/src/schnorrkel/ready.spec.ts | 2 ++ .../src/schnorrkel/{schnorrkel-js/index.ts => schnorrkel-js.ts} | 1 - packages/util-crypto/src/schnorrkel/signVerify.spec.ts | 2 ++ .../schnorrkel/{schnorrkel-js/polyfill.ts => test-polyfill.ts} | 0 6 files changed, 8 insertions(+), 1 deletion(-) rename packages/util-crypto/src/schnorrkel/{schnorrkel-js/index.ts => schnorrkel-js.ts} (93%) rename packages/util-crypto/src/schnorrkel/{schnorrkel-js/polyfill.ts => test-polyfill.ts} (100%) diff --git a/packages/keyring/src/index.spec.ts b/packages/keyring/src/index.spec.ts index b3cf0ed12..3eda78cb2 100644 --- a/packages/keyring/src/index.spec.ts +++ b/packages/keyring/src/index.spec.ts @@ -2,6 +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 '@polkadot/util-crypto/schnorrkel/test-polyfill'; + import { hexToU8a, stringToU8a } from '@polkadot/util/index'; import { cryptoWaitReady } from '@polkadot/util-crypto/index'; diff --git a/packages/util-crypto/src/schnorrkel/keypair/fromSeed.spec.ts b/packages/util-crypto/src/schnorrkel/keypair/fromSeed.spec.ts index 335ca99fb..8d33507fe 100644 --- a/packages/util-crypto/src/schnorrkel/keypair/fromSeed.spec.ts +++ b/packages/util-crypto/src/schnorrkel/keypair/fromSeed.spec.ts @@ -2,6 +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 '../test-polyfill'; + import { stringToU8a } from '@polkadot/util/index'; import { schnorrkelKeypairFromSeed, schnorrkelWaitReady } from '../index'; diff --git a/packages/util-crypto/src/schnorrkel/ready.spec.ts b/packages/util-crypto/src/schnorrkel/ready.spec.ts index 05761db7d..c1035c514 100644 --- a/packages/util-crypto/src/schnorrkel/ready.spec.ts +++ b/packages/util-crypto/src/schnorrkel/ready.spec.ts @@ -2,6 +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 './test-polyfill'; + describe('ready', () => { let globalWA: typeof WebAssembly; diff --git a/packages/util-crypto/src/schnorrkel/schnorrkel-js/index.ts b/packages/util-crypto/src/schnorrkel/schnorrkel-js.ts similarity index 93% rename from packages/util-crypto/src/schnorrkel/schnorrkel-js/index.ts rename to packages/util-crypto/src/schnorrkel/schnorrkel-js.ts index 0130e7026..ad3bc6ecf 100644 --- a/packages/util-crypto/src/schnorrkel/schnorrkel-js/index.ts +++ b/packages/util-crypto/src/schnorrkel/schnorrkel-js.ts @@ -3,7 +3,6 @@ // of the Apache-2.0 license. See the LICENSE file for details. import '@polkadot/util/polyfill'; -import './polyfill'; // export * from '@parity/schnorrkel-js'; export * 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 2ed3d39f1..37a0855c7 100644 --- a/packages/util-crypto/src/schnorrkel/signVerify.spec.ts +++ b/packages/util-crypto/src/schnorrkel/signVerify.spec.ts @@ -2,6 +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 './test-polyfill'; + import { stringToU8a } from '@polkadot/util/index'; import randomAsU8a from '../random/asU8a'; diff --git a/packages/util-crypto/src/schnorrkel/schnorrkel-js/polyfill.ts b/packages/util-crypto/src/schnorrkel/test-polyfill.ts similarity index 100% rename from packages/util-crypto/src/schnorrkel/schnorrkel-js/polyfill.ts rename to packages/util-crypto/src/schnorrkel/test-polyfill.ts