Skip to content

Commit c64847d

Browse files
authored
.js extension imports from @noble/hashes (#1821)
* crypto: depend on @noble/hashes >= 1.8.0 This dependency should have been raised back in commit 4bcbbfd which added .js extension imports (because all extensionless imports are deprecated). * revert "Remove .js extensions from @noble/hashes imports" This undoes the changes in commit 31e71f9 * always import @noble/hashes with .js extension extensionless imports are deprecated in 1.8 and removed in 2.0. Missed these two in the earlier deprecation warnings fixes #1767.
1 parent 124f6b4 commit c64847d

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

packages/crypto/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"@cosmjs/utils": "workspace:^",
4545
"@noble/ciphers": "^1.3.0",
4646
"@noble/curves": "^1.9.2",
47-
"@noble/hashes": "^1",
47+
"@noble/hashes": "^1.8.0",
4848
"hash-wasm": "^4.12.0"
4949
},
5050
"devDependencies": {

packages/crypto/src/keccak.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { keccak_256 } from "@noble/hashes/sha3";
1+
import { keccak_256 } from "@noble/hashes/sha3.js";
22

33
import { HashFunction } from "./hash";
44
import { toRealUint8Array } from "./utils";

packages/crypto/src/pbkdf2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { assert } from "@cosmjs/utils";
2-
import { pbkdf2Async as noblePbkdf2Async } from "@noble/hashes/pbkdf2";
3-
import { sha512 as nobleSha512 } from "@noble/hashes/sha2";
2+
import { pbkdf2Async as noblePbkdf2Async } from "@noble/hashes/pbkdf2.js";
3+
import { sha512 as nobleSha512 } from "@noble/hashes/sha2.js";
44

55
/**
66
* Returns the SubtleCrypto API for this environment if present.

packages/crypto/src/ripemd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ripemd160 as nobleRipemd160 } from "@noble/hashes/legacy";
1+
import { ripemd160 as nobleRipemd160 } from "@noble/hashes/legacy.js";
22

33
import { HashFunction } from "./hash";
44
import { toRealUint8Array } from "./utils";

packages/crypto/src/sha.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { sha256 as nobleSha256, sha512 as nobleSha512 } from "@noble/hashes/sha2";
1+
import { sha256 as nobleSha256, sha512 as nobleSha512 } from "@noble/hashes/sha2.js";
22

33
import { HashFunction } from "./hash";
44
import { toRealUint8Array } from "./utils";

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ __metadata:
324324
"@istanbuljs/nyc-config-typescript": "npm:^1.0.1"
325325
"@noble/ciphers": "npm:^1.3.0"
326326
"@noble/curves": "npm:^1.9.2"
327-
"@noble/hashes": "npm:^1"
327+
"@noble/hashes": "npm:^1.8.0"
328328
"@types/jasmine": "npm:^4"
329329
"@types/karma-firefox-launcher": "npm:^2"
330330
"@types/karma-jasmine": "npm:^4"
@@ -1185,7 +1185,7 @@ __metadata:
11851185
languageName: node
11861186
linkType: hard
11871187

1188-
"@noble/hashes@npm:1.8.0, @noble/hashes@npm:^1, @noble/hashes@npm:^1.7.1":
1188+
"@noble/hashes@npm:1.8.0, @noble/hashes@npm:^1.7.1, @noble/hashes@npm:^1.8.0":
11891189
version: 1.8.0
11901190
resolution: "@noble/hashes@npm:1.8.0"
11911191
checksum: 10c0/06a0b52c81a6fa7f04d67762e08b2c476a00285858150caeaaff4037356dd5e119f45b2a530f638b77a5eeca013168ec1b655db41bae3236cb2e9d511484fc77

0 commit comments

Comments
 (0)