diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 81bf353..0adc854 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -11,6 +11,7 @@ jobs: node: - 18 - 20 + - 22 steps: - uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4 - name: Use Node.js ${{ matrix.node }} diff --git a/test/basic.test.js b/test/basic.test.js index cdfad30..bff6fd0 100644 --- a/test/basic.test.js +++ b/test/basic.test.js @@ -1864,7 +1864,7 @@ should('unspendable output (gh-66)', () => { }); // ESM is broken. -import url from 'url'; +import url from 'node:url'; if (import.meta.url === url.pathToFileURL(process.argv[1]).href) { should.run(); } diff --git a/test/bip174-psbt.test.js b/test/bip174-psbt.test.js index dc5f0e8..03d8d3b 100644 --- a/test/bip174-psbt.test.js +++ b/test/bip174-psbt.test.js @@ -249,7 +249,7 @@ should('bip174-psbt: PSBT garbage', () => { }); // ESM is broken. -import url from 'url'; +import url from 'node:url'; if (import.meta.url === url.pathToFileURL(process.argv[1]).href) { should.run(); } diff --git a/test/bip340-schnorr.test.js b/test/bip340-schnorr.test.js index 5e39d74..4228b05 100644 --- a/test/bip340-schnorr.test.js +++ b/test/bip340-schnorr.test.js @@ -31,7 +31,7 @@ for (const v of v340) { } // ESM is broken. -import url from 'url'; +import url from 'node:url'; if (import.meta.url === url.pathToFileURL(process.argv[1]).href) { should.run(); } diff --git a/test/bip341-taproot.test.js b/test/bip341-taproot.test.js index a7190ff..dc08c36 100644 --- a/test/bip341-taproot.test.js +++ b/test/bip341-taproot.test.js @@ -217,7 +217,7 @@ should('verify unspendable key', () => { }); // ESM is broken. -import url from 'url'; +import url from 'node:url'; if (import.meta.url === url.pathToFileURL(process.argv[1]).href) { should.run(); } diff --git a/test/bip67-multisig.test.js b/test/bip67-multisig.test.js index 51cc015..763aa2a 100644 --- a/test/bip67-multisig.test.js +++ b/test/bip67-multisig.test.js @@ -79,7 +79,7 @@ for (let i = 0; i < BIP67.length; i++) { } // ESM is broken. -import url from 'url'; +import url from 'node:url'; if (import.meta.url === url.pathToFileURL(process.argv[1]).href) { should.run(); } diff --git a/test/bitcoinjs-test/btcjs-address.test.js b/test/bitcoinjs-test/btcjs-address.test.js index 5435231..d37f569 100644 --- a/test/bitcoinjs-test/btcjs-address.test.js +++ b/test/bitcoinjs-test/btcjs-address.test.js @@ -2,15 +2,15 @@ import { deepStrictEqual, throws } from 'node:assert'; import { should } from 'micro-should'; import { hex, base64 } from '@scure/base'; import * as btc from '../../lib/esm/index.js'; -import { default as p2ms } from './fixtures/bitcoinjs/p2ms.json' assert { type: 'json' }; -import { default as p2pk } from './fixtures/bitcoinjs/p2pk.json' assert { type: 'json' }; -import { default as p2pkh } from './fixtures/bitcoinjs/p2pkh.json' assert { type: 'json' }; -import { default as p2sh } from './fixtures/bitcoinjs/p2sh.json' assert { type: 'json' }; -import { default as p2wpkh } from './fixtures/bitcoinjs/p2wpkh.json' assert { type: 'json' }; -import { default as p2wsh } from './fixtures/bitcoinjs/p2wsh.json' assert { type: 'json' }; -import { default as p2tr } from './fixtures/bitcoinjs-taproot/p2tr.json' assert { type: 'json' }; -import { default as p2tr_ns } from './fixtures/bitcoinjs-taproot/p2tr_ns.json' assert { type: 'json' }; -import { default as p2tr_bitgo } from './fixtures/bitcoinjs-taproot/p2tr_bitgo.json' assert { type: 'json' }; +import { default as p2ms } from './fixtures/bitcoinjs/p2ms.json' with { type: 'json' }; +import { default as p2pk } from './fixtures/bitcoinjs/p2pk.json' with { type: 'json' }; +import { default as p2pkh } from './fixtures/bitcoinjs/p2pkh.json' with { type: 'json' }; +import { default as p2sh } from './fixtures/bitcoinjs/p2sh.json' with { type: 'json' }; +import { default as p2wpkh } from './fixtures/bitcoinjs/p2wpkh.json' with { type: 'json' }; +import { default as p2wsh } from './fixtures/bitcoinjs/p2wsh.json' with { type: 'json' }; +import { default as p2tr } from './fixtures/bitcoinjs-taproot/p2tr.json' with { type: 'json' }; +import { default as p2tr_ns } from './fixtures/bitcoinjs-taproot/p2tr_ns.json' with { type: 'json' }; +import { default as p2tr_bitgo } from './fixtures/bitcoinjs-taproot/p2tr_bitgo.json' with { type: 'json' }; import * as utils from './utils.js'; @@ -85,7 +85,7 @@ for (const type in payments) { } // ESM is broken. -import url from 'url'; +import url from 'node:url'; if (import.meta.url === url.pathToFileURL(process.argv[1]).href) { should.run(); } diff --git a/test/bitcoinjs-test/btcjs-taproot.test.js b/test/bitcoinjs-test/btcjs-taproot.test.js index 02d0cbb..46e10af 100644 --- a/test/bitcoinjs-test/btcjs-taproot.test.js +++ b/test/bitcoinjs-test/btcjs-taproot.test.js @@ -3,8 +3,8 @@ import { should } from 'micro-should'; import { hex, base64 } from '@scure/base'; import * as btc from '../../lib/esm/index.js'; import * as P from 'micro-packed'; -import { default as p2tr } from './fixtures/bitcoinjs-taproot/p2tr.json' assert { type: 'json' }; -import { default as tapPsbt } from './fixtures/bitcoinjs-taproot/psbt.json' assert { type: 'json' }; +import { default as p2tr } from './fixtures/bitcoinjs-taproot/p2tr.json' with { type: 'json' }; +import { default as tapPsbt } from './fixtures/bitcoinjs-taproot/psbt.json' with { type: 'json' }; // TODO: move to index.ts as compat layer for bitcoinjs-lib? function fromASM(asm) { @@ -66,7 +66,7 @@ for (let i = 0; i < tapPsbt.signInput.checks.length; i++) { } // ESM is broken. -import url from 'url'; +import url from 'node:url'; if (import.meta.url === url.pathToFileURL(process.argv[1]).href) { should.run(); } diff --git a/test/bitcoinjs-test/btcjs.test.js b/test/bitcoinjs-test/btcjs.test.js index 5edeb3e..ae8e991 100644 --- a/test/bitcoinjs-test/btcjs.test.js +++ b/test/bitcoinjs-test/btcjs.test.js @@ -3,11 +3,11 @@ import { should } from 'micro-should'; import { hex, base64 } from '@scure/base'; import * as btc from '../../lib/esm/index.js'; import * as bip32 from '@scure/bip32'; -import { default as f_transaction } from './fixtures/bitcoinjs/transaction.json' assert { type: 'json' }; -import { default as f_script } from './fixtures/bitcoinjs/script.json' assert { type: 'json' }; -import { default as f_script_number } from './fixtures/bitcoinjs/script_number.json' assert { type: 'json' }; -import { default as f_address } from './fixtures/bitcoinjs/address.json' assert { type: 'json' }; -import { default as psbt } from './fixtures/bitcoinjs/psbt.json' assert { type: 'json' }; +import { default as f_transaction } from './fixtures/bitcoinjs/transaction.json' with { type: 'json' }; +import { default as f_script } from './fixtures/bitcoinjs/script.json' with { type: 'json' }; +import { default as f_script_number } from './fixtures/bitcoinjs/script_number.json' with { type: 'json' }; +import { default as f_address } from './fixtures/bitcoinjs/address.json' with { type: 'json' }; +import { default as psbt } from './fixtures/bitcoinjs/psbt.json' with { type: 'json' }; import * as utils from './utils.js'; should('version is int32le', () => { @@ -633,7 +633,7 @@ for (let i = 0; i < psbt.signInputHD.checks.length; i++) { } // ESM is broken. -import url from 'url'; +import url from 'node:url'; if (import.meta.url === url.pathToFileURL(process.argv[1]).href) { should.run(); } diff --git a/test/psbt-test/bip174-psbt-extended.test.js b/test/psbt-test/bip174-psbt-extended.test.js index b1c86ca..38c8fb2 100644 --- a/test/psbt-test/bip174-psbt-extended.test.js +++ b/test/psbt-test/bip174-psbt-extended.test.js @@ -107,7 +107,7 @@ describe('bip174-psbt-extended', () => { }); // ESM is broken. -import url from 'url'; +import url from 'node:url'; if (import.meta.url === url.pathToFileURL(process.argv[1]).href) { should.run(); } diff --git a/test/slow.test.js b/test/slow.test.js index 61d7a5b..92b5bd0 100644 --- a/test/slow.test.js +++ b/test/slow.test.js @@ -39,7 +39,7 @@ should('big multisig (ours)', () => { }); // ESM is broken. -import url from 'url'; +import url from 'node:url'; if (import.meta.url === url.pathToFileURL(process.argv[1]).href) { should.run(); } diff --git a/test/taproot-multisig.test.js b/test/taproot-multisig.test.js index 5f4f065..e019551 100644 --- a/test/taproot-multisig.test.js +++ b/test/taproot-multisig.test.js @@ -222,7 +222,7 @@ describe('taproot-multisig', () => { }); // ESM is broken. -import url from 'url'; +import url from 'node:url'; if (import.meta.url === url.pathToFileURL(process.argv[1]).href) { should.run(); } diff --git a/test/utils.test.js b/test/utils.test.js index c2723c2..c1d3464 100644 --- a/test/utils.test.js +++ b/test/utils.test.js @@ -231,7 +231,7 @@ should('combinations', () => { }); // ESM is broken. -import url from 'url'; +import url from 'node:url'; if (import.meta.url === url.pathToFileURL(process.argv[1]).href) { should.run(); } diff --git a/test/utxo-select.test.js b/test/utxo-select.test.js index af25677..c0ebc8c 100644 --- a/test/utxo-select.test.js +++ b/test/utxo-select.test.js @@ -1191,7 +1191,7 @@ describe('UTXO Select', () => { }); // ESM is broken. -import url from 'url'; +import url from 'node:url'; if (import.meta.url === url.pathToFileURL(process.argv[1]).href) { should.run(); }