From 7014afaab6104d4c0e48b129e7b254a777c3741e Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Mon, 23 Jul 2018 05:37:07 -0400 Subject: [PATCH] Fixing out-of-order browserify imports again. --- src.ts/utils/secp256k1.ts | 7 ++++++- src.ts/utils/transaction.ts | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src.ts/utils/secp256k1.ts b/src.ts/utils/secp256k1.ts index 5c660fd50..f464ab0f2 100644 --- a/src.ts/utils/secp256k1.ts +++ b/src.ts/utils/secp256k1.ts @@ -8,7 +8,6 @@ import { arrayify, hexlify, hexZeroPad, splitSignature } from './bytes'; import { hashMessage } from './hash'; import { keccak256 } from './keccak256'; import { defineReadOnly } from './properties'; -import { ec as EC } from 'elliptic'; import { Arrayish, Signature } from './types'; @@ -111,3 +110,9 @@ export function verifyMessage(message: Arrayish | string, signature: Signature | ); } +// !!! IMPORTANT !!! +// +// This must be be at the end, otherwise Browserify attempts to include upstream +// dependencies before this module is loaded. + +import { ec as EC } from 'elliptic'; diff --git a/src.ts/utils/transaction.ts b/src.ts/utils/transaction.ts index 1ef66d5ec..e9c12df54 100644 --- a/src.ts/utils/transaction.ts +++ b/src.ts/utils/transaction.ts @@ -3,7 +3,6 @@ import { getAddress } from './address'; import { bigNumberify, ConstantZero } from './bignumber'; import { arrayify, hexlify, hexZeroPad, splitSignature, stripZeros, } from './bytes'; import { keccak256 } from './keccak256'; -import { recoverAddress } from './secp256k1'; import * as RLP from './rlp'; @@ -160,3 +159,9 @@ export function parse(rawTransaction: Arrayish): Transaction { return tx; } +// !!! IMPORTANT !!! +// +// This must be be at the end, otherwise Browserify attempts to include upstream +// dependencies before this module is loaded. + +import { recoverAddress } from './secp256k1';