From 24cee7ce56c52b2781b29e5574cf71b8e9f42f59 Mon Sep 17 00:00:00 2001 From: Nathaniel Cook Date: Wed, 31 Jan 2024 09:52:14 -0700 Subject: [PATCH] fix: update event tests to generate car files (#90) Co-authored-by: Mohsin Zaidi <2236875+smrz2001@users.noreply.github.com> --- suite/package.json | 15 +- suite/pnpm-lock.yaml | 209 +++++++++++------- suite/src/__tests__/fast/events.test.ts | 12 +- suite/src/__tests__/fast/update.test.ts | 4 +- .../slow/ceramic-cas-integration.test.ts | 7 +- .../slow/ceramic-ceramic-integration.test.ts | 14 +- 6 files changed, 164 insertions(+), 97 deletions(-) diff --git a/suite/package.json b/suite/package.json index ea558c3e..62e75215 100644 --- a/suite/package.json +++ b/suite/package.json @@ -20,17 +20,19 @@ "@aws-sdk/client-api-gateway": "^3.427.0", "@aws-sdk/client-dynamodb": "^3.427.0", "@aws-sdk/client-lambda": "^3.427.0", - "@ceramicnetwork/common": "3.3.0", - "@ceramicnetwork/http-client": "3.3.0", - "@ceramicnetwork/stream-model": "2.3.0", - "@ceramicnetwork/stream-model-instance": "2.3.0", - "@ceramicnetwork/stream-tile": "3.3.0", - "@ceramicnetwork/streamid": "3.3.0", + "@ceramicnetwork/common": "4.0.0", + "@ceramicnetwork/http-client": "4.0.0", + "@ceramicnetwork/stream-model": "2.4.0", + "@ceramicnetwork/stream-model-instance": "2.4.0", + "@ceramicnetwork/stream-tile": "3.4.0", + "@ceramicnetwork/streamid": "3.4.0", "@composedb/devtools": "0.6.1", + "@ipld/dag-json": "^10.1.7", "@jest/globals": "^29.7.0", "@jest/reporters": "^29.7.0", "@stablelib/random": "^1.0.2", "axios": "^0.24.0", + "cartonne": "^3.0.1", "cross-fetch": "^4.0.0", "dids": "5.0.2", "dotenv": "^16.3.1", @@ -39,6 +41,7 @@ "key-did-resolver": "4.0.0", "luxon": "3.2.1", "multiformats": "^13.0.1", + "multihashes-sync": "^2.0.0", "node-jq": "^2.3.5", "rxjs": "^7.8.1", "ts-jest": "^29.1.1", diff --git a/suite/pnpm-lock.yaml b/suite/pnpm-lock.yaml index 48f90ac3..57888aa2 100644 --- a/suite/pnpm-lock.yaml +++ b/suite/pnpm-lock.yaml @@ -15,26 +15,29 @@ dependencies: specifier: ^3.427.0 version: 3.427.0 '@ceramicnetwork/common': - specifier: 3.3.0 - version: 3.3.0(typescript@4.9.5) + specifier: 4.0.0 + version: 4.0.0(typescript@4.9.5) '@ceramicnetwork/http-client': - specifier: 3.3.0 - version: 3.3.0(typescript@4.9.5) + specifier: 4.0.0 + version: 4.0.0(typescript@4.9.5) '@ceramicnetwork/stream-model': - specifier: 2.3.0 - version: 2.3.0(typescript@4.9.5) + specifier: 2.4.0 + version: 2.4.0(typescript@4.9.5) '@ceramicnetwork/stream-model-instance': - specifier: 2.3.0 - version: 2.3.0(typescript@4.9.5) + specifier: 2.4.0 + version: 2.4.0(typescript@4.9.5) '@ceramicnetwork/stream-tile': - specifier: 3.3.0 - version: 3.3.0(typescript@4.9.5) + specifier: 3.4.0 + version: 3.4.0(typescript@4.9.5) '@ceramicnetwork/streamid': - specifier: 3.3.0 - version: 3.3.0 + specifier: 3.4.0 + version: 3.4.0 '@composedb/devtools': specifier: 0.6.1 version: 0.6.1(graphql@16.8.1)(typescript@4.9.5) + '@ipld/dag-json': + specifier: ^10.1.7 + version: 10.1.7 '@jest/globals': specifier: ^29.7.0 version: 29.7.0 @@ -47,6 +50,9 @@ dependencies: axios: specifier: ^0.24.0 version: 0.24.0 + cartonne: + specifier: ^3.0.1 + version: 3.0.1 cross-fetch: specifier: ^4.0.0 version: 4.0.0 @@ -71,6 +77,9 @@ dependencies: multiformats: specifier: ^13.0.1 version: 13.0.1 + multihashes-sync: + specifier: ^2.0.0 + version: 2.0.0 node-jq: specifier: ^2.3.5 version: 2.3.5 @@ -79,7 +88,7 @@ dependencies: version: 7.8.1 ts-jest: specifier: ^29.1.1 - version: 29.1.1(@babel/core@7.23.0)(jest@29.7.0)(typescript@4.9.5) + version: 29.1.1(@babel/core@7.19.1)(jest@29.7.0)(typescript@4.9.5) typescript: specifier: ^4.9.5 version: 4.9.5 @@ -1166,10 +1175,10 @@ packages: /@bcoe/v8-coverage@0.2.3: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} - /@ceramicnetwork/codecs@2.3.0: - resolution: {integrity: sha512-lNGWuPUC1Iw52YBnZyicpcNxIJLo108DC/ftLHm25DBo8b+XhtDdKDUg9j+e+Q8WJj+P0y1X6jXesqyCo6/aXw==} + /@ceramicnetwork/codecs@2.4.0: + resolution: {integrity: sha512-TA80kD+cYyM4J11x2dwwg+ZgyxJ7OH4eOZSwjpMjjJTUjEBpjGcBfktSIvsYXk2mB7UWKIufRbIIO87obAQ/RQ==} dependencies: - '@ceramicnetwork/streamid': 3.3.0 + '@ceramicnetwork/streamid': 3.4.0 cartonne: 3.0.1 codeco: 1.2.0 dag-jose: 4.0.0 @@ -1180,8 +1189,8 @@ packages: /@ceramicnetwork/common@3.3.0(typescript@4.9.5): resolution: {integrity: sha512-lr66KUZIv/M825B7tfmycS49WnpIQQVlzaR5/oRZb4Jsb1gjCX9pJRJAW8mCgMJ1VIxSVoMp4nNd3cwVwk5GMQ==} dependencies: - '@ceramicnetwork/codecs': 2.3.0 - '@ceramicnetwork/streamid': 3.3.0 + '@ceramicnetwork/codecs': 2.4.0 + '@ceramicnetwork/streamid': 3.4.0 '@didtools/cacao': 3.0.1(typescript@4.9.5) '@didtools/pkh-ethereum': 0.2.1 '@didtools/pkh-solana': 0.2.0(typescript@4.9.5) @@ -1205,15 +1214,43 @@ packages: - zod dev: false - /@ceramicnetwork/http-client@3.3.0(typescript@4.9.5): - resolution: {integrity: sha512-8Ju/TXaCy3xchUtMbb4Xyp1WaJXEInO6t8F8WdHy/PX9S4lAHOj9kB2erLVKWGwhpzyvS92pK7noIPu8ZJ/Bug==} + /@ceramicnetwork/common@4.0.0(typescript@4.9.5): + resolution: {integrity: sha512-2CuwQ/PY15oz9cft/zKmGHWQumUi/gwndJ7K1SXMHqGyjvkuTnRRYh4p0Oyl7124aK76XTS0v0orUz1o/UUMtQ==} dependencies: - '@ceramicnetwork/common': 3.3.0(typescript@4.9.5) - '@ceramicnetwork/stream-caip10-link': 3.3.0(typescript@4.9.5) - '@ceramicnetwork/stream-model': 2.3.0(typescript@4.9.5) - '@ceramicnetwork/stream-model-instance': 2.3.0(typescript@4.9.5) - '@ceramicnetwork/stream-tile': 3.3.0(typescript@4.9.5) - '@ceramicnetwork/streamid': 3.3.0 + '@ceramicnetwork/codecs': 2.4.0 + '@ceramicnetwork/streamid': 3.4.0 + '@didtools/cacao': 3.0.1(typescript@4.9.5) + '@didtools/pkh-ethereum': 0.2.1 + '@didtools/pkh-solana': 0.2.0(typescript@4.9.5) + '@didtools/pkh-stacks': 0.2.0(typescript@4.9.5) + '@didtools/pkh-tezos': 0.3.0(typescript@4.9.5) + '@stablelib/random': 1.0.2 + caip: 1.1.0 + flat: 5.0.2 + it-first: 3.0.4 + jet-logger: 1.2.2 + lodash.clonedeep: 4.5.0 + logfmt: 1.4.0 + multiformats: 13.0.1 + rxjs: 7.8.1 + uint8arrays: 5.0.1 + transitivePeerDependencies: + - bufferutil + - encoding + - typescript + - utf-8-validate + - zod + dev: false + + /@ceramicnetwork/http-client@4.0.0(typescript@4.9.5): + resolution: {integrity: sha512-EQlw9O8xbasGn7LCA3yml3RuFqwqqjVShBqvnHGXkHhtSKwAVT0o74QhAfol1Pd5nErGuIAzVC+wCk8ay2oMtQ==} + dependencies: + '@ceramicnetwork/common': 4.0.0(typescript@4.9.5) + '@ceramicnetwork/stream-caip10-link': 3.4.0(typescript@4.9.5) + '@ceramicnetwork/stream-model': 2.4.0(typescript@4.9.5) + '@ceramicnetwork/stream-model-instance': 2.4.0(typescript@4.9.5) + '@ceramicnetwork/stream-tile': 3.4.0(typescript@4.9.5) + '@ceramicnetwork/streamid': 3.4.0 '@scarf/scarf': 1.3.0 query-string: 7.1.3 rxjs: 7.8.1 @@ -1225,11 +1262,11 @@ packages: - zod dev: false - /@ceramicnetwork/stream-caip10-link@3.3.0(typescript@4.9.5): - resolution: {integrity: sha512-DIVOQIBSD3heD/z7csfUVAd6OvYigRJneFebrfE5+agNmi9ObUKybyFeUpSEnvACV9W+mHKWTiVSMg6dEJlyTg==} + /@ceramicnetwork/stream-caip10-link@3.4.0(typescript@4.9.5): + resolution: {integrity: sha512-gqytoJL2+x8U8v2dl9l0xovhli4aB17qoOKTdkpl50pUTJJ6eN4PtFUUPdBvmNcT8NUmB6pot4bWgNy5MKMEBw==} dependencies: - '@ceramicnetwork/common': 3.3.0(typescript@4.9.5) - '@ceramicnetwork/streamid': 3.3.0 + '@ceramicnetwork/common': 4.0.0(typescript@4.9.5) + '@ceramicnetwork/streamid': 3.4.0 caip: 1.1.0 did-resolver: 4.1.0 lodash.clonedeep: 4.5.0 @@ -1241,11 +1278,11 @@ packages: - zod dev: false - /@ceramicnetwork/stream-model-instance@2.3.0(typescript@4.9.5): - resolution: {integrity: sha512-8N73DN6xPtkj3gnQ/e9UgU4HIegqA4tIL3rOhghpMcz4+YE9f2nT9M9h3xiOSOYPylxUdDlJgWKxvQJ2/x0Fpg==} + /@ceramicnetwork/stream-model-instance@2.4.0(typescript@4.9.5): + resolution: {integrity: sha512-RrQZbFsSuANC7wU3kXqJiyb7/5IeUiay9qMmsnWtFn1NntJme0dRzoG69f9nSBbgFpiuEddnX8EVpgxc+HJUzQ==} dependencies: - '@ceramicnetwork/common': 3.3.0(typescript@4.9.5) - '@ceramicnetwork/streamid': 3.3.0 + '@ceramicnetwork/common': 4.0.0(typescript@4.9.5) + '@ceramicnetwork/streamid': 3.4.0 '@ipld/dag-cbor': 7.0.3 '@stablelib/random': 1.0.2 fast-json-patch: 3.1.1 @@ -1259,12 +1296,12 @@ packages: - zod dev: false - /@ceramicnetwork/stream-model@2.3.0(typescript@4.9.5): - resolution: {integrity: sha512-OQxFBFbBVaUm+Hia2zcxigInTokgBtU4b2S5O5Vc0A/Xo66uoj99JYT50n1ZXL6vjPCuKnY92Uilh5hCtEmIoQ==} + /@ceramicnetwork/stream-model@2.4.0(typescript@4.9.5): + resolution: {integrity: sha512-7oX8aiFoZUpq/Tbhd9Pz3k3sEOaaDnpfiKnhzV0BaUrwEPJETgFRREMZBZQply3vccPLfKgImCD1+TJK+Ja+Zw==} dependencies: - '@ceramicnetwork/codecs': 2.3.0 - '@ceramicnetwork/common': 3.3.0(typescript@4.9.5) - '@ceramicnetwork/streamid': 3.3.0 + '@ceramicnetwork/codecs': 2.4.0 + '@ceramicnetwork/common': 4.0.0(typescript@4.9.5) + '@ceramicnetwork/streamid': 3.4.0 '@ipld/dag-cbor': 7.0.3 '@stablelib/random': 1.0.2 ajv: 8.12.0 @@ -1282,11 +1319,11 @@ packages: - zod dev: false - /@ceramicnetwork/stream-tile@3.3.0(typescript@4.9.5): - resolution: {integrity: sha512-nxvCGYcfXUVgrVIrmg+kgV+C9Q18H5/oeePryAuhsv5AqkY+0rdRT1lgxccMzQVXti5kxxeiTgVGN31w6CGPtw==} + /@ceramicnetwork/stream-tile@3.4.0(typescript@4.9.5): + resolution: {integrity: sha512-7DHbg7KjiHkVZahRPTl1VODF3766yhlWDry6oGFWTNwtyfJZ31sJoTKyeIrLDYJ5NU92qHHahCjRdJcSSvx7Ug==} dependencies: - '@ceramicnetwork/common': 3.3.0(typescript@4.9.5) - '@ceramicnetwork/streamid': 3.3.0 + '@ceramicnetwork/common': 4.0.0(typescript@4.9.5) + '@ceramicnetwork/streamid': 3.4.0 '@ipld/dag-cbor': 7.0.3 '@stablelib/random': 1.0.2 dids: 5.0.2(typescript@4.9.5) @@ -1301,8 +1338,8 @@ packages: - zod dev: false - /@ceramicnetwork/streamid@3.3.0: - resolution: {integrity: sha512-twJ3hBZ0uoohozA6SVqK6tHr+9FgmvznyyboyxRFQkkvl/X5qg8Qef8rp3JGKuJgnw7YjuHYP4eV+H6Bs2+SNw==} + /@ceramicnetwork/streamid@3.4.0: + resolution: {integrity: sha512-7IA3qTPryu/r7nTev3M7bbqdS1fwh+aFgnxJLcsYqd/c09pIzC2N45d/lywRE0fBdS2r/o6IAmrdVpTXyWAnHw==} dependencies: '@ipld/dag-cbor': 7.0.3 '@stablelib/sha256': 1.0.1 @@ -1318,8 +1355,8 @@ packages: engines: {node: '>=20'} dependencies: '@ceramicnetwork/common': 3.3.0(typescript@4.9.5) - '@ceramicnetwork/stream-model': 2.3.0(typescript@4.9.5) - '@ceramicnetwork/streamid': 3.3.0 + '@ceramicnetwork/stream-model': 2.4.0(typescript@4.9.5) + '@ceramicnetwork/streamid': 3.4.0 '@composedb/graphql-scalars': 0.6.0(typescript@4.9.5) '@didtools/cacao': 2.1.0 '@graphql-tools/schema': 10.0.2(graphql@16.8.1) @@ -1329,7 +1366,7 @@ packages: lodash-es: 4.17.21 multiformats: 12.1.3 object-hash: 3.0.0 - type-fest: 4.10.1 + type-fest: 4.10.2 uint8arrays: 4.0.10 transitivePeerDependencies: - bufferutil @@ -1344,7 +1381,7 @@ packages: resolution: {integrity: sha512-9GssARG72pXb2SEYK6Zozz92tl37WnI9fCgKiTKBIjisoUGpUnTv2sRNRJV8X9j4CgawvCm4Yb/SH+CtUXuZew==} engines: {node: '>=20'} dependencies: - '@ceramicnetwork/streamid': 3.3.0 + '@ceramicnetwork/streamid': 3.4.0 '@composedb/types': 0.6.0(typescript@4.9.5) caip: 1.1.0 graphql: 16.8.1 @@ -1363,8 +1400,8 @@ packages: engines: {node: '>=20'} dependencies: '@ceramicnetwork/common': 3.3.0(typescript@4.9.5) - '@ceramicnetwork/stream-model': 2.3.0(typescript@4.9.5) - '@ceramicnetwork/stream-model-instance': 2.3.0(typescript@4.9.5) + '@ceramicnetwork/stream-model': 2.4.0(typescript@4.9.5) + '@ceramicnetwork/stream-model-instance': 2.4.0(typescript@4.9.5) dids: 4.0.4 json-schema-typed: 8.0.1 transitivePeerDependencies: @@ -1381,7 +1418,7 @@ packages: dependencies: '@didtools/codecs': 1.0.1 '@didtools/siwx': 1.0.0 - '@ipld/dag-cbor': 9.0.8 + '@ipld/dag-cbor': 9.1.0 caip: 1.1.0 multiformats: 11.0.2 uint8arrays: 4.0.10 @@ -1393,7 +1430,7 @@ packages: dependencies: '@didtools/codecs': 3.0.0 '@didtools/siwx': 2.0.0 - '@ipld/dag-cbor': 9.0.8 + '@ipld/dag-cbor': 9.1.0 caip: 1.1.0 multiformats: 13.0.1 uint8arrays: 5.0.1 @@ -1892,6 +1929,22 @@ packages: multiformats: 13.0.1 dev: false + /@ipld/dag-cbor@9.1.0: + resolution: {integrity: sha512-7pMKjBaapEh+1Nk/1umPPhQGT6znb5E71lke2ekxlcuVZLLrPPdDSy0UAMwWgj3a28cjir/ZJ6CQH2DEs3DUOQ==} + engines: {node: '>=16.0.0', npm: '>=7.0.0'} + dependencies: + cborg: 4.0.8 + multiformats: 13.0.1 + dev: false + + /@ipld/dag-json@10.1.7: + resolution: {integrity: sha512-ipraTPMA40sZAtUYwFvjHeQjReDJXWI8V3lrOeyedKxMb9rOOCS0B7eodRoWM3RIS2qMqtnu1oZr8kP+QJEN0Q==} + engines: {node: '>=16.0.0', npm: '>=7.0.0'} + dependencies: + cborg: 4.0.8 + multiformats: 13.0.1 + dev: false + /@istanbuljs/load-nyc-config@1.1.0: resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} engines: {node: '>=8'} @@ -2730,7 +2783,7 @@ packages: resolution: {integrity: sha512-6x5Z7AKd9/kj3+DYE9xIDIkFLHihBH614i2wqrZIjN02WxVo063hWSjIlUxlx8P4gl6olVzlOy5LzhLJD9OP0A==} dependencies: '@types/bn.js': 5.1.5 - '@types/node': 18.19.9 + '@types/node': 18.19.11 dev: false /@stacks/encryption@6.11.3: @@ -2740,7 +2793,7 @@ packages: '@noble/secp256k1': 1.7.1 '@scure/bip39': 1.1.0 '@stacks/common': 6.10.0 - '@types/node': 18.19.9 + '@types/node': 18.19.11 base64-js: 1.5.1 bs58: 5.0.0 ripemd160-min: 0.0.6 @@ -2865,12 +2918,12 @@ packages: /@types/node@16.18.57: resolution: {integrity: sha512-piPoDozdPaX1hNWFJQzzgWqE40gh986VvVx/QO9RU4qYRE55ld7iepDVgZ3ccGUw0R4wge0Oy1dd+3xOQNkkUQ==} - /@types/node@16.18.75: - resolution: {integrity: sha512-+FSfZd5mpMDTcIK7bp2GueIcAespzR4FROOXnEst248c85vwthIEwtXYOLgVc/sI4ihE1K/7yO1lEiSgvwAOxA==} + /@types/node@16.18.77: + resolution: {integrity: sha512-zwqAbRkHjGlxH9PBv8i9dmeaDpBRgfQDSFuREMF2Z+WUi8uc13gfRquMV/8LxBqwm+7jBz+doTVkEEA1CIWOnQ==} dev: true - /@types/node@18.19.9: - resolution: {integrity: sha512-oZFKlC8l5YtzGQNT4zC2PiSSKzQVZ8bAwwd+EYdPLtyk0nSEq6O16SkK+rkkT2eflDAbormJgEF3QnH3oDrTSw==} + /@types/node@18.19.11: + resolution: {integrity: sha512-hzdHPKpDdp5bEcRq1XTlZ2ntVjLcHCTV73dEcGg02eSY/+9AZ+jlfz6i00+zOrunMWenjHuI49J8J7Y9uz50JQ==} dependencies: undici-types: 5.26.5 dev: false @@ -3578,15 +3631,15 @@ packages: node-releases: 2.0.13 update-browserslist-db: 1.0.13(browserslist@4.22.1) - /browserslist@4.22.2: - resolution: {integrity: sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==} + /browserslist@4.22.3: + resolution: {integrity: sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001580 - electron-to-chromium: 1.4.645 + caniuse-lite: 1.0.30001581 + electron-to-chromium: 1.4.651 node-releases: 2.0.14 - update-browserslist-db: 1.0.13(browserslist@4.22.2) + update-browserslist-db: 1.0.13(browserslist@4.22.3) dev: true /bs-logger@0.2.6: @@ -3688,8 +3741,8 @@ packages: /caniuse-lite@1.0.30001546: resolution: {integrity: sha512-zvtSJwuQFpewSyRrI3AsftF6rM0X80mZkChIt1spBGEvRglCrjTniXvinc8JKRoqTwXAgvqTImaN9igfSMtUBw==} - /caniuse-lite@1.0.30001580: - resolution: {integrity: sha512-mtj5ur2FFPZcCEpXFy8ADXbDACuNFXg6mxVDqp7tqooX6l3zwm+d8EPoeOSIFRDvHs8qu7/SLFOGniULkcH2iA==} + /caniuse-lite@1.0.30001581: + resolution: {integrity: sha512-whlTkwhqV2tUmP3oYhtNfaWGYHDdS3JYFQBKXxcUR9qqPWsRhFHhoISO2Xnl/g0xyKzht9mI1LZpiNWfMzHixQ==} dev: true /canonicalize@2.0.0: @@ -3907,14 +3960,14 @@ packages: /dag-jose-utils@4.0.0: resolution: {integrity: sha512-bmmXtVdEKp/zYH8El4GGkMREJioUztz8fzOErfy5dTbyKIVOF61C5sfsZLYCB/wiT/I9+SPNrQeo/Cx6Ik3wJQ==} dependencies: - '@ipld/dag-cbor': 9.0.8 + '@ipld/dag-cbor': 9.1.0 multiformats: 13.0.1 dev: false /dag-jose@4.0.0: resolution: {integrity: sha512-tw595L3UYoOUT9dSJPbBEG/qpRpw24kRZxa5SLRnlnr+g5L7O8oEs1d3W5TiVA1oJZbthVsf0Vi3zFN66qcEBA==} dependencies: - '@ipld/dag-cbor': 9.0.8 + '@ipld/dag-cbor': 9.1.0 multiformats: 11.0.2 dev: false @@ -4185,8 +4238,8 @@ packages: /electron-to-chromium@1.4.544: resolution: {integrity: sha512-54z7squS1FyFRSUqq/knOFSptjjogLZXbKcYk3B0qkE1KZzvqASwRZnY2KzZQJqIYLVD38XZeoiMRflYSwyO4w==} - /electron-to-chromium@1.4.645: - resolution: {integrity: sha512-EeS1oQDCmnYsRDRy2zTeC336a/4LZ6WKqvSaM1jLocEk5ZuyszkQtCpsqvuvaIXGOUjwtvF6LTcS8WueibXvSw==} + /electron-to-chromium@1.4.651: + resolution: {integrity: sha512-jjks7Xx+4I7dslwsbaFocSwqBbGHQmuXBJUK9QBZTIrzPq3pzn6Uf2szFSP728FtLYE3ldiccmlkOM/zhGKCpA==} dev: true /elliptic@6.5.4: @@ -5946,7 +5999,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 16.18.75 + '@types/node': 16.18.77 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -7395,7 +7448,7 @@ packages: typescript: 4.9.5 dev: true - /ts-jest@29.1.1(@babel/core@7.23.0)(jest@29.7.0)(typescript@4.9.5): + /ts-jest@29.1.1(@babel/core@7.19.1)(jest@29.7.0)(typescript@4.9.5): resolution: {integrity: sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -7416,7 +7469,7 @@ packages: esbuild: optional: true dependencies: - '@babel/core': 7.23.0 + '@babel/core': 7.19.1 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 jest: 29.7.0(@types/node@16.18.57) @@ -7495,8 +7548,8 @@ packages: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} - /type-fest@4.10.1: - resolution: {integrity: sha512-7ZnJYTp6uc04uYRISWtiX3DSKB/fxNQT0B5o1OUeCqiQiwF+JC9+rJiZIDrPrNCLLuTqyQmh4VdQqh/ZOkv9MQ==} + /type-fest@4.10.2: + resolution: {integrity: sha512-anpAG63wSpdEbLwOqH8L84urkL6PiVIov3EMmgIhhThevh9aiMQov+6Btx0wldNcvm4wV+e2/Rt1QdDwKHFbHw==} engines: {node: '>=16'} dev: false @@ -7596,13 +7649,13 @@ packages: escalade: 3.1.1 picocolors: 1.0.0 - /update-browserslist-db@1.0.13(browserslist@4.22.2): + /update-browserslist-db@1.0.13(browserslist@4.22.3): resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: - browserslist: 4.22.2 + browserslist: 4.22.3 escalade: 3.1.1 picocolors: 1.0.0 dev: true @@ -7738,7 +7791,7 @@ packages: '@webassemblyjs/wasm-parser': 1.11.6 acorn: 8.11.3 acorn-import-assertions: 1.9.0(acorn@8.11.3) - browserslist: 4.22.2 + browserslist: 4.22.3 chrome-trace-event: 1.0.3 enhanced-resolve: 5.15.0 es-module-lexer: 1.4.1 diff --git a/suite/src/__tests__/fast/events.test.ts b/suite/src/__tests__/fast/events.test.ts index e1aca66d..2f34f7cd 100644 --- a/suite/src/__tests__/fast/events.test.ts +++ b/suite/src/__tests__/fast/events.test.ts @@ -5,6 +5,10 @@ import * as random from '@stablelib/random' import { base64 } from 'multiformats/bases/base64' import { base16 } from 'multiformats/bases/base16' import { randomCID, StreamID, EventID } from '@ceramicnetwork/streamid' +import { CARFactory } from "cartonne"; +import * as dagJson from "@ipld/dag-json"; +import { sha256 } from "multihashes-sync/sha2"; + const delay = utilities.delay @@ -14,7 +18,13 @@ const Network = String(process.env.NETWORK) function randomEvents(modelID: StreamID, count: number, network = Network, networkOffset = 0) { let modelEvents = []; + const carFactory = new CARFactory(); + carFactory.codecs.add(dagJson); + carFactory.hashers.add(sha256); + for (let i = 0; i < count; i++) { + const car = carFactory.build().asV1(); + car.put({ data: base64.encode(random.randomBytes(512)) }, { isRoot: true }); modelEvents.push({ "eventId": base16.encode(EventID.createRandom( network, @@ -24,7 +34,7 @@ function randomEvents(modelID: StreamID, count: number, network = Network, netwo separatorValue: modelID.toString(), } ).bytes), - "eventData": base64.encode(random.randomBytes(1024)), + "eventData": car.toString('base64'), }) } return modelEvents diff --git a/suite/src/__tests__/fast/update.test.ts b/suite/src/__tests__/fast/update.test.ts index b127bd21..9b4cb1f8 100644 --- a/suite/src/__tests__/fast/update.test.ts +++ b/suite/src/__tests__/fast/update.test.ts @@ -1,4 +1,4 @@ -import { CeramicApi, SyncOptions } from '@ceramicnetwork/common' +import { StreamReaderWriter, SyncOptions } from '@ceramicnetwork/common' import CeramicClient from '@ceramicnetwork/http-client' import { TileDocument } from '@ceramicnetwork/stream-tile' import { afterAll, beforeAll, expect, test, describe } from '@jest/globals' @@ -38,7 +38,7 @@ function testUpdate(composeDbUrls: string[]) { // Create and update on first node test(`create stream on ${firstNodeUrl}`, async () => { firstCeramic = await newCeramic(firstNodeUrl) - firstTile = await TileDocument.create(firstCeramic as CeramicApi, content, metadata, { + firstTile = await TileDocument.create(firstCeramic as StreamReaderWriter, content, metadata, { anchor: false, }) console.log( diff --git a/suite/src/__tests__/slow/ceramic-cas-integration.test.ts b/suite/src/__tests__/slow/ceramic-cas-integration.test.ts index 24afb6a1..47d56754 100644 --- a/suite/src/__tests__/slow/ceramic-cas-integration.test.ts +++ b/suite/src/__tests__/slow/ceramic-cas-integration.test.ts @@ -1,13 +1,14 @@ -import { AnchorStatus, CeramicApi } from '@ceramicnetwork/common' +import { AnchorStatus, StreamReaderWriter } from '@ceramicnetwork/common' import { TileDocument } from '@ceramicnetwork/stream-tile' import { jest, describe, test, beforeAll, expect } from '@jest/globals' import { newCeramic, waitForAnchor } from '../../utils/ceramicHelpers.js' const ComposeDbUrls = String(process.env.COMPOSEDB_URLS).split(',') -describe('Ceramic<->CAS basic integration', () => { +// Skipped https://linear.app/3boxlabs/issue/WS1-1460/unskip-ceramic-cas-basic-integration +describe.skip('Ceramic<->CAS basic integration', () => { jest.setTimeout(1000 * 60 * 60) // 1 hour - let ceramic: CeramicApi + let ceramic: StreamReaderWriter beforeAll(async () => { ceramic = await newCeramic(ComposeDbUrls[0]) diff --git a/suite/src/__tests__/slow/ceramic-ceramic-integration.test.ts b/suite/src/__tests__/slow/ceramic-ceramic-integration.test.ts index e1d22276..187cef1e 100644 --- a/suite/src/__tests__/slow/ceramic-ceramic-integration.test.ts +++ b/suite/src/__tests__/slow/ceramic-ceramic-integration.test.ts @@ -1,4 +1,4 @@ -import { CeramicApi, StreamUtils } from '@ceramicnetwork/common' +import { StreamReaderWriter, StreamUtils } from '@ceramicnetwork/common' import { TileDocument } from '@ceramicnetwork/stream-tile' import { jest, describe, test, beforeAll, expect } from '@jest/globals' import { newCeramic, waitForAnchor, waitForCondition } from '../../utils/ceramicHelpers.js' @@ -7,8 +7,8 @@ const UPDATE_TIMEOUT = 60 // 60 seconds for regular updates to propagate from on const ComposeDbUrls = String(process.env.COMPOSEDB_URLS).split(',') const createWithOneLoadWithTheOther = async ( - ceramic1: CeramicApi, - ceramic2: CeramicApi, + ceramic1: StreamReaderWriter, + ceramic2: StreamReaderWriter, ): Promise => { const content = { foo: 'bar' } const doc1 = await TileDocument.create(ceramic1, content) @@ -18,8 +18,8 @@ const createWithOneLoadWithTheOther = async ( } const updatesAreShared = async ( - ceramic1: CeramicApi, - ceramic2: CeramicApi, + ceramic1: StreamReaderWriter, + ceramic2: StreamReaderWriter, anchor: boolean, ): Promise => { const content0 = { foo: 0 } @@ -96,8 +96,8 @@ const updatesAreShared = async ( describe.skip('Ceramic<->Ceramic multi-node integration', () => { jest.setTimeout(1000 * 60 * 60) // 1 hour - let ceramic1: CeramicApi - let ceramic2: CeramicApi + let ceramic1: StreamReaderWriter + let ceramic2: StreamReaderWriter beforeAll(async () => { ceramic1 = await newCeramic(ComposeDbUrls[0])