Skip to content

Commit 6187f4b

Browse files
committed
downgrade to @scure/bip39 1.6
CJS package needed to work around node20 failing in CI.
1 parent 510a30c commit 6187f4b

File tree

10 files changed

+42
-59
lines changed

10 files changed

+42
-59
lines changed

.pnp.cjs

Lines changed: 8 additions & 15 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
}

packages/faucet/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@cosmjs/stargate": "workspace:^",
4747
"@cosmjs/utils": "workspace:^",
4848
"@koa/cors": "^5.0",
49-
"@scure/bip39": "^2.0.1",
49+
"@scure/bip39": "^1.6.0",
5050
"koa": "^2.16.1",
5151
"koa-bodyparser": "^4.3"
5252
},

packages/faucet/src/actions/generate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { generateMnemonic } from "@scure/bip39";
2-
import { wordlist } from "@scure/bip39/wordlists/english.js";
2+
import { wordlist } from "@scure/bip39/wordlists/english";
33

44
import * as constants from "../constants";
55
import { makePathBuilder } from "../pathbuilder";

yarn.lock

Lines changed: 17 additions & 24 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"
@@ -427,7 +427,7 @@ __metadata:
427427
"@cosmjs/utils": "workspace:^"
428428
"@istanbuljs/nyc-config-typescript": "npm:^1.0.1"
429429
"@koa/cors": "npm:^5.0"
430-
"@scure/bip39": "npm:^2.0.1"
430+
"@scure/bip39": "npm:^1.6.0"
431431
"@types/jasmine": "npm:^4"
432432
"@types/koa": "npm:^2.15.0"
433433
"@types/koa-bodyparser": "npm:^4.3"
@@ -1187,20 +1187,13 @@ __metadata:
11871187
languageName: node
11881188
linkType: hard
11891189

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

1197-
"@noble/hashes@npm:2.0.1":
1198-
version: 2.0.1
1199-
resolution: "@noble/hashes@npm:2.0.1"
1200-
checksum: 10c0/e81769ce21c3b1c80141a3b99bd001f17edea09879aa936692ae39525477386d696101cd573928a304806efb2b9fa751e1dd83241c67d0c84d30091e85c79bdb
1201-
languageName: node
1202-
linkType: hard
1203-
12041197
"@nodelib/fs.scandir@npm:2.1.5":
12051198
version: 2.1.5
12061199
resolution: "@nodelib/fs.scandir@npm:2.1.5"
@@ -1331,27 +1324,27 @@ __metadata:
13311324
languageName: node
13321325
linkType: hard
13331326

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

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

0 commit comments

Comments
 (0)