Skip to content

Commit 8c669d6

Browse files
committed
Fix tests and build scripts
1 parent fb998de commit 8c669d6

File tree

8 files changed

+4
-46
lines changed

8 files changed

+4
-46
lines changed

packages/ethereum-cryptography/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"elliptic-secp256k1:build": "rollup -c elliptic-secp256k1-config/rollup.config.js",
7979
"elliptic-secp256k1:copy": "mkdir -p vendor && cp src/vendor/elliptic-secp256k1.js ./vendor",
8080
"scryptsy-without-crypto:build": "bash -x scripts/build-scryptsy-without-crypto.sh",
81-
"scryptsy-without-crypto:copy": "mkdir -p vendor pure/vendor && cp src/vendor/scryptsy-without-crypto.js ./vendor && cp src/pure/vendor/scryptsy-without-crypto.js ./pure/vendor",
81+
"scryptsy-without-crypto:copy": "mkdir -p vendor && cp src/vendor/scryptsy-without-crypto.js ./vendor",
8282
"hdkey-without-crypto:build": "bash -x scripts/build-hdkey-without-crypto.sh",
8383
"hdkey-without-crypto:copy": "mkdir -p vendor pure/vendor && cp src/vendor/hdkey-without-crypto.js ./vendor && cp src/pure/vendor/hdkey-without-crypto.js ./pure/vendor",
8484
"bip39-without-wordlists:build": "bash -x scripts/build-bip39-without-wordlists.sh",

packages/ethereum-cryptography/scripts/build-browser-tests.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ cp src/vendor/elliptic-secp256k1.js test-builds/tsc/src/vendor
1010

1111
echo "Building scryptsy-without-crypto"
1212
npm run scryptsy-without-crypto:build
13-
mkdir -p test-builds/tsc/src/vendor test-builds/tsc/src/pure/vendor
13+
mkdir -p test-builds/tsc/src/vendor
1414
cp src/vendor/scryptsy-without-crypto.js test-builds/tsc/src/vendor
15-
cp src/pure/vendor/scryptsy-without-crypto.js test-builds/tsc/src/pure/vendor
1615

1716
echo "Building hdkey-without-crypto"
1817
npm run hdkey-without-crypto:build

packages/ethereum-cryptography/scripts/build-scryptsy-without-crypto.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ npx tsc --allowJs --esModuleInterop ./scryptsy-without-crypto-build/rollup/scryp
88

99
echo "Copying output"
1010
cp scryptsy-without-crypto-build/scryptsy-without-crypto.js ./src/vendor
11-
cp scryptsy-without-crypto-build/scryptsy-without-crypto.js ./src/pure/vendor

packages/ethereum-cryptography/src/pure/scrypt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import "setimmediate";
2-
const scryptsy = require("./vendor/scryptsy-without-crypto");
2+
const scryptsy = require("../vendor/scryptsy-without-crypto");
33

44
export function scrypt(
55
password: Buffer,

packages/ethereum-cryptography/src/scrypt.ts

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,7 @@ try {
66
// tslint:disable-next-line no-implicit-dependencies
77
scryptModule = require("ethereum-cryptography-native/scrypt");
88
} catch {
9-
// This module is slightly more complicated, as we don't want to use the
10-
// 100% pure version of scrypt if the native one isn't installed.
11-
12-
// We require this local version of scryptsy-without-crypto because it uses
13-
// the built-in implementation of pbkdf2
14-
const scryptsy = require("./vendor/scryptsy-without-crypto");
15-
16-
scryptModule = {
17-
scrypt(
18-
password: Buffer,
19-
salt: Buffer,
20-
n: number,
21-
p: number,
22-
r: number,
23-
dklen: number
24-
): Promise<Buffer> {
25-
return scryptsy.async(password, salt, n, r, p, dklen);
26-
},
27-
scryptSync(
28-
password: Buffer,
29-
salt: Buffer,
30-
n: number,
31-
p: number,
32-
r: number,
33-
dklen: number
34-
): Buffer {
35-
return scryptsy(password, salt, n, r, p, dklen);
36-
}
37-
};
9+
scryptModule = scryptPure;
3810
}
3911

4012
export const scrypt = scryptModule.scrypt;

packages/ethereum-cryptography/test/pure/aes.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/ethereum-cryptography/test/pure/pbkdf2.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/ethereum-cryptography/test/pure/random.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)