diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 32d6138..555f072 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -31,3 +31,11 @@ jobs: run: make build test clippy fmt - name: git diff run: git diff --exit-code + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + - name: Install pnpm + run: npm install -g pnpm + - name: run ccc-tests + run: cd ccc-tests && pnpm install && make all diff --git a/ccc-tests/.gitignore b/ccc-tests/.gitignore new file mode 100644 index 0000000..f375821 --- /dev/null +++ b/ccc-tests/.gitignore @@ -0,0 +1,2 @@ +dist +test-vectors diff --git a/ccc-tests/Makefile b/ccc-tests/Makefile new file mode 100644 index 0000000..1996ec7 --- /dev/null +++ b/ccc-tests/Makefile @@ -0,0 +1,15 @@ + + +all: test-vectors + pnpm build + pnpm start + +test-vectors: + mkdir -p test-vectors + cd .. && ./target/release/native-test-vector-generator --output ./ccc-tests/test-vectors + +clean: + pnpm clean + rm -rf test-vectors + +.PHONY: all diff --git a/ccc-tests/README.md b/ccc-tests/README.md new file mode 100644 index 0000000..650968e --- /dev/null +++ b/ccc-tests/README.md @@ -0,0 +1,22 @@ +# Integration Tests with CKB CCC + +This repository contains integration tests for the CKB [CCC](https://github.com/ckb-devrel/ccc) library. + +## Prerequisites + +- Make sure you have `pnpm` installed + +## Building and Running Tests + +1. Build the project at root folder: +```bash +make build +``` + +2. Run tests +```bash +cd ccc-tests +pnpm install +make all +``` + diff --git a/ccc-tests/ckb-ccc-core-1.8.0.tgz b/ccc-tests/ckb-ccc-core-1.8.0.tgz new file mode 100644 index 0000000..18f3c0b Binary files /dev/null and b/ccc-tests/ckb-ccc-core-1.8.0.tgz differ diff --git a/ccc-tests/package.json b/ccc-tests/package.json new file mode 100644 index 0000000..3fd9851 --- /dev/null +++ b/ccc-tests/package.json @@ -0,0 +1,21 @@ +{ + "name": "ccc-tests", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "start": "node dist/index.js", + "build": "tsc", + "clean": "rm -rf dist", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "packageManager": "pnpm@10.8.1", + "dependencies": { + "@ckb-ccc/core": "file:ckb-ccc-core-1.8.0.tgz", + "ckb-testtool": "^0.1.4", + "typescript": "^5.8.3" + } +} diff --git a/ccc-tests/pnpm-lock.yaml b/ccc-tests/pnpm-lock.yaml new file mode 100644 index 0000000..6f68b54 --- /dev/null +++ b/ccc-tests/pnpm-lock.yaml @@ -0,0 +1,666 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@ckb-ccc/core': + specifier: file:ckb-ccc-core-1.8.0.tgz + version: file:ckb-ccc-core-1.8.0.tgz(typescript@5.8.3) + ckb-testtool: + specifier: ^0.1.4 + version: 0.1.4(typescript@5.8.3) + typescript: + specifier: ^5.8.3 + version: 5.8.3 + +packages: + + '@adraffy/ens-normalize@1.10.1': + resolution: {integrity: sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==} + + '@ckb-ccc/core@1.8.0': + resolution: {integrity: sha512-P6DGpyt7gYUSg+LUueNdSqPxueLMEisknJFa9XKhD/N3bT9Nmcy4YmOlZ1WoNsFxue26IzRz7uWCLh2YeQ4tBA==} + + '@ckb-ccc/core@file:ckb-ccc-core-1.8.0.tgz': + resolution: {integrity: sha512-9yiMrZ2rTKI7kigxfHilf1qzDa/ZvmFPhZQqSNqjLaNX8b+ADNj1YxZ4jVhbPeUAm+rY8sS7OHb2MrkyQkZ+1Q==, tarball: file:ckb-ccc-core-1.8.0.tgz} + version: 1.8.0 + + '@joyid/ckb@1.1.2': + resolution: {integrity: sha512-+e+ISF566zaKNhKNSSS5kBw8or4Kb5Xqxe/2jVkUXKkqVHSS02Trrqe0g4IjSyeN9bszzolr1XgStv2hz62tqA==} + + '@joyid/common@0.2.1': + resolution: {integrity: sha512-DjA+Cy0koTCmPzhkhHkPc0icRLE78ktZY46rXHXfkSqxwQIJ/ED/whPoeF5tkTrN+teIC/hfzVRVkEE4zh/ASQ==} + + '@nervosnetwork/ckb-sdk-utils@0.109.5': + resolution: {integrity: sha512-Tx642hcJWbN8W3KzCIhIo49yzJ8LMqWopQCSBDKuRmwHesO/bvJqYojCVwfrOyROtFOPhgjyiGm5RXBuxm0KpQ==} + + '@nervosnetwork/ckb-types@0.109.5': + resolution: {integrity: sha512-5jQNjFw76YCd+Ppl+0RvBWzxwvWaKfWC5wjVFFdNAieX7xksCHfZFIeow8je7AF8uVypwe56WlLBlblxw9NBBQ==} + + '@noble/ciphers@0.5.3': + resolution: {integrity: sha512-B0+6IIHiqEs3BPMT0hcRmHvEj2QHOLu+uwt+tqDDeVd0oyVzh7BPrDcPjRnV1PV/5LaknXJJQvOuRGR0zQJz+w==} + + '@noble/curves@1.2.0': + resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} + + '@noble/curves@1.9.0': + resolution: {integrity: sha512-7YDlXiNMdO1YZeH6t/kvopHHbIZzlxrCV9WLqCY6QhcXOoXiNCMDqJIglZ9Yjx5+w7Dz30TITFrlTjnRg7sKEg==} + engines: {node: ^14.21.3 || >=16} + + '@noble/hashes@1.3.2': + resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} + engines: {node: '>= 16'} + + '@noble/hashes@1.8.0': + resolution: {integrity: sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==} + engines: {node: ^14.21.3 || >=16} + + '@types/node@22.7.5': + resolution: {integrity: sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==} + + abitype@0.8.7: + resolution: {integrity: sha512-wQ7hV8Yg/yKmGyFpqrNZufCxbszDe5es4AZGYPBitocfSqXtjrTG9JMWFcc4N30ukl2ve48aBTwt7NJxVQdU3w==} + peerDependencies: + typescript: '>=5.0.4' + zod: ^3 >=3.19.1 + peerDependenciesMeta: + zod: + optional: true + + abort-controller@3.0.0: + resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} + engines: {node: '>=6.5'} + + aes-js@4.0.0-beta.5: + resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} + + base-x@3.0.11: + resolution: {integrity: sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==} + + base-x@5.0.1: + resolution: {integrity: sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==} + + base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + + bech32@1.1.4: + resolution: {integrity: sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==} + + bech32@2.0.0: + resolution: {integrity: sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==} + + bindings@1.5.0: + resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} + + bip66@1.1.5: + resolution: {integrity: sha512-nemMHz95EmS38a26XbbdxIYj5csHd3RMP3H5bwQknX0WYHF01qhpufP42mLOwVICuH2JmhIhXiWs89MfUGL7Xw==} + + bitcoinjs-message@2.2.0: + resolution: {integrity: sha512-103Wy3xg8Y9o+pdhGP4M3/mtQQuUWs6sPuOp1mYphSUoSMHjHTlkj32K4zxU8qMH0Ckv23emfkGlFWtoWZ7YFA==} + engines: {node: '>=0.10'} + + bn.js@4.12.2: + resolution: {integrity: sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==} + + brorand@1.1.0: + resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} + + browserify-aes@1.2.0: + resolution: {integrity: sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==} + + bs58@4.0.1: + resolution: {integrity: sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==} + + bs58@6.0.0: + resolution: {integrity: sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==} + + bs58check@2.1.2: + resolution: {integrity: sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==} + + bs58check@4.0.0: + resolution: {integrity: sha512-FsGDOnFg9aVI9erdriULkd/JjEWONV/lQE5aYziB5PoBsXRind56lh8doIZIc9X4HoxT5x4bLjMWN1/NB8Zp5g==} + + buffer-equals@1.0.4: + resolution: {integrity: sha512-99MsCq0j5+RhubVEtKQgKaD6EM+UP3xJgIvQqwJ3SOLDUekzxMX1ylXBng+Wa2sh7mGT0W6RUly8ojjr1Tt6nA==} + engines: {node: '>=0.10.0'} + + buffer-xor@1.0.3: + resolution: {integrity: sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==} + + buffer@6.0.3: + resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + + cipher-base@1.0.6: + resolution: {integrity: sha512-3Ek9H3X6pj5TgenXYtNWdaBon1tgYCaebd+XPg0keyjEbEfkD4KkmAxkQ/i1vYvxdcT5nscLBfq9VJRmCBcFSw==} + engines: {node: '>= 0.10'} + + ckb-testtool@0.1.4: + resolution: {integrity: sha512-ifIzGqhRUHdV5raHZVWLrDY5Hlt8ue2Gtn3R52xqblKSh4D2K89g4OXQTDBqkDAztuL4gBp6sZYW0pgRMeN2Nw==} + + create-hash@1.2.0: + resolution: {integrity: sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==} + + create-hmac@1.1.7: + resolution: {integrity: sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==} + + cross-fetch@4.0.0: + resolution: {integrity: sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==} + + cross-fetch@4.1.0: + resolution: {integrity: sha512-uKm5PU+MHTootlWEY+mZ4vvXoCn4fLQxT9dSc1sXVMSFkINTJVN8cAQROpwcKm8bJ/c7rgZVIBWzH5T78sNZZw==} + + drbg.js@1.0.1: + resolution: {integrity: sha512-F4wZ06PvqxYLFEZKkFxTDcns9oFNk34hvmJSEwdzsxVQ8YI5YaxtACgQatkYgv2VI2CFkUd2Y+xosPQnHv809g==} + engines: {node: '>=0.10'} + + elliptic@6.6.1: + resolution: {integrity: sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==} + + ethers@6.14.0: + resolution: {integrity: sha512-KgHwltNSMdbrGWEyKkM0Rt2s+u1nDH/5BVDQakLinzGEJi4bWindBzZSCC4gKsbZjwDTI6ex/8suR9Ihbmz4IQ==} + engines: {node: '>=14.0.0'} + + event-target-shim@5.0.1: + resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} + engines: {node: '>=6'} + + evp_bytestokey@1.0.3: + resolution: {integrity: sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==} + + file-uri-to-path@1.0.0: + resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} + + hash-base@3.1.0: + resolution: {integrity: sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==} + engines: {node: '>=4'} + + hash.js@1.1.7: + resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} + + hmac-drbg@1.0.1: + resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} + + ieee754@1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + isomorphic-ws@5.0.0: + resolution: {integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==} + peerDependencies: + ws: '*' + + jsbi@3.1.3: + resolution: {integrity: sha512-nBJqA0C6Qns+ZxurbEoIR56wyjiUszpNy70FHvxO5ervMoCbZVE3z3kxr5nKGhlxr/9MhKTSUBs7cAwwuf3g9w==} + + md5.js@1.3.5: + resolution: {integrity: sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==} + + minimalistic-assert@1.0.1: + resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} + + minimalistic-crypto-utils@1.0.1: + resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} + + nan@2.22.2: + resolution: {integrity: sha512-DANghxFkS1plDdRsX0X9pm0Z6SJNN6gBdtXfanwoZ8hooC5gosGFSBGRYHUVPz1asKA/kMRqDRdHrluZ61SpBQ==} + + node-fetch@2.7.0: + resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + + readable-stream@3.6.2: + resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} + engines: {node: '>= 6'} + + ripemd160@2.0.2: + resolution: {integrity: sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==} + + safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + + secp256k1@3.8.1: + resolution: {integrity: sha512-tArjQw2P0RTdY7QmkNehgp6TVvQXq6ulIhxv8gaH6YubKG/wxxAoNKcbuXjDhybbc+b2Ihc7e0xxiGN744UIiQ==} + engines: {node: '>=4.0.0'} + + sha.js@2.4.11: + resolution: {integrity: sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==} + hasBin: true + + string_decoder@1.3.0: + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + + tr46@0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + + tslib@2.3.1: + resolution: {integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==} + + tslib@2.7.0: + resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} + + type-fest@4.6.0: + resolution: {integrity: sha512-rLjWJzQFOq4xw7MgJrCZ6T1jIOvvYElXT12r+y0CC6u67hegDHaxcPqb2fZHOGlqxugGQPNB1EnTezjBetkwkw==} + engines: {node: '>=16'} + + typescript@5.8.3: + resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} + engines: {node: '>=14.17'} + hasBin: true + + uncrypto@0.1.3: + resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} + + undici-types@6.19.8: + resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + + util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + + varuint-bitcoin@1.1.2: + resolution: {integrity: sha512-4EVb+w4rx+YfVM32HQX42AbbT7/1f5zwAYhIujKXKk8NQK+JfRVl3pqT3hjNn/L+RstigmGGKVwHA/P0wgITZw==} + + webidl-conversions@3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + + whatwg-url@5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + + ws@8.17.1: + resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + ws@8.18.2: + resolution: {integrity: sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + +snapshots: + + '@adraffy/ens-normalize@1.10.1': {} + + '@ckb-ccc/core@1.8.0(typescript@5.8.3)': + dependencies: + '@joyid/ckb': 1.1.2(typescript@5.8.3) + '@noble/ciphers': 0.5.3 + '@noble/curves': 1.9.0 + '@noble/hashes': 1.8.0 + abort-controller: 3.0.0 + bech32: 2.0.0 + bitcoinjs-message: 2.2.0 + bs58check: 4.0.0 + buffer: 6.0.3 + cross-fetch: 4.1.0 + ethers: 6.14.0 + isomorphic-ws: 5.0.0(ws@8.18.2) + ws: 8.18.2 + transitivePeerDependencies: + - bufferutil + - encoding + - typescript + - utf-8-validate + - zod + + '@ckb-ccc/core@file:ckb-ccc-core-1.8.0.tgz(typescript@5.8.3)': + dependencies: + '@joyid/ckb': 1.1.2(typescript@5.8.3) + '@noble/ciphers': 0.5.3 + '@noble/curves': 1.9.0 + '@noble/hashes': 1.8.0 + abort-controller: 3.0.0 + bech32: 2.0.0 + bitcoinjs-message: 2.2.0 + bs58check: 4.0.0 + buffer: 6.0.3 + cross-fetch: 4.1.0 + ethers: 6.14.0 + isomorphic-ws: 5.0.0(ws@8.18.2) + ws: 8.18.2 + transitivePeerDependencies: + - bufferutil + - encoding + - typescript + - utf-8-validate + - zod + + '@joyid/ckb@1.1.2(typescript@5.8.3)': + dependencies: + '@joyid/common': 0.2.1(typescript@5.8.3) + '@nervosnetwork/ckb-sdk-utils': 0.109.5 + cross-fetch: 4.0.0 + uncrypto: 0.1.3 + transitivePeerDependencies: + - encoding + - typescript + - zod + + '@joyid/common@0.2.1(typescript@5.8.3)': + dependencies: + abitype: 0.8.7(typescript@5.8.3) + type-fest: 4.6.0 + transitivePeerDependencies: + - typescript + - zod + + '@nervosnetwork/ckb-sdk-utils@0.109.5': + dependencies: + '@nervosnetwork/ckb-types': 0.109.5 + bech32: 2.0.0 + elliptic: 6.6.1 + jsbi: 3.1.3 + tslib: 2.3.1 + + '@nervosnetwork/ckb-types@0.109.5': {} + + '@noble/ciphers@0.5.3': {} + + '@noble/curves@1.2.0': + dependencies: + '@noble/hashes': 1.3.2 + + '@noble/curves@1.9.0': + dependencies: + '@noble/hashes': 1.8.0 + + '@noble/hashes@1.3.2': {} + + '@noble/hashes@1.8.0': {} + + '@types/node@22.7.5': + dependencies: + undici-types: 6.19.8 + + abitype@0.8.7(typescript@5.8.3): + dependencies: + typescript: 5.8.3 + + abort-controller@3.0.0: + dependencies: + event-target-shim: 5.0.1 + + aes-js@4.0.0-beta.5: {} + + base-x@3.0.11: + dependencies: + safe-buffer: 5.2.1 + + base-x@5.0.1: {} + + base64-js@1.5.1: {} + + bech32@1.1.4: {} + + bech32@2.0.0: {} + + bindings@1.5.0: + dependencies: + file-uri-to-path: 1.0.0 + + bip66@1.1.5: + dependencies: + safe-buffer: 5.2.1 + + bitcoinjs-message@2.2.0: + dependencies: + bech32: 1.1.4 + bs58check: 2.1.2 + buffer-equals: 1.0.4 + create-hash: 1.2.0 + secp256k1: 3.8.1 + varuint-bitcoin: 1.1.2 + + bn.js@4.12.2: {} + + brorand@1.1.0: {} + + browserify-aes@1.2.0: + dependencies: + buffer-xor: 1.0.3 + cipher-base: 1.0.6 + create-hash: 1.2.0 + evp_bytestokey: 1.0.3 + inherits: 2.0.4 + safe-buffer: 5.2.1 + + bs58@4.0.1: + dependencies: + base-x: 3.0.11 + + bs58@6.0.0: + dependencies: + base-x: 5.0.1 + + bs58check@2.1.2: + dependencies: + bs58: 4.0.1 + create-hash: 1.2.0 + safe-buffer: 5.2.1 + + bs58check@4.0.0: + dependencies: + '@noble/hashes': 1.8.0 + bs58: 6.0.0 + + buffer-equals@1.0.4: {} + + buffer-xor@1.0.3: {} + + buffer@6.0.3: + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + + cipher-base@1.0.6: + dependencies: + inherits: 2.0.4 + safe-buffer: 5.2.1 + + ckb-testtool@0.1.4(typescript@5.8.3): + dependencies: + '@ckb-ccc/core': 1.8.0(typescript@5.8.3) + transitivePeerDependencies: + - bufferutil + - encoding + - typescript + - utf-8-validate + - zod + + create-hash@1.2.0: + dependencies: + cipher-base: 1.0.6 + inherits: 2.0.4 + md5.js: 1.3.5 + ripemd160: 2.0.2 + sha.js: 2.4.11 + + create-hmac@1.1.7: + dependencies: + cipher-base: 1.0.6 + create-hash: 1.2.0 + inherits: 2.0.4 + ripemd160: 2.0.2 + safe-buffer: 5.2.1 + sha.js: 2.4.11 + + cross-fetch@4.0.0: + dependencies: + node-fetch: 2.7.0 + transitivePeerDependencies: + - encoding + + cross-fetch@4.1.0: + dependencies: + node-fetch: 2.7.0 + transitivePeerDependencies: + - encoding + + drbg.js@1.0.1: + dependencies: + browserify-aes: 1.2.0 + create-hash: 1.2.0 + create-hmac: 1.1.7 + + elliptic@6.6.1: + dependencies: + bn.js: 4.12.2 + brorand: 1.1.0 + hash.js: 1.1.7 + hmac-drbg: 1.0.1 + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + + ethers@6.14.0: + dependencies: + '@adraffy/ens-normalize': 1.10.1 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@types/node': 22.7.5 + aes-js: 4.0.0-beta.5 + tslib: 2.7.0 + ws: 8.17.1 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + event-target-shim@5.0.1: {} + + evp_bytestokey@1.0.3: + dependencies: + md5.js: 1.3.5 + safe-buffer: 5.2.1 + + file-uri-to-path@1.0.0: {} + + hash-base@3.1.0: + dependencies: + inherits: 2.0.4 + readable-stream: 3.6.2 + safe-buffer: 5.2.1 + + hash.js@1.1.7: + dependencies: + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + + hmac-drbg@1.0.1: + dependencies: + hash.js: 1.1.7 + minimalistic-assert: 1.0.1 + minimalistic-crypto-utils: 1.0.1 + + ieee754@1.2.1: {} + + inherits@2.0.4: {} + + isomorphic-ws@5.0.0(ws@8.18.2): + dependencies: + ws: 8.18.2 + + jsbi@3.1.3: {} + + md5.js@1.3.5: + dependencies: + hash-base: 3.1.0 + inherits: 2.0.4 + safe-buffer: 5.2.1 + + minimalistic-assert@1.0.1: {} + + minimalistic-crypto-utils@1.0.1: {} + + nan@2.22.2: {} + + node-fetch@2.7.0: + dependencies: + whatwg-url: 5.0.0 + + readable-stream@3.6.2: + dependencies: + inherits: 2.0.4 + string_decoder: 1.3.0 + util-deprecate: 1.0.2 + + ripemd160@2.0.2: + dependencies: + hash-base: 3.1.0 + inherits: 2.0.4 + + safe-buffer@5.2.1: {} + + secp256k1@3.8.1: + dependencies: + bindings: 1.5.0 + bip66: 1.1.5 + bn.js: 4.12.2 + create-hash: 1.2.0 + drbg.js: 1.0.1 + elliptic: 6.6.1 + nan: 2.22.2 + safe-buffer: 5.2.1 + + sha.js@2.4.11: + dependencies: + inherits: 2.0.4 + safe-buffer: 5.2.1 + + string_decoder@1.3.0: + dependencies: + safe-buffer: 5.2.1 + + tr46@0.0.3: {} + + tslib@2.3.1: {} + + tslib@2.7.0: {} + + type-fest@4.6.0: {} + + typescript@5.8.3: {} + + uncrypto@0.1.3: {} + + undici-types@6.19.8: {} + + util-deprecate@1.0.2: {} + + varuint-bitcoin@1.1.2: + dependencies: + safe-buffer: 5.2.1 + + webidl-conversions@3.0.1: {} + + whatwg-url@5.0.0: + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + + ws@8.17.1: {} + + ws@8.18.2: {} diff --git a/ccc-tests/src/client.ts b/ccc-tests/src/client.ts new file mode 100644 index 0000000..e430814 --- /dev/null +++ b/ccc-tests/src/client.ts @@ -0,0 +1,355 @@ +import { + Cell, + CellDep, + CellDepInfoLike, + Client, + ClientBlock, + ClientBlockHeader, + ClientFindCellsResponse, + ClientFindTransactionsGroupedResponse, + ClientFindTransactionsResponse, + ClientIndexerSearchKeyLike, + ClientIndexerSearchKeyTransactionLike, + ClientTransactionResponse, + Hex, + HexLike, + KnownScript, + Num, + NumLike, + OutPoint, + OutPointLike, + OutputsValidator, + ScriptInfo, + ScriptLike, + TransactionLike, +} from "@ckb-ccc/core"; + +import { + ClientCollectableSearchKeyLike, +} from "@ckb-ccc/core/advanced"; + +export class MockClient extends Client { + constructor(public cells: Map) { + super(); + } + + get url(): string { + return ""; + } + + get addressPrefix(): string { + return ""; + } + + getKnownScript(_script: KnownScript): Promise { + return Promise.reject(new Error("Not implemented")); + } + + getFeeRateStatistics( + _blockRange?: NumLike, + ): Promise<{ mean: Num; median: Num }> { + return Promise.reject(new Error("Not implemented")); + } + + getFeeRate( + _blockRange?: NumLike, + _options?: { maxFeeRate?: NumLike }, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + getTip(): Promise { + return Promise.reject(new Error("Not implemented")); + } + + getTipHeader(_verbosity?: number | null): Promise { + return Promise.reject(new Error("Not implemented")); + } + + getBlockByNumberNoCache( + _blockNumber: NumLike, + _verbosity?: number | null, + _withCycles?: boolean | null, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + getBlockByHashNoCache( + _blockHash: HexLike, + _verbosity?: number | null, + _withCycles?: boolean | null, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + getHeaderByNumberNoCache( + _blockNumber: NumLike, + _verbosity?: number | null, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + getHeaderByHashNoCache( + _blockHash: HexLike, + _verbosity?: number | null, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + getBlockByNumber( + _blockNumber: NumLike, + _verbosity?: number | null, + _withCycles?: boolean | null, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + getBlockByHash( + _blockHash: HexLike, + _verbosity?: number | null, + _withCycles?: boolean | null, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + getHeaderByNumber( + _blockNumber: NumLike, + _verbosity?: number | null, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + getHeaderByHash( + _blockHash: HexLike, + _verbosity?: number | null, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + estimateCycles(_transaction: TransactionLike): Promise { + return Promise.reject(new Error("Not implemented")); + } + + sendTransactionDry( + _transaction: TransactionLike, + _validator?: OutputsValidator, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + sendTransactionNoCache( + _transaction: TransactionLike, + _validator?: OutputsValidator, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + getTransactionNoCache( + _txHash: HexLike, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + async getCell(outPointLike: OutPointLike): Promise { + let bytes = OutPoint.from(outPointLike).toBytes(); + const cell = this.cells.get(bytes.toString()); + if (!cell) { + return; + } + return cell; + } + + getCellLiveNoCache( + _outPointLike: OutPointLike, + _withData?: boolean | null, + _includeTxPool?: boolean | null, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + getCellLive( + _outPointLike: OutPointLike, + _withData?: boolean | null, + _includeTxPool?: boolean | null, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + findCellsPagedNoCache( + _key: ClientIndexerSearchKeyLike, + _order?: "asc" | "desc", + _limit?: NumLike, + _after?: string, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + async findCellsPaged( + _key: ClientIndexerSearchKeyLike, + _order?: "asc" | "desc", + _limit?: NumLike, + _after?: string, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + findCellsOnChain( + _key: ClientIndexerSearchKeyLike, + _order?: "asc" | "desc", + _limit = 10, + ): AsyncGenerator { + throw new Error("Not implemented"); + } + + findCells( + _keyLike: ClientCollectableSearchKeyLike, + _order?: "asc" | "desc", + _limit = 10, + ): AsyncGenerator { + throw new Error("Not implemented"); + } + + findCellsByLock( + _lock: ScriptLike, + _type?: ScriptLike | null, + _withData = true, + _order?: "asc" | "desc", + _limit = 10, + ): AsyncGenerator { + throw new Error("Not implemented"); + } + + findCellsByType( + _type: ScriptLike, + _withData = true, + _order?: "asc" | "desc", + _limit = 10, + ): AsyncGenerator { + throw new Error("Not implemented"); + } + + async findSingletonCellByType( + _type: ScriptLike, + _withData = false, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + async getCellDeps( + ..._cellDepsInfoLike: (CellDepInfoLike | CellDepInfoLike[])[] + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + findTransactionsPaged( + key: Omit & { + groupByTransaction: true; + }, + order?: "asc" | "desc", + limit?: NumLike, + after?: string, + ): Promise; + findTransactionsPaged( + key: Omit & { + groupByTransaction?: false | null; + }, + order?: "asc" | "desc", + limit?: NumLike, + after?: string, + ): Promise; + findTransactionsPaged( + _key: ClientIndexerSearchKeyTransactionLike, + _order?: "asc" | "desc", + _limit?: NumLike, + _after?: string, + ): Promise< + ClientFindTransactionsResponse | ClientFindTransactionsGroupedResponse + > { + return Promise.reject(new Error("Not implemented")); + } + + getCellsCapacity(_key: ClientIndexerSearchKeyLike): Promise { + return Promise.reject(new Error("Not implemented")); + } + + async getBalanceSingle(_lock: ScriptLike): Promise { + return Promise.reject(new Error("Not implemented")); + } + + async getBalance(_locks: ScriptLike[]): Promise { + return Promise.reject(new Error("Not implemented")); + } + + async sendTransaction( + _transaction: TransactionLike, + _validator?: OutputsValidator, + _options?: { maxFeeRate?: NumLike }, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + async getTransaction( + _txHashLike: HexLike, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + async waitTransaction( + _txHash: HexLike, + _confirmations: number = 0, + _timeout: number = 60000, + _interval: number = 2000, + ): Promise { + return Promise.reject(new Error("Not implemented")); + } + + findTransactionsByLock( + lock: ScriptLike, + type: ScriptLike | null | undefined, + groupByTransaction: true, + order?: "asc" | "desc", + limit?: number, + ): AsyncGenerator; + findTransactionsByLock( + lock: ScriptLike, + type?: ScriptLike | null, + groupByTransaction?: false | null, + order?: "asc" | "desc", + limit?: number, + ): AsyncGenerator; + findTransactionsByLock( + _lock: ScriptLike, + _type?: ScriptLike | null, + _groupByTransaction?: boolean | null, + _order?: "asc" | "desc", + _limit = 10, + ): AsyncGenerator< + | ClientFindTransactionsResponse["transactions"][0] + | ClientFindTransactionsGroupedResponse["transactions"][0] + > { + throw new Error("Not implemented"); + } + + findTransactionsByType( + type: ScriptLike, + groupByTransaction: true, + order?: "asc" | "desc", + limit?: number, + ): AsyncGenerator; + findTransactionsByType( + type: ScriptLike, + groupByTransaction?: false | null, + order?: "asc" | "desc", + limit?: number, + ): AsyncGenerator; + findTransactionsByType( + _type: ScriptLike, + _groupByTransaction?: boolean | null, + _order?: "asc" | "desc", + _limit = 10, + ): AsyncGenerator< + | ClientFindTransactionsResponse["transactions"][0] + | ClientFindTransactionsGroupedResponse["transactions"][0] + > { + throw new Error("Not implemented"); + } +} diff --git a/ccc-tests/src/index.ts b/ccc-tests/src/index.ts new file mode 100644 index 0000000..78a2d55 --- /dev/null +++ b/ccc-tests/src/index.ts @@ -0,0 +1,12 @@ +import { TestVector } from "./test-vectors"; + +async function main() { + const testVectors = TestVector.getAllFromDirectory("./test-vectors"); + for (let testVector of testVectors) { + console.log(`Test vector: ${testVector.name}`); + await testVector.run(); + console.log("Passed"); + } +} + +main(); \ No newline at end of file diff --git a/ccc-tests/src/test-vectors.ts b/ccc-tests/src/test-vectors.ts new file mode 100644 index 0000000..b88996b --- /dev/null +++ b/ccc-tests/src/test-vectors.ts @@ -0,0 +1,87 @@ +import { Cell, Hex, OutPoint, Transaction } from "@ckb-ccc/core"; +import { JsonRpcTransformers } from "@ckb-ccc/core/advanced"; +import { TxFile } from "ckb-testtool"; +import * as fs from 'fs'; +import * as path from 'path'; +import { MockClient } from "./client"; + +export class TestVector { + constructor( + public name: string, + public tx: TxFile, + public hash: Hex | null, + public indices: number[], + public invalidCase: boolean, + ) { } + + static fromFiles(name: string, basePath: string): TestVector { + const jsonPath = path.join(basePath, `${name}.json`); + const hashPath = path.join(basePath, `${name}.hash`); + const indicesPath = path.join(basePath, `${name}.indices`); + let hashHex: Hex | null = null; + if (!fs.existsSync(jsonPath)) { + throw new Error(`JSON file not found: ${jsonPath}`); + } + if (!fs.existsSync(indicesPath)) { + throw new Error(`Indices file not found: ${indicesPath}`); + } + if (!fs.existsSync(hashPath)) { + hashHex = null; + } else { + hashHex = ("0x" + fs.readFileSync(hashPath, 'utf8').trim()) as Hex; + } + const txJson = fs.readFileSync(jsonPath, 'utf8'); + const indicesJson = fs.readFileSync(indicesPath, 'utf8'); + + try { + const tx = JSON.parse(txJson) as TxFile; + const indices = JSON.parse(indicesJson) as number[]; + + return new TestVector(name, tx, hashHex, indices, name.startsWith('invalid-')); + } catch (error) { + throw new Error(`Failed to parse JSON for test vector ${name}: ${error}`); + } + } + + static getAllFromDirectory(dirPath: string): TestVector[] { + if (!fs.existsSync(dirPath)) { + throw new Error(`Directory not found: ${dirPath}`); + } + const files = fs.readdirSync(dirPath); + const baseNames = new Set( + files.map((file: string) => path.parse(file).name) + ); + return Array.from(baseNames).map(baseName => + TestVector.fromFiles(baseName, dirPath) + ); + } + async run() { + let cells = new Map(); + for (let c of this.tx.mock_info.inputs) { + let outpoint = JsonRpcTransformers.outPointTo(c.input.previous_output); + let cell = new Cell(outpoint, JsonRpcTransformers.cellOutputTo(c.output), c.data); + let bytes = OutPoint.from(outpoint).toBytes(); + cells.set(bytes.toString(), cell); + } + const client = new MockClient(cells); + const tx0 = JsonRpcTransformers.transactionTo(this.tx.tx); + const tx = Transaction.from(tx0); + let location = this.indices[0]; + let lockScript = this.tx.mock_info.inputs[location].output.lock; + + try { + let txMessageAll = await tx.getTxMessageAll(JsonRpcTransformers.scriptTo(lockScript), client); + if (!this.invalidCase && txMessageAll?.message !== this.hash) { + console.log(`txMessageAll: ${txMessageAll?.message}`); + console.log(`this.hash: ${this.hash}`); + throw new Error(`FAILED: ${this.name}`); + } + } catch (error) { + if (this.invalidCase) { + // ignore invalid case + } else { + throw error; + } + } + } +} diff --git a/ccc-tests/tsconfig.json b/ccc-tests/tsconfig.json new file mode 100644 index 0000000..7950977 --- /dev/null +++ b/ccc-tests/tsconfig.json @@ -0,0 +1,112 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "esnext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "libReplacement": true, /* Enable lib replacement. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "NodeNext", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "noUncheckedSideEffectImports": true, /* Check side effect imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + "outDir": "./dist", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ + // "erasableSyntaxOnly": true, /* Do not allow runtime constructs that are not part of ECMAScript. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +}