Skip to content

Commit 242673f

Browse files
committed
downgrade to @scure/bip39 1.6
CJS package needed to work around node20 failing in CI.
1 parent 9d9c769 commit 242673f

File tree

8 files changed

+38
-55
lines changed

8 files changed

+38
-55
lines changed

.pnp.cjs

Lines changed: 7 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.yarn/cache/@noble-hashes-npm-2.0.1-3deaaa8c92-e81769ce21.zip

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:2b8d39184f678d684942a2be88ae029bd70ff315fc0f3b15d359220b29b551c3
3+
size 393414

.yarn/cache/@scure-bip39-npm-2.0.1-715af0e367-ed8a0788bc.zip

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

packages/crypto/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@noble/ciphers": "^1.3.0",
4646
"@noble/curves": "^1.9.2",
4747
"@noble/hashes": "^1.8.0",
48-
"@scure/bip39": "^2.0.1",
48+
"@scure/bip39": "^1.6.0",
4949
"hash-wasm": "^4.12.0"
5050
},
5151
"devDependencies": {

packages/crypto/src/bip39.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,26 @@ describe("Bip39", () => {
2020

2121
it("throws for invalid input", () => {
2222
// invalid input length
23-
expect(() => Bip39.encode(fromHex(""))).toThrowError(/invalid entropy length/);
24-
expect(() => Bip39.encode(fromHex("00"))).toThrowError(/invalid entropy length/);
23+
expect(() => Bip39.encode(fromHex(""))).toThrowError(/got length/);
24+
expect(() => Bip39.encode(fromHex("00"))).toThrowError(/got length/);
2525
expect(() => Bip39.encode(fromHex("000000000000000000000000000000"))).toThrowError(
26-
/invalid entropy length/,
26+
/expected of length .*, got length=15/,
2727
);
2828
expect(() => Bip39.encode(fromHex("0000000000000000000000000000000000"))).toThrowError(
29-
/invalid entropy length/,
29+
/expected of length .*, got length=17/,
3030
);
3131
expect(() => Bip39.encode(fromHex("0000000000000000000000000000000000000000000000"))).toThrowError(
32-
/invalid entropy length/,
32+
/got length/,
3333
);
3434
expect(() => Bip39.encode(fromHex("00000000000000000000000000000000000000000000000000"))).toThrowError(
35-
/invalid entropy length/,
35+
/got length/,
3636
);
3737
expect(() =>
3838
Bip39.encode(fromHex("00000000000000000000000000000000000000000000000000000000000000")),
39-
).toThrowError(/invalid entropy length/);
39+
).toThrowError(/got length/);
4040
expect(() =>
4141
Bip39.encode(fromHex("000000000000000000000000000000000000000000000000000000000000000000")),
42-
).toThrowError(/invalid entropy length/);
42+
).toThrowError(/got length/);
4343
});
4444
});
4545

packages/crypto/src/bip39.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { entropyToMnemonic, mnemonicToEntropy, mnemonicToSeedWebcrypto } from "@scure/bip39";
2-
import { wordlist } from "@scure/bip39/wordlists/english.js";
1+
import { entropyToMnemonic, mnemonicToEntropy, mnemonicToSeed } from "@scure/bip39";
2+
import { wordlist } from "@scure/bip39/wordlists/english";
33

44
export class EnglishMnemonic {
55
public static readonly wordlist: readonly string[] = wordlist;
@@ -43,6 +43,6 @@ export class Bip39 {
4343
}
4444

4545
public static async mnemonicToSeed(mnemonic: EnglishMnemonic, password?: string): Promise<Uint8Array> {
46-
return await mnemonicToSeedWebcrypto(mnemonic.toString(), password);
46+
return await mnemonicToSeed(mnemonic.toString(), password);
4747
}
4848
}

yarn.lock

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ __metadata:
325325
"@noble/ciphers": "npm:^1.3.0"
326326
"@noble/curves": "npm:^1.9.2"
327327
"@noble/hashes": "npm:^1.8.0"
328-
"@scure/bip39": "npm:^2.0.1"
328+
"@scure/bip39": "npm:^1.6.0"
329329
"@types/jasmine": "npm:^4"
330330
"@types/karma-firefox-launcher": "npm:^2"
331331
"@types/karma-jasmine": "npm:^4"
@@ -1186,20 +1186,13 @@ __metadata:
11861186
languageName: node
11871187
linkType: hard
11881188

1189-
"@noble/hashes@npm:1.8.0, @noble/hashes@npm:^1.7.1, @noble/hashes@npm:^1.8.0":
1189+
"@noble/hashes@npm:1.8.0, @noble/hashes@npm:^1.7.1, @noble/hashes@npm:^1.8.0, @noble/hashes@npm:~1.8.0":
11901190
version: 1.8.0
11911191
resolution: "@noble/hashes@npm:1.8.0"
11921192
checksum: 10c0/06a0b52c81a6fa7f04d67762e08b2c476a00285858150caeaaff4037356dd5e119f45b2a530f638b77a5eeca013168ec1b655db41bae3236cb2e9d511484fc77
11931193
languageName: node
11941194
linkType: hard
11951195

1196-
"@noble/hashes@npm:2.0.1":
1197-
version: 2.0.1
1198-
resolution: "@noble/hashes@npm:2.0.1"
1199-
checksum: 10c0/e81769ce21c3b1c80141a3b99bd001f17edea09879aa936692ae39525477386d696101cd573928a304806efb2b9fa751e1dd83241c67d0c84d30091e85c79bdb
1200-
languageName: node
1201-
linkType: hard
1202-
12031196
"@nodelib/fs.scandir@npm:2.1.5":
12041197
version: 2.1.5
12051198
resolution: "@nodelib/fs.scandir@npm:2.1.5"
@@ -1330,27 +1323,27 @@ __metadata:
13301323
languageName: node
13311324
linkType: hard
13321325

1333-
"@scure/base@npm:2.0.0, @scure/base@npm:^2.0.0":
1334-
version: 2.0.0
1335-
resolution: "@scure/base@npm:2.0.0"
1336-
checksum: 10c0/7d999c7bebf053bb49cb706fdc6c5366737cff0f7f7518f52d32d7f7ad7b898904f03673648a2af5c4f22396f5c05f1d8bddbf010d6595052d07ba8163d506ad
1337-
languageName: node
1338-
linkType: hard
1339-
1340-
"@scure/base@npm:^1.2.4":
1326+
"@scure/base@npm:^1.2.4, @scure/base@npm:~1.2.5":
13411327
version: 1.2.6
13421328
resolution: "@scure/base@npm:1.2.6"
13431329
checksum: 10c0/49bd5293371c4e062cb6ba689c8fe3ea3981b7bb9c000400dc4eafa29f56814cdcdd27c04311c2fec34de26bc373c593a1d6ca6d754398a488d587943b7c128a
13441330
languageName: node
13451331
linkType: hard
13461332

1347-
"@scure/bip39@npm:^2.0.1":
1348-
version: 2.0.1
1349-
resolution: "@scure/bip39@npm:2.0.1"
1333+
"@scure/base@npm:^2.0.0":
1334+
version: 2.0.0
1335+
resolution: "@scure/base@npm:2.0.0"
1336+
checksum: 10c0/7d999c7bebf053bb49cb706fdc6c5366737cff0f7f7518f52d32d7f7ad7b898904f03673648a2af5c4f22396f5c05f1d8bddbf010d6595052d07ba8163d506ad
1337+
languageName: node
1338+
linkType: hard
1339+
1340+
"@scure/bip39@npm:^1.6.0":
1341+
version: 1.6.0
1342+
resolution: "@scure/bip39@npm:1.6.0"
13501343
dependencies:
1351-
"@noble/hashes": "npm:2.0.1"
1352-
"@scure/base": "npm:2.0.0"
1353-
checksum: 10c0/ed8a0788bca006a6e4a647ed67c4c973b1deeaee5d62ddc168c9521c33e3a66cf5707c8aadcd0b6f9e3e41c3f763a985d913f4abc3813963497238e73ce166b6
1344+
"@noble/hashes": "npm:~1.8.0"
1345+
"@scure/base": "npm:~1.2.5"
1346+
checksum: 10c0/73a54b5566a50a3f8348a5cfd74d2092efeefc485efbed83d7a7374ffd9a75defddf446e8e5ea0385e4adb49a94b8ae83c5bad3e16333af400e932f7da3aaff8
13541347
languageName: node
13551348
linkType: hard
13561349

0 commit comments

Comments
 (0)