From 87ff42793e652fcd37d2561192ecd70ee1a7ac9d Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Wed, 22 Nov 2023 14:03:24 +0000 Subject: [PATCH 01/22] wip zombienet --- package.json | 6 +- tests/sibling-zombienet.toml | 38 + yarn.lock | 1955 +++++++++++++++++++++++++++++++++- 3 files changed, 1946 insertions(+), 53 deletions(-) create mode 100644 tests/sibling-zombienet.toml diff --git a/package.json b/package.json index 65a869e..9759edf 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "devDependencies": { "@typescript-eslint/eslint-plugin": "^6.2.0", "@typescript-eslint/parser": "^6.2.0", + "@zombienet/cli": "^1.3.82", "eslint": "^8.45.0", "eslint-config-prettier": "^8.9.0", "eslint-plugin-import": "^2.27.5", @@ -48,10 +49,11 @@ "lint:fix": "prettier -w . && eslint --fix --ext .ts .", "test:e2e": "vitest run tests", "prepublish": "yarn exec cp -f ../../LICENSE .", - "publish": "yarn npm publish --access=public --tolerate-republish" + "publish": "yarn npm publish --access=public --tolerate-republish", + "test:e2e:zombienet:sibling": "yarn zombienet spawn tests/sibling-zombienet.toml" }, "stableVersion": "0.0.0", "type": "module", "types": "./dist/cjs/index.d.ts", "version": "0.0.0" -} +} \ No newline at end of file diff --git a/tests/sibling-zombienet.toml b/tests/sibling-zombienet.toml new file mode 100644 index 0000000..a5cf9fb --- /dev/null +++ b/tests/sibling-zombienet.toml @@ -0,0 +1,38 @@ +[settings] +timeout = 1000 +provider = "kubernetes" + +[relaychain] +default_image = "parity/polkadot:v1.0.0" +chain = "rococo-local" + +[[relaychain.nodes]] +name = "alice" +rpc_port = 10001 + +# [[relaychain.nodes]] +# name = "bob" +# rpc_port = 10002 + +# [[relaychain.nodes]] +# name = "charlie" +# rpc_port = 10003 + +[[parachains]] +id = 2000 + +[parachains.collator] +chain = "dev" +name = "provider-alice" +image = "kiltprotocol/dip-provider-node-template:dev-10385bb3b3c302a1bdbd6e4188b034a2f01047d1" +ws_port = 10011 +command = "node-executable" + +# [[parachains]] +# id = 2001 + +# [parachains.collator] +# name = "consumer-alice" +# image = "kiltprotocol/dip-consumer-node-template:dev-10385bb3b3c302a1bdbd6e4188b034a2f01047d1" +# ws_port = 10011 +# command = "" diff --git a/yarn.lock b/yarn.lock index ca82e7c..ec5d7c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,6 +12,22 @@ __metadata: languageName: node linkType: hard +"@colors/colors@npm:1.5.0": + version: 1.5.0 + resolution: "@colors/colors@npm:1.5.0" + checksum: d64d5260bed1d5012ae3fc617d38d1afc0329fec05342f4e6b838f46998855ba56e0a73833f4a80fa8378c84810da254f76a8a19c39d038260dc06dc4e007425 + languageName: node + linkType: hard + +"@cspotcode/source-map-support@npm:^0.8.0": + version: 0.8.1 + resolution: "@cspotcode/source-map-support@npm:0.8.1" + dependencies: + "@jridgewell/trace-mapping": 0.3.9 + checksum: 5718f267085ed8edb3e7ef210137241775e607ee18b77d95aa5bd7514f47f5019aa2d82d96b3bf342ef7aa890a346fa1044532ff7cc3009e7d24fce3ce6200fa + languageName: node + linkType: hard + "@digitalbazaar/security-context@npm:^1.0.0": version: 1.0.1 resolution: "@digitalbazaar/security-context@npm:1.0.1" @@ -263,13 +279,30 @@ __metadata: languageName: node linkType: hard -"@jridgewell/sourcemap-codec@npm:^1.4.15": +"@jridgewell/resolve-uri@npm:^3.0.3": + version: 3.1.1 + resolution: "@jridgewell/resolve-uri@npm:3.1.1" + checksum: f5b441fe7900eab4f9155b3b93f9800a916257f4e8563afbcd3b5a5337b55e52bd8ae6735453b1b745457d9f6cdb16d74cd6220bbdd98cf153239e13f6cbb653 + languageName: node + linkType: hard + +"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.15": version: 1.4.15 resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" checksum: b881c7e503db3fc7f3c1f35a1dd2655a188cc51a3612d76efc8a6eb74728bef5606e6758ee77423e564092b4a518aba569bbb21c9bac5ab7a35b0c6ae7e344c8 languageName: node linkType: hard +"@jridgewell/trace-mapping@npm:0.3.9": + version: 0.3.9 + resolution: "@jridgewell/trace-mapping@npm:0.3.9" + dependencies: + "@jridgewell/resolve-uri": ^3.0.3 + "@jridgewell/sourcemap-codec": ^1.4.10 + checksum: d89597752fd88d3f3480845691a05a44bd21faac18e2185b6f436c3b0fd0c5a859fbbd9aaa92050c4052caf325ad3e10e2e1d1b64327517471b7d51babc0ddef + languageName: node + linkType: hard + "@kiltprotocol/augment-api@npm:0.34.0-dip-1": version: 0.34.0-dip-1 resolution: "@kiltprotocol/augment-api@npm:0.34.0-dip-1" @@ -319,6 +352,7 @@ __metadata: "@polkadot/util": ^12.5.1 "@typescript-eslint/eslint-plugin": ^6.2.0 "@typescript-eslint/parser": ^6.2.0 + "@zombienet/cli": ^1.3.82 eslint: ^8.45.0 eslint-config-prettier: ^8.9.0 eslint-plugin-import: ^2.27.5 @@ -376,6 +410,13 @@ __metadata: languageName: node linkType: hard +"@noble/ed25519@npm:^1.5.1": + version: 1.7.3 + resolution: "@noble/ed25519@npm:1.7.3" + checksum: 45169927d51de513e47bbeebff3a603433c4ac7579e1b8c5034c380a0afedbe85e6959be3d69584a7a5ed6828d638f8f28879003b9bb2fb5f22d8aa2d88fd5fe + languageName: node + linkType: hard + "@noble/hashes@npm:1.3.2, @noble/hashes@npm:^1.3.2": version: 1.3.2 resolution: "@noble/hashes@npm:1.3.2" @@ -383,6 +424,13 @@ __metadata: languageName: node linkType: hard +"@noble/secp256k1@npm:^1.3.0": + version: 1.7.1 + resolution: "@noble/secp256k1@npm:1.7.1" + checksum: d2301f1f7690368d8409a3152450458f27e54df47e3f917292de3de82c298770890c2de7c967d237eff9c95b70af485389a9695f73eb05a43e2bd562d18b18cb + languageName: node + linkType: hard + "@nodelib/fs.scandir@npm:2.1.5": version: 2.1.5 resolution: "@nodelib/fs.scandir@npm:2.1.5" @@ -454,6 +502,21 @@ __metadata: languageName: node linkType: hard +"@polkadot/api-augment@npm:10.11.1": + version: 10.11.1 + resolution: "@polkadot/api-augment@npm:10.11.1" + dependencies: + "@polkadot/api-base": 10.11.1 + "@polkadot/rpc-augment": 10.11.1 + "@polkadot/types": 10.11.1 + "@polkadot/types-augment": 10.11.1 + "@polkadot/types-codec": 10.11.1 + "@polkadot/util": ^12.6.1 + tslib: ^2.6.2 + checksum: 5d75d2fcedb08e0e9873f1c42104dce96162926818bb37535f4727e71593ec5dd6f31056272162e26cc3ed38d3f517e9b6d0172fa87db9a76d717ff6fedcbf64 + languageName: node + linkType: hard + "@polkadot/api-base@npm:10.10.1": version: 10.10.1 resolution: "@polkadot/api-base@npm:10.10.1" @@ -467,6 +530,19 @@ __metadata: languageName: node linkType: hard +"@polkadot/api-base@npm:10.11.1": + version: 10.11.1 + resolution: "@polkadot/api-base@npm:10.11.1" + dependencies: + "@polkadot/rpc-core": 10.11.1 + "@polkadot/types": 10.11.1 + "@polkadot/util": ^12.6.1 + rxjs: ^7.8.1 + tslib: ^2.6.2 + checksum: 8fe42617944ede2c4dcc1ffdb9458dd1ef5b27658204d92e2e2acbb4bc7abf08c01b0c73c88a7caa86bcb3263aac65a0921e34d5ba448406e9a4c34b6b9eb91b + languageName: node + linkType: hard + "@polkadot/api-derive@npm:10.10.1": version: 10.10.1 resolution: "@polkadot/api-derive@npm:10.10.1" @@ -485,6 +561,24 @@ __metadata: languageName: node linkType: hard +"@polkadot/api-derive@npm:10.11.1": + version: 10.11.1 + resolution: "@polkadot/api-derive@npm:10.11.1" + dependencies: + "@polkadot/api": 10.11.1 + "@polkadot/api-augment": 10.11.1 + "@polkadot/api-base": 10.11.1 + "@polkadot/rpc-core": 10.11.1 + "@polkadot/types": 10.11.1 + "@polkadot/types-codec": 10.11.1 + "@polkadot/util": ^12.6.1 + "@polkadot/util-crypto": ^12.6.1 + rxjs: ^7.8.1 + tslib: ^2.6.2 + checksum: e6adc01b19ea171e9d7a30578cf14672661f87bb64d5578c261c1f313267828e11462944bc17a30b7ea6803ddb42bc6b92cdaf394763720095b459966acdef5c + languageName: node + linkType: hard + "@polkadot/api@npm:10.10.1, @polkadot/api@npm:^10.10.1, @polkadot/api@npm:^10.4.0": version: 10.10.1 resolution: "@polkadot/api@npm:10.10.1" @@ -510,6 +604,31 @@ __metadata: languageName: node linkType: hard +"@polkadot/api@npm:10.11.1, @polkadot/api@npm:^10.11.1": + version: 10.11.1 + resolution: "@polkadot/api@npm:10.11.1" + dependencies: + "@polkadot/api-augment": 10.11.1 + "@polkadot/api-base": 10.11.1 + "@polkadot/api-derive": 10.11.1 + "@polkadot/keyring": ^12.6.1 + "@polkadot/rpc-augment": 10.11.1 + "@polkadot/rpc-core": 10.11.1 + "@polkadot/rpc-provider": 10.11.1 + "@polkadot/types": 10.11.1 + "@polkadot/types-augment": 10.11.1 + "@polkadot/types-codec": 10.11.1 + "@polkadot/types-create": 10.11.1 + "@polkadot/types-known": 10.11.1 + "@polkadot/util": ^12.6.1 + "@polkadot/util-crypto": ^12.6.1 + eventemitter3: ^5.0.1 + rxjs: ^7.8.1 + tslib: ^2.6.2 + checksum: 5d01bec3efd8484a627cea761b1e99d3a7fc23483111d5d4d8036519bcee4037632bfd2773771b87e498a0b9692e59e131f4e1c3bb03a76cbf4f05473477fbc7 + languageName: node + linkType: hard + "@polkadot/keyring@npm:^12.0.0, @polkadot/keyring@npm:^12.5.1": version: 12.5.1 resolution: "@polkadot/keyring@npm:12.5.1" @@ -524,6 +643,20 @@ __metadata: languageName: node linkType: hard +"@polkadot/keyring@npm:^12.6.1": + version: 12.6.1 + resolution: "@polkadot/keyring@npm:12.6.1" + dependencies: + "@polkadot/util": 12.6.1 + "@polkadot/util-crypto": 12.6.1 + tslib: ^2.6.2 + peerDependencies: + "@polkadot/util": 12.6.1 + "@polkadot/util-crypto": 12.6.1 + checksum: 7495abbd1793481a3d02b9f04c6ac631f6d59e6c8da9479eb636a51da9645ba322284465b92b94b9138141c11b1a6b4b07123cc718633546d965c09ae728aa6e + languageName: node + linkType: hard + "@polkadot/networks@npm:12.5.1, @polkadot/networks@npm:^12.5.1": version: 12.5.1 resolution: "@polkadot/networks@npm:12.5.1" @@ -535,6 +668,17 @@ __metadata: languageName: node linkType: hard +"@polkadot/networks@npm:12.6.1, @polkadot/networks@npm:^12.6.1": + version: 12.6.1 + resolution: "@polkadot/networks@npm:12.6.1" + dependencies: + "@polkadot/util": 12.6.1 + "@substrate/ss58-registry": ^1.44.0 + tslib: ^2.6.2 + checksum: ed889a18e4d915ef78f1c59ed2efa11c1942770d71cdb227f907c29620d81e2fd9d5bb29ae94572d92a8b789b57a881cba025ec43df52f4a294cc000634a316d + languageName: node + linkType: hard + "@polkadot/rpc-augment@npm:10.10.1": version: 10.10.1 resolution: "@polkadot/rpc-augment@npm:10.10.1" @@ -548,6 +692,19 @@ __metadata: languageName: node linkType: hard +"@polkadot/rpc-augment@npm:10.11.1": + version: 10.11.1 + resolution: "@polkadot/rpc-augment@npm:10.11.1" + dependencies: + "@polkadot/rpc-core": 10.11.1 + "@polkadot/types": 10.11.1 + "@polkadot/types-codec": 10.11.1 + "@polkadot/util": ^12.6.1 + tslib: ^2.6.2 + checksum: 3fa2c1fea6fae22509b70d6a4c6e9e6e9cf473c5c7f85e466b845fdbb27df2fb0111251c693c75d68c3fcd85c66bfb0483899e70300df8e614f146c700cc8d59 + languageName: node + linkType: hard + "@polkadot/rpc-core@npm:10.10.1": version: 10.10.1 resolution: "@polkadot/rpc-core@npm:10.10.1" @@ -562,6 +719,20 @@ __metadata: languageName: node linkType: hard +"@polkadot/rpc-core@npm:10.11.1": + version: 10.11.1 + resolution: "@polkadot/rpc-core@npm:10.11.1" + dependencies: + "@polkadot/rpc-augment": 10.11.1 + "@polkadot/rpc-provider": 10.11.1 + "@polkadot/types": 10.11.1 + "@polkadot/util": ^12.6.1 + rxjs: ^7.8.1 + tslib: ^2.6.2 + checksum: a1e94c5bb6ddae2daeebdf965e1b04468022db74cf435510f37af15d2cd799305aedcc6f70c5a66e75bed4bd1d8816b1264b68d3948c55871e1d0e9a61a19be6 + languageName: node + linkType: hard + "@polkadot/rpc-provider@npm:10.10.1": version: 10.10.1 resolution: "@polkadot/rpc-provider@npm:10.10.1" @@ -586,6 +757,30 @@ __metadata: languageName: node linkType: hard +"@polkadot/rpc-provider@npm:10.11.1": + version: 10.11.1 + resolution: "@polkadot/rpc-provider@npm:10.11.1" + dependencies: + "@polkadot/keyring": ^12.6.1 + "@polkadot/types": 10.11.1 + "@polkadot/types-support": 10.11.1 + "@polkadot/util": ^12.6.1 + "@polkadot/util-crypto": ^12.6.1 + "@polkadot/x-fetch": ^12.6.1 + "@polkadot/x-global": ^12.6.1 + "@polkadot/x-ws": ^12.6.1 + "@substrate/connect": 0.7.35 + eventemitter3: ^5.0.1 + mock-socket: ^9.3.1 + nock: ^13.3.8 + tslib: ^2.6.2 + dependenciesMeta: + "@substrate/connect": + optional: true + checksum: 7df44bdd7f703be4f606dd75acf86f3d6c963886dd12112a76789f44da38a33f8a0207576ce3dbf62f02e9ad46993062b1cb5078f13bcafb938e60b24f250d8c + languageName: node + linkType: hard + "@polkadot/types-augment@npm:10.10.1": version: 10.10.1 resolution: "@polkadot/types-augment@npm:10.10.1" @@ -598,6 +793,18 @@ __metadata: languageName: node linkType: hard +"@polkadot/types-augment@npm:10.11.1": + version: 10.11.1 + resolution: "@polkadot/types-augment@npm:10.11.1" + dependencies: + "@polkadot/types": 10.11.1 + "@polkadot/types-codec": 10.11.1 + "@polkadot/util": ^12.6.1 + tslib: ^2.6.2 + checksum: dbd8d2d8df1e155ef31529ba016fb6603de14f74754c5058680218222b658f6ecca64fca5ef6993dfad2292649ba537e37c8bf84b9f49bfe418347861679178b + languageName: node + linkType: hard + "@polkadot/types-codec@npm:10.10.1, @polkadot/types-codec@npm:^10.4.0": version: 10.10.1 resolution: "@polkadot/types-codec@npm:10.10.1" @@ -609,6 +816,17 @@ __metadata: languageName: node linkType: hard +"@polkadot/types-codec@npm:10.11.1": + version: 10.11.1 + resolution: "@polkadot/types-codec@npm:10.11.1" + dependencies: + "@polkadot/util": ^12.6.1 + "@polkadot/x-bigint": ^12.6.1 + tslib: ^2.6.2 + checksum: b58b5626116c854180094851def146ba36492de71ea263f095b4be72370f25edc33200c4d0c410c9cccf0ad251d1271dd3945b7f1452a85a365bbb2202091adf + languageName: node + linkType: hard + "@polkadot/types-create@npm:10.10.1": version: 10.10.1 resolution: "@polkadot/types-create@npm:10.10.1" @@ -620,6 +838,17 @@ __metadata: languageName: node linkType: hard +"@polkadot/types-create@npm:10.11.1": + version: 10.11.1 + resolution: "@polkadot/types-create@npm:10.11.1" + dependencies: + "@polkadot/types-codec": 10.11.1 + "@polkadot/util": ^12.6.1 + tslib: ^2.6.2 + checksum: 1b01883fa202af43c0bde4eb56e31919b9d0dccb18a0953b3147658956b851625219baea3e69f7b82bfd74e52430595eb0484541d52f9805daac918d23c1b26b + languageName: node + linkType: hard + "@polkadot/types-known@npm:10.10.1": version: 10.10.1 resolution: "@polkadot/types-known@npm:10.10.1" @@ -634,6 +863,20 @@ __metadata: languageName: node linkType: hard +"@polkadot/types-known@npm:10.11.1": + version: 10.11.1 + resolution: "@polkadot/types-known@npm:10.11.1" + dependencies: + "@polkadot/networks": ^12.6.1 + "@polkadot/types": 10.11.1 + "@polkadot/types-codec": 10.11.1 + "@polkadot/types-create": 10.11.1 + "@polkadot/util": ^12.6.1 + tslib: ^2.6.2 + checksum: 4d7aee2b6f281069994cc1442abd76904f6331cd9232d1ea5efbaf22d32863e9ae6aab8c088fa30ac3332bfb71850e9c26bf45d24cf529fe4f5d71efa91576f6 + languageName: node + linkType: hard + "@polkadot/types-support@npm:10.10.1": version: 10.10.1 resolution: "@polkadot/types-support@npm:10.10.1" @@ -644,6 +887,16 @@ __metadata: languageName: node linkType: hard +"@polkadot/types-support@npm:10.11.1": + version: 10.11.1 + resolution: "@polkadot/types-support@npm:10.11.1" + dependencies: + "@polkadot/util": ^12.6.1 + tslib: ^2.6.2 + checksum: a587677fd83d1a1abe6dc8aede4272d43def9fb846aa618344c48b673b9d7df6e76c4330bcb3f6add9e2727423778cac2be16882c919beb2d8f8c23a35fb9264 + languageName: node + linkType: hard + "@polkadot/types@npm:10.10.1, @polkadot/types@npm:^10.4.0": version: 10.10.1 resolution: "@polkadot/types@npm:10.10.1" @@ -660,6 +913,22 @@ __metadata: languageName: node linkType: hard +"@polkadot/types@npm:10.11.1": + version: 10.11.1 + resolution: "@polkadot/types@npm:10.11.1" + dependencies: + "@polkadot/keyring": ^12.6.1 + "@polkadot/types-augment": 10.11.1 + "@polkadot/types-codec": 10.11.1 + "@polkadot/types-create": 10.11.1 + "@polkadot/util": ^12.6.1 + "@polkadot/util-crypto": ^12.6.1 + rxjs: ^7.8.1 + tslib: ^2.6.2 + checksum: 84a154c4a4b5023cdbd4eb41b626de4283c9b35a41af62c31ca14be3935631dcaf18720f321c2f6b071adb8802be48a86a18b80179f2887b5e10e29f45fd893d + languageName: node + linkType: hard + "@polkadot/util-crypto@npm:12.5.1, @polkadot/util-crypto@npm:^12.0.0, @polkadot/util-crypto@npm:^12.5.1": version: 12.5.1 resolution: "@polkadot/util-crypto@npm:12.5.1" @@ -680,6 +949,26 @@ __metadata: languageName: node linkType: hard +"@polkadot/util-crypto@npm:12.6.1, @polkadot/util-crypto@npm:^12.6.1": + version: 12.6.1 + resolution: "@polkadot/util-crypto@npm:12.6.1" + dependencies: + "@noble/curves": ^1.2.0 + "@noble/hashes": ^1.3.2 + "@polkadot/networks": 12.6.1 + "@polkadot/util": 12.6.1 + "@polkadot/wasm-crypto": ^7.3.1 + "@polkadot/wasm-util": ^7.3.1 + "@polkadot/x-bigint": 12.6.1 + "@polkadot/x-randomvalues": 12.6.1 + "@scure/base": ^1.1.3 + tslib: ^2.6.2 + peerDependencies: + "@polkadot/util": 12.6.1 + checksum: 5c47bc69f14b1a9f4a45d57f22a5a4db979b577d9d6ec9653b7d435978a94713ea1dd1acb3a6ef71848cb2d5b12bf751de68da15a8dd17ae381bc220781bc0d9 + languageName: node + linkType: hard + "@polkadot/util@npm:12.5.1, @polkadot/util@npm:^12.0.0, @polkadot/util@npm:^12.5.1": version: 12.5.1 resolution: "@polkadot/util@npm:12.5.1" @@ -695,6 +984,21 @@ __metadata: languageName: node linkType: hard +"@polkadot/util@npm:12.6.1, @polkadot/util@npm:^12.6.1": + version: 12.6.1 + resolution: "@polkadot/util@npm:12.6.1" + dependencies: + "@polkadot/x-bigint": 12.6.1 + "@polkadot/x-global": 12.6.1 + "@polkadot/x-textdecoder": 12.6.1 + "@polkadot/x-textencoder": 12.6.1 + "@types/bn.js": ^5.1.5 + bn.js: ^5.2.1 + tslib: ^2.6.2 + checksum: 495cd6b4c5c3ef93f8e80487d484aa5e315aeaf7b1af346941e4a56e11a811026317d70f271038f64959f5384c8ef4658310205fb4e3651f9c5982215bf23bae + languageName: node + linkType: hard + "@polkadot/wasm-bridge@npm:7.2.2": version: 7.2.2 resolution: "@polkadot/wasm-bridge@npm:7.2.2" @@ -708,6 +1012,19 @@ __metadata: languageName: node linkType: hard +"@polkadot/wasm-bridge@npm:7.3.1": + version: 7.3.1 + resolution: "@polkadot/wasm-bridge@npm:7.3.1" + dependencies: + "@polkadot/wasm-util": 7.3.1 + tslib: ^2.6.2 + peerDependencies: + "@polkadot/util": "*" + "@polkadot/x-randomvalues": "*" + checksum: 0a0f644fe68ca74f8ba19910f6777870960e64d86c868b438d9bc6bd2ebd78eec0692c1ae096b5a70d2ebf247d414c47e1143a1a7c1a5fcd143ad0c9ed64fe4c + languageName: node + linkType: hard + "@polkadot/wasm-crypto-asmjs@npm:7.2.2": version: 7.2.2 resolution: "@polkadot/wasm-crypto-asmjs@npm:7.2.2" @@ -719,6 +1036,17 @@ __metadata: languageName: node linkType: hard +"@polkadot/wasm-crypto-asmjs@npm:7.3.1": + version: 7.3.1 + resolution: "@polkadot/wasm-crypto-asmjs@npm:7.3.1" + dependencies: + tslib: ^2.6.2 + peerDependencies: + "@polkadot/util": "*" + checksum: c4930ca070bf695dcc341f51861f0c8a5f11c2efdefbc5682b7d7bb3221c4d7b4f4ee26fe4b7b05f7fd344f9d119485e5b4c813dc1b540663fe477317c0616bc + languageName: node + linkType: hard + "@polkadot/wasm-crypto-init@npm:7.2.2": version: 7.2.2 resolution: "@polkadot/wasm-crypto-init@npm:7.2.2" @@ -735,6 +1063,22 @@ __metadata: languageName: node linkType: hard +"@polkadot/wasm-crypto-init@npm:7.3.1": + version: 7.3.1 + resolution: "@polkadot/wasm-crypto-init@npm:7.3.1" + dependencies: + "@polkadot/wasm-bridge": 7.3.1 + "@polkadot/wasm-crypto-asmjs": 7.3.1 + "@polkadot/wasm-crypto-wasm": 7.3.1 + "@polkadot/wasm-util": 7.3.1 + tslib: ^2.6.2 + peerDependencies: + "@polkadot/util": "*" + "@polkadot/x-randomvalues": "*" + checksum: 64de1573766c6ccb5a41d0b60c42654ed45ff80ac74742fe75855d37734b6a23a929a7f1c8495e14cabf4626e72500c7ae3e8f22cb5c99372d8866b729d0f189 + languageName: node + linkType: hard + "@polkadot/wasm-crypto-wasm@npm:7.2.2": version: 7.2.2 resolution: "@polkadot/wasm-crypto-wasm@npm:7.2.2" @@ -747,6 +1091,18 @@ __metadata: languageName: node linkType: hard +"@polkadot/wasm-crypto-wasm@npm:7.3.1": + version: 7.3.1 + resolution: "@polkadot/wasm-crypto-wasm@npm:7.3.1" + dependencies: + "@polkadot/wasm-util": 7.3.1 + tslib: ^2.6.2 + peerDependencies: + "@polkadot/util": "*" + checksum: 265a3260a09271b5a614cfa33f5e70602d36af0e737f1acf595c72867acdf60dc694aad5ae77413af96c801d882932f1da581bda83d2bcbf559f79f04c865009 + languageName: node + linkType: hard + "@polkadot/wasm-crypto@npm:^7.2.2": version: 7.2.2 resolution: "@polkadot/wasm-crypto@npm:7.2.2" @@ -764,6 +1120,23 @@ __metadata: languageName: node linkType: hard +"@polkadot/wasm-crypto@npm:^7.3.1": + version: 7.3.1 + resolution: "@polkadot/wasm-crypto@npm:7.3.1" + dependencies: + "@polkadot/wasm-bridge": 7.3.1 + "@polkadot/wasm-crypto-asmjs": 7.3.1 + "@polkadot/wasm-crypto-init": 7.3.1 + "@polkadot/wasm-crypto-wasm": 7.3.1 + "@polkadot/wasm-util": 7.3.1 + tslib: ^2.6.2 + peerDependencies: + "@polkadot/util": "*" + "@polkadot/x-randomvalues": "*" + checksum: 704a7d6edc35e5cb0b5bdbbc6e77694690f8a03bef1ad12ffb39e0ea32a2b8edae424745e7b5e4fb8877089425349978306895a01da895e1004a9ea554817710 + languageName: node + linkType: hard + "@polkadot/wasm-util@npm:7.2.2, @polkadot/wasm-util@npm:^7.2.2": version: 7.2.2 resolution: "@polkadot/wasm-util@npm:7.2.2" @@ -775,6 +1148,17 @@ __metadata: languageName: node linkType: hard +"@polkadot/wasm-util@npm:7.3.1, @polkadot/wasm-util@npm:^7.3.1": + version: 7.3.1 + resolution: "@polkadot/wasm-util@npm:7.3.1" + dependencies: + tslib: ^2.6.2 + peerDependencies: + "@polkadot/util": "*" + checksum: 6c412f9f69ffb6fea24705160567c7f76a3ed90507fd9d432bab1ecf73ec0f25bb5a95474011d894ce269264e9c590b6071e2d8ffb4503a5eb3bbfda954ba374 + languageName: node + linkType: hard + "@polkadot/x-bigint@npm:12.5.1, @polkadot/x-bigint@npm:^12.5.1": version: 12.5.1 resolution: "@polkadot/x-bigint@npm:12.5.1" @@ -785,6 +1169,16 @@ __metadata: languageName: node linkType: hard +"@polkadot/x-bigint@npm:12.6.1, @polkadot/x-bigint@npm:^12.6.1": + version: 12.6.1 + resolution: "@polkadot/x-bigint@npm:12.6.1" + dependencies: + "@polkadot/x-global": 12.6.1 + tslib: ^2.6.2 + checksum: e979c19b1a44a27469b81fb62d3504d23edb44923e9a4ba66dad3906dcad723b305f294246657ec56d0138310e4b907098af0b626b68c4fd2066e9729b07103e + languageName: node + linkType: hard + "@polkadot/x-fetch@npm:^12.5.1": version: 12.5.1 resolution: "@polkadot/x-fetch@npm:12.5.1" @@ -796,6 +1190,17 @@ __metadata: languageName: node linkType: hard +"@polkadot/x-fetch@npm:^12.6.1": + version: 12.6.1 + resolution: "@polkadot/x-fetch@npm:12.6.1" + dependencies: + "@polkadot/x-global": 12.6.1 + node-fetch: ^3.3.2 + tslib: ^2.6.2 + checksum: ed6e2d146c7e45d9ec863bee260f8de78a1317ca42604b0d8a6d470b0cf0df05d6fc0bce8d69426c3bb1a697abbf1690b09904d66e01dc12b980d28543d1bdad + languageName: node + linkType: hard + "@polkadot/x-global@npm:12.5.1, @polkadot/x-global@npm:^12.5.1": version: 12.5.1 resolution: "@polkadot/x-global@npm:12.5.1" @@ -805,6 +1210,15 @@ __metadata: languageName: node linkType: hard +"@polkadot/x-global@npm:12.6.1, @polkadot/x-global@npm:^12.6.1": + version: 12.6.1 + resolution: "@polkadot/x-global@npm:12.6.1" + dependencies: + tslib: ^2.6.2 + checksum: a61675e39ad243de6932e11dd4490c80197009091bcced2f69103ca277b912b233f6898d6bb9a3008ebad82720ff1f5f66214fda5296c86b1b6b9f90ea1e3b43 + languageName: node + linkType: hard + "@polkadot/x-randomvalues@npm:12.5.1": version: 12.5.1 resolution: "@polkadot/x-randomvalues@npm:12.5.1" @@ -818,6 +1232,19 @@ __metadata: languageName: node linkType: hard +"@polkadot/x-randomvalues@npm:12.6.1": + version: 12.6.1 + resolution: "@polkadot/x-randomvalues@npm:12.6.1" + dependencies: + "@polkadot/x-global": 12.6.1 + tslib: ^2.6.2 + peerDependencies: + "@polkadot/util": 12.6.1 + "@polkadot/wasm-util": "*" + checksum: 4d0812639f5f242bdf01e66b7f8c8ffe1e38c0a2d8a9b629ef6a6066501a5486b525cdd45a8312b14fc8dd2bd167e429b9c50fb7ac05d594280d31472c1b7735 + languageName: node + linkType: hard + "@polkadot/x-textdecoder@npm:12.5.1": version: 12.5.1 resolution: "@polkadot/x-textdecoder@npm:12.5.1" @@ -828,6 +1255,16 @@ __metadata: languageName: node linkType: hard +"@polkadot/x-textdecoder@npm:12.6.1": + version: 12.6.1 + resolution: "@polkadot/x-textdecoder@npm:12.6.1" + dependencies: + "@polkadot/x-global": 12.6.1 + tslib: ^2.6.2 + checksum: f5420c6539c598ede18a984dc0e2e11a0d80fe7be5813cfe9fdd162bfbd3a852131b27385d13587aefac976dd82fc06f2c6707acc8049a40ec13b8fb0b891055 + languageName: node + linkType: hard + "@polkadot/x-textencoder@npm:12.5.1": version: 12.5.1 resolution: "@polkadot/x-textencoder@npm:12.5.1" @@ -838,6 +1275,16 @@ __metadata: languageName: node linkType: hard +"@polkadot/x-textencoder@npm:12.6.1": + version: 12.6.1 + resolution: "@polkadot/x-textencoder@npm:12.6.1" + dependencies: + "@polkadot/x-global": 12.6.1 + tslib: ^2.6.2 + checksum: 59fb9f3a650d37c621277b62f377899acd80c6f5196be919db05dc5572740333199ca9723c9049f9bc0f04c558db969eb35940c0df2921d371720729c9afa5b2 + languageName: node + linkType: hard + "@polkadot/x-ws@npm:^12.5.1": version: 12.5.1 resolution: "@polkadot/x-ws@npm:12.5.1" @@ -849,6 +1296,90 @@ __metadata: languageName: node linkType: hard +"@polkadot/x-ws@npm:^12.6.1": + version: 12.6.1 + resolution: "@polkadot/x-ws@npm:12.6.1" + dependencies: + "@polkadot/x-global": 12.6.1 + tslib: ^2.6.2 + ws: ^8.14.2 + checksum: f4303152c9a5bd6d0032f89f995de7f343a479b69fb3530c4a0e703f19af83501edeeab6e8cd53c910649457ec23fd2d1886579d2be4461d837a891a4614d70b + languageName: node + linkType: hard + +"@protobufjs/aspromise@npm:^1.1.1, @protobufjs/aspromise@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/aspromise@npm:1.1.2" + checksum: 011fe7ef0826b0fd1a95935a033a3c0fd08483903e1aa8f8b4e0704e3233406abb9ee25350ec0c20bbecb2aad8da0dcea58b392bbd77d6690736f02c143865d2 + languageName: node + linkType: hard + +"@protobufjs/base64@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/base64@npm:1.1.2" + checksum: 67173ac34de1e242c55da52c2f5bdc65505d82453893f9b51dc74af9fe4c065cf4a657a4538e91b0d4a1a1e0a0642215e31894c31650ff6e3831471061e1ee9e + languageName: node + linkType: hard + +"@protobufjs/codegen@npm:^2.0.4": + version: 2.0.4 + resolution: "@protobufjs/codegen@npm:2.0.4" + checksum: 59240c850b1d3d0b56d8f8098dd04787dcaec5c5bd8de186fa548de86b86076e1c50e80144b90335e705a044edf5bc8b0998548474c2a10a98c7e004a1547e4b + languageName: node + linkType: hard + +"@protobufjs/eventemitter@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/eventemitter@npm:1.1.0" + checksum: 0369163a3d226851682f855f81413cbf166cd98f131edb94a0f67f79e75342d86e89df9d7a1df08ac28be2bc77e0a7f0200526bb6c2a407abbfee1f0262d5fd7 + languageName: node + linkType: hard + +"@protobufjs/fetch@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/fetch@npm:1.1.0" + dependencies: + "@protobufjs/aspromise": ^1.1.1 + "@protobufjs/inquire": ^1.1.0 + checksum: 3fce7e09eb3f1171dd55a192066450f65324fd5f7cc01a431df01bb00d0a895e6bfb5b0c5561ce157ee1d886349c90703d10a4e11a1a256418ff591b969b3477 + languageName: node + linkType: hard + +"@protobufjs/float@npm:^1.0.2": + version: 1.0.2 + resolution: "@protobufjs/float@npm:1.0.2" + checksum: 5781e1241270b8bd1591d324ca9e3a3128d2f768077a446187a049e36505e91bc4156ed5ac3159c3ce3d2ba3743dbc757b051b2d723eea9cd367bfd54ab29b2f + languageName: node + linkType: hard + +"@protobufjs/inquire@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/inquire@npm:1.1.0" + checksum: ca06f02eaf65ca36fb7498fc3492b7fc087bfcc85c702bac5b86fad34b692bdce4990e0ef444c1e2aea8c034227bd1f0484be02810d5d7e931c55445555646f4 + languageName: node + linkType: hard + +"@protobufjs/path@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/path@npm:1.1.2" + checksum: 856eeb532b16a7aac071cacde5c5620df800db4c80cee6dbc56380524736205aae21e5ae47739114bf669ab5e8ba0e767a282ad894f3b5e124197cb9224445ee + languageName: node + linkType: hard + +"@protobufjs/pool@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/pool@npm:1.1.0" + checksum: d6a34fbbd24f729e2a10ee915b74e1d77d52214de626b921b2d77288bd8f2386808da2315080f2905761527cceffe7ec34c7647bd21a5ae41a25e8212ff79451 + languageName: node + linkType: hard + +"@protobufjs/utf8@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/utf8@npm:1.1.0" + checksum: f9bf3163d13aaa3b6f5e6fbf37a116e094ea021c0e1f2a7ccd0e12a29e2ce08dafba4e8b36e13f8ed7397e1591610ce880ed1289af4d66cf4ace8a36a9557278 + languageName: node + linkType: hard + "@scure/base@npm:^1.1.3": version: 1.1.3 resolution: "@scure/base@npm:1.1.3" @@ -880,14 +1411,59 @@ __metadata: languageName: node linkType: hard -"@substrate/ss58-registry@npm:^1.43.0": +"@substrate/connect@npm:0.7.35": + version: 0.7.35 + resolution: "@substrate/connect@npm:0.7.35" + dependencies: + "@substrate/connect-extension-protocol": ^1.0.1 + smoldot: 2.0.7 + checksum: 4f0cfb2b9521c5300cbcc0245e87b72484738e6cc8103ddf91e3516f627de546d0a152839824ac2716b8ea2f327f3eee0f74a9a07886ed4a091e3b7c1e989441 + languageName: node + linkType: hard + +"@substrate/ss58-registry@npm:^1.43.0, @substrate/ss58-registry@npm:^1.44.0": version: 1.44.0 resolution: "@substrate/ss58-registry@npm:1.44.0" checksum: 130fafc337a60bf22b1c01b8bd4fdbc2606a00483961bd173224478adb358a17b865d287cf99a2a32cb430d23d3a7969fce0457e8302dc48a98e1f666c7f6e40 languageName: node linkType: hard -"@types/bn.js@npm:^5.1.1": +"@tootallnate/once@npm:2": + version: 2.0.0 + resolution: "@tootallnate/once@npm:2.0.0" + checksum: ad87447820dd3f24825d2d947ebc03072b20a42bfc96cbafec16bff8bbda6c1a81fcb0be56d5b21968560c5359a0af4038a68ba150c3e1694fe4c109a063bed8 + languageName: node + linkType: hard + +"@tsconfig/node10@npm:^1.0.7": + version: 1.0.9 + resolution: "@tsconfig/node10@npm:1.0.9" + checksum: a33ae4dc2a621c0678ac8ac4bceb8e512ae75dac65417a2ad9b022d9b5411e863c4c198b6ba9ef659e14b9fb609bbec680841a2e84c1172df7a5ffcf076539df + languageName: node + linkType: hard + +"@tsconfig/node12@npm:^1.0.7": + version: 1.0.11 + resolution: "@tsconfig/node12@npm:1.0.11" + checksum: 5ce29a41b13e7897a58b8e2df11269c5395999e588b9a467386f99d1d26f6c77d1af2719e407621412520ea30517d718d5192a32403b8dfcc163bf33e40a338a + languageName: node + linkType: hard + +"@tsconfig/node14@npm:^1.0.0": + version: 1.0.3 + resolution: "@tsconfig/node14@npm:1.0.3" + checksum: 19275fe80c4c8d0ad0abed6a96dbf00642e88b220b090418609c4376e1cef81bf16237bf170ad1b341452feddb8115d8dd2e5acdfdea1b27422071163dc9ba9d + languageName: node + linkType: hard + +"@tsconfig/node16@npm:^1.0.2": + version: 1.0.4 + resolution: "@tsconfig/node16@npm:1.0.4" + checksum: 202319785901f942a6e1e476b872d421baec20cf09f4b266a1854060efbf78cde16a4d256e8bc949d31e6cd9a90f1e8ef8fb06af96a65e98338a2b6b0de0a0ff + languageName: node + linkType: hard + +"@types/bn.js@npm:^5.1.1, @types/bn.js@npm:^5.1.5": version: 5.1.5 resolution: "@types/bn.js@npm:5.1.5" dependencies: @@ -926,6 +1502,13 @@ __metadata: languageName: node linkType: hard +"@types/long@npm:^4.0.1": + version: 4.0.2 + resolution: "@types/long@npm:4.0.2" + checksum: d16cde7240d834cf44ba1eaec49e78ae3180e724cd667052b194a372f350d024cba8dd3f37b0864931683dab09ca935d52f0c4c1687178af5ada9fc85b0635f4 + languageName: node + linkType: hard + "@types/node@npm:*": version: 20.9.0 resolution: "@types/node@npm:20.9.0" @@ -935,6 +1518,15 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:>=13.7.0": + version: 20.9.4 + resolution: "@types/node@npm:20.9.4" + dependencies: + undici-types: ~5.26.4 + checksum: 619144cfee8235f692009e4268a8b80ef4ec496670273ab1cef04e4a053b471f391af6701e65f2f91a107256933d902b6caec079d551b109e981b0b706624815 + languageName: node + linkType: hard + "@types/semver@npm:^7.5.0": version: 7.5.5 resolution: "@types/semver@npm:7.5.5" @@ -1124,6 +1716,98 @@ __metadata: languageName: node linkType: hard +"@zombienet/cli@npm:^1.3.82": + version: 1.3.82 + resolution: "@zombienet/cli@npm:1.3.82" + dependencies: + "@zombienet/dsl-parser-wrapper": ^0.1.10 + "@zombienet/orchestrator": ^0.0.65 + "@zombienet/utils": ^0.0.24 + cli-progress: ^3.12.0 + commander: ^11.1.0 + debug: ^4.3.4 + nunjucks: ^3.2.4 + typescript: ^5.2.2 + bin: + zombienet: dist/cli.js + checksum: aef870236e344f9c84bd1a986e0f585705ff444dc1311a0809a9602c2659239bd32c423f868400433ac8c2efb775efe0e74b536c75ffb670598be0ff2b8d1215 + languageName: node + linkType: hard + +"@zombienet/dsl-parser-wrapper@npm:^0.1.10": + version: 0.1.10 + resolution: "@zombienet/dsl-parser-wrapper@npm:0.1.10" + checksum: 64bb34b757a247d8f80ac25f60bbc81a72afa257e8078e7141ce7a678c574a7215742b16846aacb33cb252f351a015f95ed826ccb2b85adef6300c3b59970dcf + languageName: node + linkType: hard + +"@zombienet/orchestrator@npm:^0.0.65": + version: 0.0.65 + resolution: "@zombienet/orchestrator@npm:0.0.65" + dependencies: + "@polkadot/api": ^10.11.1 + "@polkadot/keyring": ^12.6.1 + "@polkadot/util-crypto": ^12.6.1 + "@zombienet/utils": ^0.0.24 + JSONStream: ^1.3.5 + chai: ^4.3.10 + debug: ^4.3.4 + execa: ^5.1.1 + fs-extra: ^11.1.1 + jsdom: ^22.1.0 + json-bigint: ^1.0.0 + libp2p-crypto: ^0.21.2 + minimatch: ^9.0.3 + mocha: ^10.2.0 + napi-maybe-compressed-blob: ^0.0.11 + peer-id: ^0.16.0 + tmp-promise: ^3.0.3 + typescript: ^5.2.2 + yaml: ^2.3.4 + checksum: 56c37af6209396f33a9f110687a2ebd37f160c17bb66c59e95365d5e64ad87eceb86798d24615e536bac12ca477b6f3886b7a7d0148ba8c94c1e73000d2f20f1 + languageName: node + linkType: hard + +"@zombienet/utils@npm:^0.0.24": + version: 0.0.24 + resolution: "@zombienet/utils@npm:0.0.24" + dependencies: + cli-table3: ^0.6.3 + debug: ^4.3.4 + mocha: ^10.2.0 + nunjucks: ^3.2.4 + toml: ^3.0.0 + ts-node: ^10.9.1 + checksum: ba388da1acf68aeeaf82bb48635c68e6fde1b6c2b228016ed03f44013703c9b51fca9743beb470271d1003c0662e92c6c1646520e84e91ead37ca836e8330c4b + languageName: node + linkType: hard + +"JSONStream@npm:^1.3.5": + version: 1.3.5 + resolution: "JSONStream@npm:1.3.5" + dependencies: + jsonparse: ^1.2.0 + through: ">=2.2.7 <3" + bin: + JSONStream: ./bin.js + checksum: 2605fa124260c61bad38bb65eba30d2f72216a78e94d0ab19b11b4e0327d572b8d530c0c9cc3b0764f727ad26d39e00bf7ebad57781ca6368394d73169c59e46 + languageName: node + linkType: hard + +"a-sync-waterfall@npm:^1.0.0": + version: 1.0.1 + resolution: "a-sync-waterfall@npm:1.0.1" + checksum: 534948b50d6787c2dd5b7e89179b30c0fd96ac80a662d0f92eaa568cfffb36f1eea4aa720e3a21572d8b5f8686940954ac9d8c7667bcc719c1317ae3bdf86fe0 + languageName: node + linkType: hard + +"abab@npm:^2.0.6": + version: 2.0.6 + resolution: "abab@npm:2.0.6" + checksum: 6ffc1af4ff315066c62600123990d87551ceb0aafa01e6539da77b0f5987ac7019466780bf480f1787576d4385e3690c81ccc37cfda12819bf510b8ab47e5a3e + languageName: node + linkType: hard + "abbrev@npm:^2.0.0": version: 2.0.0 resolution: "abbrev@npm:2.0.0" @@ -1140,14 +1824,14 @@ __metadata: languageName: node linkType: hard -"acorn-walk@npm:^8.2.0": +"acorn-walk@npm:^8.1.1, acorn-walk@npm:^8.2.0": version: 8.3.0 resolution: "acorn-walk@npm:8.3.0" checksum: 15ea56ab6529135be05e7d018f935ca80a572355dd3f6d3cd717e36df3346e0f635a93ae781b1c7942607693e2e5f3ef81af5c6fc697bbadcc377ebda7b7f5f6 languageName: node linkType: hard -"acorn@npm:^8.10.0, acorn@npm:^8.9.0": +"acorn@npm:^8.10.0, acorn@npm:^8.4.1, acorn@npm:^8.9.0": version: 8.11.2 resolution: "acorn@npm:8.11.2" bin: @@ -1156,6 +1840,15 @@ __metadata: languageName: node linkType: hard +"agent-base@npm:6": + version: 6.0.2 + resolution: "agent-base@npm:6.0.2" + dependencies: + debug: 4 + checksum: f52b6872cc96fd5f622071b71ef200e01c7c4c454ee68bc9accca90c98cfb39f2810e3e9aa330435835eedc8c23f4f8a15267f67c6e245d2b33757575bdac49d + languageName: node + linkType: hard + "agent-base@npm:^7.0.2, agent-base@npm:^7.1.0": version: 7.1.0 resolution: "agent-base@npm:7.1.0" @@ -1187,6 +1880,13 @@ __metadata: languageName: node linkType: hard +"ansi-colors@npm:4.1.1": + version: 4.1.1 + resolution: "ansi-colors@npm:4.1.1" + checksum: 138d04a51076cb085da0a7e2d000c5c0bb09f6e772ed5c65c53cb118d37f6c5f1637506d7155fb5f330f0abcf6f12fa2e489ac3f8cdab9da393bf1bb4f9a32b0 + languageName: node + linkType: hard + "ansi-regex@npm:^5.0.1": version: 5.0.1 resolution: "ansi-regex@npm:5.0.1" @@ -1224,6 +1924,23 @@ __metadata: languageName: node linkType: hard +"anymatch@npm:~3.1.2": + version: 3.1.3 + resolution: "anymatch@npm:3.1.3" + dependencies: + normalize-path: ^3.0.0 + picomatch: ^2.0.4 + checksum: 3e044fd6d1d26545f235a9fe4d7a534e2029d8e59fa7fd9f2a6eb21230f6b5380ea1eaf55136e60cbf8e613544b3b766e7a6fa2102e2a3a117505466e3025dc2 + languageName: node + linkType: hard + +"arg@npm:^4.1.0": + version: 4.1.3 + resolution: "arg@npm:4.1.3" + checksum: 544af8dd3f60546d3e4aff084d451b96961d2267d668670199692f8d054f0415d86fc5497d0e641e91546f0aa920e7c29e5250e99fc89f5552a34b5d93b77f43 + languageName: node + linkType: hard + "argparse@npm:^2.0.1": version: 2.0.1 resolution: "argparse@npm:2.0.1" @@ -1313,6 +2030,13 @@ __metadata: languageName: node linkType: hard +"asap@npm:^2.0.3": + version: 2.0.6 + resolution: "asap@npm:2.0.6" + checksum: b296c92c4b969e973260e47523207cd5769abd27c245a68c26dc7a0fe8053c55bb04360237cb51cab1df52be939da77150ace99ad331fb7fb13b3423ed73ff3d + languageName: node + linkType: hard + "assertion-error@npm:^1.1.0": version: 1.1.0 resolution: "assertion-error@npm:1.1.0" @@ -1320,6 +2044,13 @@ __metadata: languageName: node linkType: hard +"asynckit@npm:^0.4.0": + version: 0.4.0 + resolution: "asynckit@npm:0.4.0" + checksum: 7b78c451df768adba04e2d02e63e2d0bf3b07adcd6e42b4cf665cb7ce899bedd344c69a1dcbce355b5f972d597b25aaa1c1742b52cffd9caccb22f348114f6be + languageName: node + linkType: hard + "available-typed-arrays@npm:^1.0.5": version: 1.0.5 resolution: "available-typed-arrays@npm:1.0.5" @@ -1334,6 +2065,20 @@ __metadata: languageName: node linkType: hard +"bignumber.js@npm:^9.0.0": + version: 9.1.2 + resolution: "bignumber.js@npm:9.1.2" + checksum: 582c03af77ec9cb0ebd682a373ee6c66475db94a4325f92299621d544aa4bd45cb45fd60001610e94aef8ae98a0905fa538241d9638d4422d57abbeeac6fadaf + languageName: node + linkType: hard + +"binary-extensions@npm:^2.0.0": + version: 2.2.0 + resolution: "binary-extensions@npm:2.2.0" + checksum: ccd267956c58d2315f5d3ea6757cf09863c5fc703e50fbeb13a7dc849b812ef76e3cf9ca8f35a0c48498776a7478d7b4a0418e1e2b8cb9cb9731f2922aaad7f8 + languageName: node + linkType: hard + "bn.js@npm:^5.2.1": version: 5.2.1 resolution: "bn.js@npm:5.2.1" @@ -1360,7 +2105,7 @@ __metadata: languageName: node linkType: hard -"braces@npm:^3.0.2": +"braces@npm:^3.0.2, braces@npm:~3.0.2": version: 3.0.2 resolution: "braces@npm:3.0.2" dependencies: @@ -1369,6 +2114,13 @@ __metadata: languageName: node linkType: hard +"browser-stdout@npm:1.3.1": + version: 1.3.1 + resolution: "browser-stdout@npm:1.3.1" + checksum: b717b19b25952dd6af483e368f9bcd6b14b87740c3d226c2977a65e84666ffd67000bddea7d911f111a9b6ddc822b234de42d52ab6507bce4119a4cc003ef7b3 + languageName: node + linkType: hard + "cac@npm:^6.7.14": version: 6.7.14 resolution: "cac@npm:6.7.14" @@ -1414,6 +2166,13 @@ __metadata: languageName: node linkType: hard +"camelcase@npm:^6.0.0": + version: 6.3.0 + resolution: "camelcase@npm:6.3.0" + checksum: 8c96818a9076434998511251dcb2761a94817ea17dbdc37f47ac080bd088fc62c7369429a19e2178b993497132c8cbcf5cc1f44ba963e76782ba469c0474938d + languageName: node + linkType: hard + "cbor-web@npm:^9.0.0": version: 9.0.1 resolution: "cbor-web@npm:9.0.1" @@ -1421,7 +2180,7 @@ __metadata: languageName: node linkType: hard -"chai@npm:^4.3.7": +"chai@npm:^4.3.10, chai@npm:^4.3.7": version: 4.3.10 resolution: "chai@npm:4.3.10" dependencies: @@ -1436,7 +2195,7 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^4.0.0": +"chalk@npm:^4.0.0, chalk@npm:^4.1.0": version: 4.1.2 resolution: "chalk@npm:4.1.2" dependencies: @@ -1455,6 +2214,25 @@ __metadata: languageName: node linkType: hard +"chokidar@npm:3.5.3": + version: 3.5.3 + resolution: "chokidar@npm:3.5.3" + dependencies: + anymatch: ~3.1.2 + braces: ~3.0.2 + fsevents: ~2.3.2 + glob-parent: ~5.1.2 + is-binary-path: ~2.1.0 + is-glob: ~4.0.1 + normalize-path: ~3.0.0 + readdirp: ~3.6.0 + dependenciesMeta: + fsevents: + optional: true + checksum: b49fcde40176ba007ff361b198a2d35df60d9bb2a5aab228279eb810feae9294a6b4649ab15981304447afe1e6ffbf4788ad5db77235dc770ab777c6e771980c + languageName: node + linkType: hard + "chownr@npm:^2.0.0": version: 2.0.0 resolution: "chownr@npm:2.0.0" @@ -1462,6 +2240,13 @@ __metadata: languageName: node linkType: hard +"class-is@npm:^1.1.0": + version: 1.1.0 + resolution: "class-is@npm:1.1.0" + checksum: 49024de3b264fc501a38dd59d8668f1a2b4973fa6fcef6b83d80fe6fe99a2000a8fbea5b50d4607169c65014843c9f6b41a4f8473df806c1b4787b4d47521880 + languageName: node + linkType: hard + "clean-stack@npm:^2.0.0": version: 2.2.0 resolution: "clean-stack@npm:2.2.0" @@ -1469,6 +2254,39 @@ __metadata: languageName: node linkType: hard +"cli-progress@npm:^3.12.0": + version: 3.12.0 + resolution: "cli-progress@npm:3.12.0" + dependencies: + string-width: ^4.2.3 + checksum: e8390dc3cdf3c72ecfda0a1e8997bfed63a0d837f97366bbce0ca2ff1b452da386caed007b389f0fe972625037b6c8e7ab087c69d6184cc4dfc8595c4c1d3e6e + languageName: node + linkType: hard + +"cli-table3@npm:^0.6.3": + version: 0.6.3 + resolution: "cli-table3@npm:0.6.3" + dependencies: + "@colors/colors": 1.5.0 + string-width: ^4.2.0 + dependenciesMeta: + "@colors/colors": + optional: true + checksum: 09897f68467973f827c04e7eaadf13b55f8aec49ecd6647cc276386ea660059322e2dd8020a8b6b84d422dbdd619597046fa89cbbbdc95b2cea149a2df7c096c + languageName: node + linkType: hard + +"cliui@npm:^7.0.2": + version: 7.0.4 + resolution: "cliui@npm:7.0.4" + dependencies: + string-width: ^4.2.0 + strip-ansi: ^6.0.0 + wrap-ansi: ^7.0.0 + checksum: ce2e8f578a4813806788ac399b9e866297740eecd4ad1823c27fd344d78b22c5f8597d548adbcc46f0573e43e21e751f39446c5a5e804a12aace402b7a315d7f + languageName: node + linkType: hard + "color-convert@npm:^2.0.1": version: 2.0.1 resolution: "color-convert@npm:2.0.1" @@ -1485,6 +2303,29 @@ __metadata: languageName: node linkType: hard +"combined-stream@npm:^1.0.8": + version: 1.0.8 + resolution: "combined-stream@npm:1.0.8" + dependencies: + delayed-stream: ~1.0.0 + checksum: 49fa4aeb4916567e33ea81d088f6584749fc90c7abec76fd516bf1c5aa5c79f3584b5ba3de6b86d26ddd64bae5329c4c7479343250cfe71c75bb366eae53bb7c + languageName: node + linkType: hard + +"commander@npm:^11.1.0": + version: 11.1.0 + resolution: "commander@npm:11.1.0" + checksum: fd1a8557c6b5b622c89ecdfde703242ab7db3b628ea5d1755784c79b8e7cb0d74d65b4a262289b533359cd58e1bfc0bf50245dfbcd2954682a6f367c828b79ef + languageName: node + linkType: hard + +"commander@npm:^5.1.0": + version: 5.1.0 + resolution: "commander@npm:5.1.0" + checksum: 0b7fec1712fbcc6230fcb161d8d73b4730fa91a21dc089515489402ad78810547683f058e2a9835929c212fead1d6a6ade70db28bbb03edbc2829a9ab7d69447 + languageName: node + linkType: hard + "concat-map@npm:0.0.1": version: 0.0.1 resolution: "concat-map@npm:0.0.1" @@ -1492,7 +2333,14 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2": +"create-require@npm:^1.1.0": + version: 1.1.1 + resolution: "create-require@npm:1.1.1" + checksum: a9a1503d4390d8b59ad86f4607de7870b39cad43d929813599a23714831e81c520bddf61bcdd1f8e30f05fd3a2b71ae8538e946eb2786dc65c2bbc520f692eff + languageName: node + linkType: hard + +"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": version: 7.0.3 resolution: "cross-spawn@npm:7.0.3" dependencies: @@ -1503,6 +2351,15 @@ __metadata: languageName: node linkType: hard +"cssstyle@npm:^3.0.0": + version: 3.0.0 + resolution: "cssstyle@npm:3.0.0" + dependencies: + rrweb-cssom: ^0.6.0 + checksum: 31f694dfed9998ed93570fe539610837b878193dd8487c33cb12db8004333c53c2a3904166288bbec68388c72fb01014d46d3243ddfb02fe845989d852c06f27 + languageName: node + linkType: hard + "data-uri-to-buffer@npm:^4.0.0": version: 4.0.1 resolution: "data-uri-to-buffer@npm:4.0.1" @@ -1510,7 +2367,18 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.4": +"data-urls@npm:^4.0.0": + version: 4.0.0 + resolution: "data-urls@npm:4.0.0" + dependencies: + abab: ^2.0.6 + whatwg-mimetype: ^3.0.0 + whatwg-url: ^12.0.0 + checksum: 006e869b5bf079647949a3e9b1dd69d84b2d5d26e6b01c265485699bc96e83817d4b5aae758b2910a4c58c0601913f3a0034121c1ca2da268e9a244c57515b15 + languageName: node + linkType: hard + +"debug@npm:4, debug@npm:4.3.4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: @@ -1531,6 +2399,20 @@ __metadata: languageName: node linkType: hard +"decamelize@npm:^4.0.0": + version: 4.0.0 + resolution: "decamelize@npm:4.0.0" + checksum: b7d09b82652c39eead4d6678bb578e3bebd848add894b76d0f6b395bc45b2d692fb88d977e7cfb93c4ed6c119b05a1347cef261174916c2e75c0a8ca57da1809 + languageName: node + linkType: hard + +"decimal.js@npm:^10.4.3": + version: 10.4.3 + resolution: "decimal.js@npm:10.4.3" + checksum: 796404dcfa9d1dbfdc48870229d57f788b48c21c603c3f6554a1c17c10195fc1024de338b0cf9e1efe0c7c167eeb18f04548979bcc5fdfabebb7cc0ae3287bae + languageName: node + linkType: hard + "deep-eql@npm:^4.1.3": version: 4.1.3 resolution: "deep-eql@npm:4.1.3" @@ -1569,6 +2451,13 @@ __metadata: languageName: node linkType: hard +"delayed-stream@npm:~1.0.0": + version: 1.0.0 + resolution: "delayed-stream@npm:1.0.0" + checksum: 46fe6e83e2cb1d85ba50bd52803c68be9bd953282fa7096f51fc29edd5d67ff84ff753c51966061e5ba7cb5e47ef6d36a91924eddb7f3f3483b1c560f77a0020 + languageName: node + linkType: hard + "diff-sequences@npm:^29.4.3": version: 29.6.3 resolution: "diff-sequences@npm:29.6.3" @@ -1576,6 +2465,20 @@ __metadata: languageName: node linkType: hard +"diff@npm:5.0.0": + version: 5.0.0 + resolution: "diff@npm:5.0.0" + checksum: f19fe29284b633afdb2725c2a8bb7d25761ea54d321d8e67987ac851c5294be4afeab532bd84531e02583a3fe7f4014aa314a3eda84f5590e7a9e6b371ef3b46 + languageName: node + linkType: hard + +"diff@npm:^4.0.1": + version: 4.0.2 + resolution: "diff@npm:4.0.2" + checksum: f2c09b0ce4e6b301c221addd83bf3f454c0bc00caa3dd837cf6c127d6edf7223aa2bbe3b688feea110b7f262adbfc845b757c44c8a9f8c0c5b15d8fa9ce9d20d + languageName: node + linkType: hard + "dir-glob@npm:^3.0.1": version: 3.0.1 resolution: "dir-glob@npm:3.0.1" @@ -1603,6 +2506,15 @@ __metadata: languageName: node linkType: hard +"domexception@npm:^4.0.0": + version: 4.0.0 + resolution: "domexception@npm:4.0.0" + dependencies: + webidl-conversions: ^7.0.0 + checksum: ddbc1268edf33a8ba02ccc596735ede80375ee0cf124b30d2f05df5b464ba78ef4f49889b6391df4a04954e63d42d5631c7fcf8b1c4f12bc531252977a5f13d5 + languageName: node + linkType: hard + "eastasianwidth@npm:^0.2.0": version: 0.2.0 resolution: "eastasianwidth@npm:0.2.0" @@ -1633,6 +2545,13 @@ __metadata: languageName: node linkType: hard +"entities@npm:^4.4.0": + version: 4.5.0 + resolution: "entities@npm:4.5.0" + checksum: 853f8ebd5b425d350bffa97dd6958143179a5938352ccae092c62d1267c4e392a039be1bae7d51b6e4ffad25f51f9617531fedf5237f15df302ccfb452cbf2d7 + languageName: node + linkType: hard + "env-paths@npm:^2.2.0": version: 2.2.1 resolution: "env-paths@npm:2.2.1" @@ -1647,6 +2566,13 @@ __metadata: languageName: node linkType: hard +"err-code@npm:^3.0.1": + version: 3.0.1 + resolution: "err-code@npm:3.0.1" + checksum: aede1f1d5ebe6d6b30b5e3175e3cc13e67de2e2e1ad99ce4917e957d7b59e8451ed10ee37dbc6493521920a47082c479b9097e5c39438d4aff4cc84438568a5a + languageName: node + linkType: hard + "error-stack-parser@npm:^1.3.6": version: 1.3.6 resolution: "error-stack-parser@npm:1.3.6" @@ -1811,7 +2737,14 @@ __metadata: languageName: node linkType: hard -"escape-string-regexp@npm:^4.0.0": +"escalade@npm:^3.1.1": + version: 3.1.1 + resolution: "escalade@npm:3.1.1" + checksum: a3e2a99f07acb74b3ad4989c48ca0c3140f69f923e56d0cba0526240ee470b91010f9d39001f2a4a313841d237ede70a729e92125191ba5d21e74b106800b133 + languageName: node + linkType: hard + +"escape-string-regexp@npm:4.0.0, escape-string-regexp@npm:^4.0.0": version: 4.0.0 resolution: "escape-string-regexp@npm:4.0.0" checksum: 98b48897d93060f2322108bf29db0feba7dd774be96cd069458d1453347b25ce8682ecc39859d4bca2203cc0ab19c237bcc71755eff49a0f8d90beadeeba5cc5 @@ -2003,6 +2936,30 @@ __metadata: languageName: node linkType: hard +"events@npm:^3.3.0": + version: 3.3.0 + resolution: "events@npm:3.3.0" + checksum: f6f487ad2198aa41d878fa31452f1a3c00958f46e9019286ff4787c84aac329332ab45c9cdc8c445928fc6d7ded294b9e005a7fce9426488518017831b272780 + languageName: node + linkType: hard + +"execa@npm:^5.1.1": + version: 5.1.1 + resolution: "execa@npm:5.1.1" + dependencies: + cross-spawn: ^7.0.3 + get-stream: ^6.0.0 + human-signals: ^2.1.0 + is-stream: ^2.0.0 + merge-stream: ^2.0.0 + npm-run-path: ^4.0.1 + onetime: ^5.1.2 + signal-exit: ^3.0.3 + strip-final-newline: ^2.0.0 + checksum: fba9022c8c8c15ed862847e94c252b3d946036d7547af310e344a527e59021fd8b6bb0723883ea87044dc4f0201f949046993124a42ccb0855cae5bf8c786343 + languageName: node + linkType: hard + "exponential-backoff@npm:^3.1.1": version: 3.1.1 resolution: "exponential-backoff@npm:3.1.1" @@ -2081,7 +3038,7 @@ __metadata: languageName: node linkType: hard -"find-up@npm:^5.0.0": +"find-up@npm:5.0.0, find-up@npm:^5.0.0": version: 5.0.0 resolution: "find-up@npm:5.0.0" dependencies: @@ -2102,6 +3059,15 @@ __metadata: languageName: node linkType: hard +"flat@npm:^5.0.2": + version: 5.0.2 + resolution: "flat@npm:5.0.2" + bin: + flat: cli.js + checksum: 12a1536ac746db74881316a181499a78ef953632ddd28050b7a3a43c62ef5462e3357c8c29d76072bb635f147f7a9a1f0c02efef6b4be28f8db62ceb3d5c7f5d + languageName: node + linkType: hard + "flatted@npm:^3.2.9": version: 3.2.9 resolution: "flatted@npm:3.2.9" @@ -2128,6 +3094,17 @@ __metadata: languageName: node linkType: hard +"form-data@npm:^4.0.0": + version: 4.0.0 + resolution: "form-data@npm:4.0.0" + dependencies: + asynckit: ^0.4.0 + combined-stream: ^1.0.8 + mime-types: ^2.1.12 + checksum: 01135bf8675f9d5c61ff18e2e2932f719ca4de964e3be90ef4c36aacfc7b9cb2fceb5eca0b7e0190e3383fe51c5b37f4cb80b62ca06a99aaabfcfd6ac7c9328c + languageName: node + linkType: hard + "formdata-polyfill@npm:^4.0.10": version: 4.0.10 resolution: "formdata-polyfill@npm:4.0.10" @@ -2137,6 +3114,17 @@ __metadata: languageName: node linkType: hard +"fs-extra@npm:^11.1.1": + version: 11.1.1 + resolution: "fs-extra@npm:11.1.1" + dependencies: + graceful-fs: ^4.2.0 + jsonfile: ^6.0.1 + universalify: ^2.0.0 + checksum: fb883c68245b2d777fbc1f2082c9efb084eaa2bbf9fddaa366130d196c03608eebef7fb490541276429ee1ca99f317e2d73e96f5ca0999eefedf5a624ae1edfd + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -2207,6 +3195,13 @@ __metadata: languageName: node linkType: hard +"get-caller-file@npm:^2.0.5": + version: 2.0.5 + resolution: "get-caller-file@npm:2.0.5" + checksum: b9769a836d2a98c3ee734a88ba712e62703f1df31b94b784762c433c27a386dd6029ff55c2a920c392e33657d80191edbf18c61487e198844844516f843496b9 + languageName: node + linkType: hard + "get-func-name@npm:^2.0.1, get-func-name@npm:^2.0.2": version: 2.0.2 resolution: "get-func-name@npm:2.0.2" @@ -2226,6 +3221,13 @@ __metadata: languageName: node linkType: hard +"get-stream@npm:^6.0.0": + version: 6.0.1 + resolution: "get-stream@npm:6.0.1" + checksum: e04ecece32c92eebf5b8c940f51468cd53554dcbb0ea725b2748be583c9523d00128137966afce410b9b051eb2ef16d657cd2b120ca8edafcf5a65e81af63cad + languageName: node + linkType: hard + "get-symbol-description@npm:^1.0.0": version: 1.0.0 resolution: "get-symbol-description@npm:1.0.0" @@ -2236,7 +3238,7 @@ __metadata: languageName: node linkType: hard -"glob-parent@npm:^5.1.2": +"glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" dependencies: @@ -2254,6 +3256,20 @@ __metadata: languageName: node linkType: hard +"glob@npm:7.2.0": + version: 7.2.0 + resolution: "glob@npm:7.2.0" + dependencies: + fs.realpath: ^1.0.0 + inflight: ^1.0.4 + inherits: 2 + minimatch: ^3.0.4 + once: ^1.3.0 + path-is-absolute: ^1.0.0 + checksum: 78a8ea942331f08ed2e055cb5b9e40fe6f46f579d7fd3d694f3412fe5db23223d29b7fee1575440202e9a7ff9a72ab106a39fee39934c7bedafe5e5f8ae20134 + languageName: node + linkType: hard + "glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.3.7": version: 10.3.10 resolution: "glob@npm:10.3.10" @@ -2324,7 +3340,7 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:^4.2.6": +"graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.6": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" checksum: ac85f94da92d8eb6b7f5a8b20ce65e43d66761c55ce85ac96df6865308390da45a8d3f0296dd3a663de65d30ba497bd46c696cc1e248c72b13d6d567138a4fc7 @@ -2393,6 +3409,24 @@ __metadata: languageName: node linkType: hard +"he@npm:1.2.0": + version: 1.2.0 + resolution: "he@npm:1.2.0" + bin: + he: bin/he + checksum: 3d4d6babccccd79c5c5a3f929a68af33360d6445587d628087f39a965079d84f18ce9c3d3f917ee1e3978916fc833bb8b29377c3b403f919426f91bc6965e7a7 + languageName: node + linkType: hard + +"html-encoding-sniffer@npm:^3.0.0": + version: 3.0.0 + resolution: "html-encoding-sniffer@npm:3.0.0" + dependencies: + whatwg-encoding: ^2.0.0 + checksum: 8d806aa00487e279e5ccb573366a951a9f68f65c90298eac9c3a2b440a7ffe46615aff2995a2f61c6746c639234e6179a97e18ca5ccbbf93d3725ef2099a4502 + languageName: node + linkType: hard + "http-cache-semantics@npm:^4.1.1": version: 4.1.1 resolution: "http-cache-semantics@npm:4.1.1" @@ -2400,6 +3434,17 @@ __metadata: languageName: node linkType: hard +"http-proxy-agent@npm:^5.0.0": + version: 5.0.0 + resolution: "http-proxy-agent@npm:5.0.0" + dependencies: + "@tootallnate/once": 2 + agent-base: 6 + debug: 4 + checksum: e2ee1ff1656a131953839b2a19cd1f3a52d97c25ba87bd2559af6ae87114abf60971e498021f9b73f9fd78aea8876d1fb0d4656aac8a03c6caa9fc175f22b786 + languageName: node + linkType: hard + "http-proxy-agent@npm:^7.0.0": version: 7.0.0 resolution: "http-proxy-agent@npm:7.0.0" @@ -2410,6 +3455,16 @@ __metadata: languageName: node linkType: hard +"https-proxy-agent@npm:^5.0.1": + version: 5.0.1 + resolution: "https-proxy-agent@npm:5.0.1" + dependencies: + agent-base: 6 + debug: 4 + checksum: 571fccdf38184f05943e12d37d6ce38197becdd69e58d03f43637f7fa1269cf303a7d228aa27e5b27bbd3af8f09fd938e1c91dcfefff2df7ba77c20ed8dfc765 + languageName: node + linkType: hard + "https-proxy-agent@npm:^7.0.1": version: 7.0.2 resolution: "https-proxy-agent@npm:7.0.2" @@ -2420,7 +3475,14 @@ __metadata: languageName: node linkType: hard -"iconv-lite@npm:^0.6.2": +"human-signals@npm:^2.1.0": + version: 2.1.0 + resolution: "human-signals@npm:2.1.0" + checksum: b87fd89fce72391625271454e70f67fe405277415b48bcc0117ca73d31fa23a4241787afdc8d67f5a116cf37258c052f59ea82daffa72364d61351423848e3b8 + languageName: node + linkType: hard + +"iconv-lite@npm:0.6.3, iconv-lite@npm:^0.6.2": version: 0.6.3 resolution: "iconv-lite@npm:0.6.3" dependencies: @@ -2470,7 +3532,7 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2": +"inherits@npm:2, inherits@npm:^2.0.3": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 @@ -2515,6 +3577,15 @@ __metadata: languageName: node linkType: hard +"is-binary-path@npm:~2.1.0": + version: 2.1.0 + resolution: "is-binary-path@npm:2.1.0" + dependencies: + binary-extensions: ^2.0.0 + checksum: 84192eb88cff70d320426f35ecd63c3d6d495da9d805b19bc65b518984b7c0760280e57dbf119b7e9be6b161784a5a673ab2c6abe83abb5198a432232ad5b35c + languageName: node + linkType: hard + "is-boolean-object@npm:^1.1.0": version: 1.1.2 resolution: "is-boolean-object@npm:1.1.2" @@ -2564,7 +3635,7 @@ __metadata: languageName: node linkType: hard -"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3": +"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3, is-glob@npm:~4.0.1": version: 4.0.3 resolution: "is-glob@npm:4.0.3" dependencies: @@ -2610,6 +3681,20 @@ __metadata: languageName: node linkType: hard +"is-plain-obj@npm:^2.1.0": + version: 2.1.0 + resolution: "is-plain-obj@npm:2.1.0" + checksum: cec9100678b0a9fe0248a81743041ed990c2d4c99f893d935545cfbc42876cbe86d207f3b895700c690ad2fa520e568c44afc1605044b535a7820c1d40e38daa + languageName: node + linkType: hard + +"is-potential-custom-element-name@npm:^1.0.1": + version: 1.0.1 + resolution: "is-potential-custom-element-name@npm:1.0.1" + checksum: ced7bbbb6433a5b684af581872afe0e1767e2d1146b2207ca0068a648fb5cab9d898495d1ac0583524faaf24ca98176a7d9876363097c2d14fee6dd324f3a1ab + languageName: node + linkType: hard + "is-regex@npm:^1.1.4": version: 1.1.4 resolution: "is-regex@npm:1.1.4" @@ -2629,6 +3714,13 @@ __metadata: languageName: node linkType: hard +"is-stream@npm:^2.0.0": + version: 2.0.1 + resolution: "is-stream@npm:2.0.1" + checksum: b8e05ccdf96ac330ea83c12450304d4a591f9958c11fd17bed240af8d5ffe08aedafa4c0f4cfccd4d28dc9d4d129daca1023633d5c11601a6cbc77521f6fae66 + languageName: node + linkType: hard + "is-string@npm:^1.0.5, is-string@npm:^1.0.7": version: 1.0.7 resolution: "is-string@npm:1.0.7" @@ -2656,6 +3748,13 @@ __metadata: languageName: node linkType: hard +"is-unicode-supported@npm:^0.1.0": + version: 0.1.0 + resolution: "is-unicode-supported@npm:0.1.0" + checksum: a2aab86ee7712f5c2f999180daaba5f361bdad1efadc9610ff5b8ab5495b86e4f627839d085c6530363c6d6d4ecbde340fb8e54bdb83da4ba8e0865ed5513c52 + languageName: node + linkType: hard + "is-weakref@npm:^1.0.2": version: 1.0.2 resolution: "is-weakref@npm:1.0.2" @@ -2686,6 +3785,16 @@ __metadata: languageName: node linkType: hard +"iso-random-stream@npm:^2.0.0": + version: 2.0.2 + resolution: "iso-random-stream@npm:2.0.2" + dependencies: + events: ^3.3.0 + readable-stream: ^3.4.0 + checksum: 53d44061cc7a000df4a35aa544fe04c7d0c903238ee8bb903b5eb280edaa6862512f7f7804cc4e35598e20accf9effc1131bdd6c8f5554ccf96e731ce969d77b + languageName: node + linkType: hard + "jackspeak@npm:^2.3.5": version: 2.3.6 resolution: "jackspeak@npm:2.3.6" @@ -2699,7 +3808,7 @@ __metadata: languageName: node linkType: hard -"js-yaml@npm:^4.1.0": +"js-yaml@npm:4.1.0, js-yaml@npm:^4.1.0": version: 4.1.0 resolution: "js-yaml@npm:4.1.0" dependencies: @@ -2710,6 +3819,51 @@ __metadata: languageName: node linkType: hard +"jsdom@npm:^22.1.0": + version: 22.1.0 + resolution: "jsdom@npm:22.1.0" + dependencies: + abab: ^2.0.6 + cssstyle: ^3.0.0 + data-urls: ^4.0.0 + decimal.js: ^10.4.3 + domexception: ^4.0.0 + form-data: ^4.0.0 + html-encoding-sniffer: ^3.0.0 + http-proxy-agent: ^5.0.0 + https-proxy-agent: ^5.0.1 + is-potential-custom-element-name: ^1.0.1 + nwsapi: ^2.2.4 + parse5: ^7.1.2 + rrweb-cssom: ^0.6.0 + saxes: ^6.0.0 + symbol-tree: ^3.2.4 + tough-cookie: ^4.1.2 + w3c-xmlserializer: ^4.0.0 + webidl-conversions: ^7.0.0 + whatwg-encoding: ^2.0.0 + whatwg-mimetype: ^3.0.0 + whatwg-url: ^12.0.1 + ws: ^8.13.0 + xml-name-validator: ^4.0.0 + peerDependencies: + canvas: ^2.5.0 + peerDependenciesMeta: + canvas: + optional: true + checksum: d955ab83a6dad3e6af444098d30647c719bbb4cf97de053aa5751c03c8d6f3283d8c4d7fc2774c181f1d432fb0250e7332bc159e6b466424f4e337d73adcbf30 + languageName: node + linkType: hard + +"json-bigint@npm:^1.0.0": + version: 1.0.0 + resolution: "json-bigint@npm:1.0.0" + dependencies: + bignumber.js: ^9.0.0 + checksum: c67bb93ccb3c291e60eb4b62931403e378906aab113ec1c2a8dd0f9a7f065ad6fd9713d627b732abefae2e244ac9ce1721c7a3142b2979532f12b258634ce6f6 + languageName: node + linkType: hard + "json-buffer@npm:3.0.1": version: 3.0.1 resolution: "json-buffer@npm:3.0.1" @@ -2756,6 +3910,26 @@ __metadata: languageName: node linkType: hard +"jsonfile@npm:^6.0.1": + version: 6.1.0 + resolution: "jsonfile@npm:6.1.0" + dependencies: + graceful-fs: ^4.1.6 + universalify: ^2.0.0 + dependenciesMeta: + graceful-fs: + optional: true + checksum: 7af3b8e1ac8fe7f1eccc6263c6ca14e1966fcbc74b618d3c78a0a2075579487547b94f72b7a1114e844a1e15bb00d440e5d1720bfc4612d790a6f285d5ea8354 + languageName: node + linkType: hard + +"jsonparse@npm:^1.2.0": + version: 1.3.1 + resolution: "jsonparse@npm:1.3.1" + checksum: 6514a7be4674ebf407afca0eda3ba284b69b07f9958a8d3113ef1005f7ec610860c312be067e450c569aab8b89635e332cee3696789c750692bb60daba627f4d + languageName: node + linkType: hard + "keyv@npm:^4.5.3": version: 4.5.4 resolution: "keyv@npm:4.5.4" @@ -2775,6 +3949,22 @@ __metadata: languageName: node linkType: hard +"libp2p-crypto@npm:^0.21.0, libp2p-crypto@npm:^0.21.2": + version: 0.21.2 + resolution: "libp2p-crypto@npm:0.21.2" + dependencies: + "@noble/ed25519": ^1.5.1 + "@noble/secp256k1": ^1.3.0 + err-code: ^3.0.1 + iso-random-stream: ^2.0.0 + multiformats: ^9.4.5 + node-forge: ^1.2.1 + protobufjs: ^6.11.2 + uint8arrays: ^3.0.0 + checksum: e03f8398db3a2913374b6a4b13560aec0c8e2d244c80fa0b2f119600789c445b235be01987580262a91d63e590f0f1a185728ea4b8697e5d4dfc9ec6da5266d6 + languageName: node + linkType: hard + "local-pkg@npm:^0.4.3": version: 0.4.3 resolution: "local-pkg@npm:0.4.3" @@ -2798,6 +3988,23 @@ __metadata: languageName: node linkType: hard +"log-symbols@npm:4.1.0": + version: 4.1.0 + resolution: "log-symbols@npm:4.1.0" + dependencies: + chalk: ^4.1.0 + is-unicode-supported: ^0.1.0 + checksum: fce1497b3135a0198803f9f07464165e9eb83ed02ceb2273930a6f8a508951178d8cf4f0378e9d28300a2ed2bc49050995d2bd5f53ab716bb15ac84d58c6ef74 + languageName: node + linkType: hard + +"long@npm:^4.0.0": + version: 4.0.0 + resolution: "long@npm:4.0.0" + checksum: 16afbe8f749c7c849db1f4de4e2e6a31ac6e617cead3bdc4f9605cb703cd20e1e9fc1a7baba674ffcca57d660a6e5b53a9e236d7b25a295d3855cca79cc06744 + languageName: node + linkType: hard + "loupe@npm:^2.3.6": version: 2.3.7 resolution: "loupe@npm:2.3.7" @@ -2834,6 +4041,13 @@ __metadata: languageName: node linkType: hard +"make-error@npm:^1.1.1": + version: 1.3.6 + resolution: "make-error@npm:1.3.6" + checksum: b86e5e0e25f7f777b77fabd8e2cbf15737972869d852a22b7e73c17623928fccb826d8e46b9951501d3f20e51ad74ba8c59ed584f610526a48f8ccf88aaec402 + languageName: node + linkType: hard + "make-fetch-happen@npm:^13.0.0": version: 13.0.0 resolution: "make-fetch-happen@npm:13.0.0" @@ -2853,6 +4067,13 @@ __metadata: languageName: node linkType: hard +"merge-stream@npm:^2.0.0": + version: 2.0.0 + resolution: "merge-stream@npm:2.0.0" + checksum: 6fa4dcc8d86629705cea944a4b88ef4cb0e07656ebf223fa287443256414283dd25d91c1cd84c77987f2aec5927af1a9db6085757cb43d90eb170ebf4b47f4f4 + languageName: node + linkType: hard + "merge2@npm:^1.3.0, merge2@npm:^1.4.1": version: 1.4.1 resolution: "merge2@npm:1.4.1" @@ -2870,7 +4091,39 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": +"mime-db@npm:1.52.0": + version: 1.52.0 + resolution: "mime-db@npm:1.52.0" + checksum: 0d99a03585f8b39d68182803b12ac601d9c01abfa28ec56204fa330bc9f3d1c5e14beb049bafadb3dbdf646dfb94b87e24d4ec7b31b7279ef906a8ea9b6a513f + languageName: node + linkType: hard + +"mime-types@npm:^2.1.12": + version: 2.1.35 + resolution: "mime-types@npm:2.1.35" + dependencies: + mime-db: 1.52.0 + checksum: 89a5b7f1def9f3af5dad6496c5ed50191ae4331cc5389d7c521c8ad28d5fdad2d06fd81baf38fed813dc4e46bb55c8145bb0ff406330818c9cf712fb2e9b3836 + languageName: node + linkType: hard + +"mimic-fn@npm:^2.1.0": + version: 2.1.0 + resolution: "mimic-fn@npm:2.1.0" + checksum: d2421a3444848ce7f84bd49115ddacff29c15745db73f54041edc906c14b131a38d05298dae3081667627a59b2eb1ca4b436ff2e1b80f69679522410418b478a + languageName: node + linkType: hard + +"minimatch@npm:5.0.1": + version: 5.0.1 + resolution: "minimatch@npm:5.0.1" + dependencies: + brace-expansion: ^2.0.1 + checksum: b34b98463da4754bc526b244d680c69d4d6089451ebe512edaf6dd9eeed0279399cfa3edb19233513b8f830bf4bfcad911dddcdf125e75074100d52f724774f0 + languageName: node + linkType: hard + +"minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" dependencies: @@ -2879,7 +4132,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^9.0.1": +"minimatch@npm:^9.0.1, minimatch@npm:^9.0.3": version: 9.0.3 resolution: "minimatch@npm:9.0.3" dependencies: @@ -3000,6 +4253,38 @@ __metadata: languageName: node linkType: hard +"mocha@npm:^10.2.0": + version: 10.2.0 + resolution: "mocha@npm:10.2.0" + dependencies: + ansi-colors: 4.1.1 + browser-stdout: 1.3.1 + chokidar: 3.5.3 + debug: 4.3.4 + diff: 5.0.0 + escape-string-regexp: 4.0.0 + find-up: 5.0.0 + glob: 7.2.0 + he: 1.2.0 + js-yaml: 4.1.0 + log-symbols: 4.1.0 + minimatch: 5.0.1 + ms: 2.1.3 + nanoid: 3.3.3 + serialize-javascript: 6.0.0 + strip-json-comments: 3.1.1 + supports-color: 8.1.1 + workerpool: 6.2.1 + yargs: 16.2.0 + yargs-parser: 20.2.4 + yargs-unparser: 2.0.0 + bin: + _mocha: bin/_mocha + mocha: bin/mocha.js + checksum: 406c45eab122ffd6ea2003c2f108b2bc35ba036225eee78e0c784b6fa2c7f34e2b13f1dbacef55a4fdf523255d76e4f22d1b5aacda2394bd11666febec17c719 + languageName: node + linkType: hard + "mock-socket@npm:^9.3.1": version: 9.3.1 resolution: "mock-socket@npm:9.3.1" @@ -3007,26 +4292,91 @@ __metadata: languageName: node linkType: hard -"ms@npm:2.1.2": - version: 2.1.2 - resolution: "ms@npm:2.1.2" - checksum: 673cdb2c3133eb050c745908d8ce632ed2c02d85640e2edb3ace856a2266a813b30c613569bf3354fdf4ea7d1a1494add3bfa95e2713baa27d0c2c71fc44f58f +"ms@npm:2.1.2": + version: 2.1.2 + resolution: "ms@npm:2.1.2" + checksum: 673cdb2c3133eb050c745908d8ce632ed2c02d85640e2edb3ace856a2266a813b30c613569bf3354fdf4ea7d1a1494add3bfa95e2713baa27d0c2c71fc44f58f + languageName: node + linkType: hard + +"ms@npm:2.1.3, ms@npm:^2.1.1": + version: 2.1.3 + resolution: "ms@npm:2.1.3" + checksum: aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d + languageName: node + linkType: hard + +"multiformats@npm:^9.4.2, multiformats@npm:^9.4.5": + version: 9.9.0 + resolution: "multiformats@npm:9.9.0" + checksum: d3e8c1be400c09a014f557ea02251a2710dbc9fca5aa32cc702ff29f636c5471e17979f30bdcb0a9cbb556f162a8591dc2e1219c24fc21394a56115b820bb84e + languageName: node + linkType: hard + +"nanoid@npm:3.3.3": + version: 3.3.3 + resolution: "nanoid@npm:3.3.3" + bin: + nanoid: bin/nanoid.cjs + checksum: ada019402a07464a694553c61d2dca8a4353645a7d92f2830f0d487fedff403678a0bee5323a46522752b2eab95a0bc3da98b6cccaa7c0c55cd9975130e6d6f0 + languageName: node + linkType: hard + +"nanoid@npm:^3.3.6": + version: 3.3.7 + resolution: "nanoid@npm:3.3.7" + bin: + nanoid: bin/nanoid.cjs + checksum: d36c427e530713e4ac6567d488b489a36582ef89da1d6d4e3b87eded11eb10d7042a877958c6f104929809b2ab0bafa17652b076cdf84324aa75b30b722204f2 + languageName: node + linkType: hard + +"napi-maybe-compressed-blob-darwin-arm64@npm:0.0.11": + version: 0.0.11 + resolution: "napi-maybe-compressed-blob-darwin-arm64@npm:0.0.11" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"napi-maybe-compressed-blob-darwin-x64@npm:0.0.11": + version: 0.0.11 + resolution: "napi-maybe-compressed-blob-darwin-x64@npm:0.0.11" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"napi-maybe-compressed-blob-linux-arm64-gnu@npm:0.0.11": + version: 0.0.11 + resolution: "napi-maybe-compressed-blob-linux-arm64-gnu@npm:0.0.11" + conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"ms@npm:^2.1.1": - version: 2.1.3 - resolution: "ms@npm:2.1.3" - checksum: aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d +"napi-maybe-compressed-blob-linux-x64-gnu@npm:0.0.11": + version: 0.0.11 + resolution: "napi-maybe-compressed-blob-linux-x64-gnu@npm:0.0.11" + conditions: os=linux & cpu=x64 languageName: node linkType: hard -"nanoid@npm:^3.3.6": - version: 3.3.7 - resolution: "nanoid@npm:3.3.7" - bin: - nanoid: bin/nanoid.cjs - checksum: d36c427e530713e4ac6567d488b489a36582ef89da1d6d4e3b87eded11eb10d7042a877958c6f104929809b2ab0bafa17652b076cdf84324aa75b30b722204f2 +"napi-maybe-compressed-blob@npm:^0.0.11": + version: 0.0.11 + resolution: "napi-maybe-compressed-blob@npm:0.0.11" + dependencies: + napi-maybe-compressed-blob-darwin-arm64: 0.0.11 + napi-maybe-compressed-blob-darwin-x64: 0.0.11 + napi-maybe-compressed-blob-linux-arm64-gnu: 0.0.11 + napi-maybe-compressed-blob-linux-x64-gnu: 0.0.11 + dependenciesMeta: + napi-maybe-compressed-blob-darwin-arm64: + optional: true + napi-maybe-compressed-blob-darwin-x64: + optional: true + napi-maybe-compressed-blob-linux-arm64-gnu: + optional: true + napi-maybe-compressed-blob-linux-x64-gnu: + optional: true + checksum: 092dbbf9a157385f245bf059d1260b299cfabeb3db45fca6b8d2a8b6cacc025a66da8b8c5c05fcc015617e7beee33e1766b07121c4acd433496f56e986e6c27c languageName: node linkType: hard @@ -3044,7 +4394,7 @@ __metadata: languageName: node linkType: hard -"nock@npm:^13.3.4": +"nock@npm:^13.3.4, nock@npm:^13.3.8": version: 13.3.8 resolution: "nock@npm:13.3.8" dependencies: @@ -3073,6 +4423,13 @@ __metadata: languageName: node linkType: hard +"node-forge@npm:^1.2.1": + version: 1.3.1 + resolution: "node-forge@npm:1.3.1" + checksum: 08fb072d3d670599c89a1704b3e9c649ff1b998256737f0e06fbd1a5bf41cae4457ccaee32d95052d80bbafd9ffe01284e078c8071f0267dc9744e51c5ed42a9 + languageName: node + linkType: hard + "node-gyp@npm:latest": version: 10.0.1 resolution: "node-gyp@npm:10.0.1" @@ -3104,6 +4461,47 @@ __metadata: languageName: node linkType: hard +"normalize-path@npm:^3.0.0, normalize-path@npm:~3.0.0": + version: 3.0.0 + resolution: "normalize-path@npm:3.0.0" + checksum: 88eeb4da891e10b1318c4b2476b6e2ecbeb5ff97d946815ffea7794c31a89017c70d7f34b3c2ebf23ef4e9fc9fb99f7dffe36da22011b5b5c6ffa34f4873ec20 + languageName: node + linkType: hard + +"npm-run-path@npm:^4.0.1": + version: 4.0.1 + resolution: "npm-run-path@npm:4.0.1" + dependencies: + path-key: ^3.0.0 + checksum: 5374c0cea4b0bbfdfae62da7bbdf1e1558d338335f4cacf2515c282ff358ff27b2ecb91ffa5330a8b14390ac66a1e146e10700440c1ab868208430f56b5f4d23 + languageName: node + linkType: hard + +"nunjucks@npm:^3.2.4": + version: 3.2.4 + resolution: "nunjucks@npm:3.2.4" + dependencies: + a-sync-waterfall: ^1.0.0 + asap: ^2.0.3 + commander: ^5.1.0 + peerDependencies: + chokidar: ^3.3.0 + peerDependenciesMeta: + chokidar: + optional: true + bin: + nunjucks-precompile: bin/precompile + checksum: 8b902a9deb9ff0f5c9ebbd2c7f96dfe5800bf42bdfc91d8f829fc0440ec1f87901593e20479f5ba1bddcc9f2472b16a5e932be5863dcdec0899a27c01a03df32 + languageName: node + linkType: hard + +"nwsapi@npm:^2.2.4": + version: 2.2.7 + resolution: "nwsapi@npm:2.2.7" + checksum: cab25f7983acec7e23490fec3ef7be608041b460504229770e3bfcf9977c41d6fe58f518994d3bd9aa3a101f501089a3d4a63536f4ff8ae4b8c4ca23bdbfda4e + languageName: node + linkType: hard + "object-inspect@npm:^1.13.1, object-inspect@npm:^1.9.0": version: 1.13.1 resolution: "object-inspect@npm:1.13.1" @@ -3173,6 +4571,15 @@ __metadata: languageName: node linkType: hard +"onetime@npm:^5.1.2": + version: 5.1.2 + resolution: "onetime@npm:5.1.2" + dependencies: + mimic-fn: ^2.1.0 + checksum: 2478859ef817fc5d4e9c2f9e5728512ddd1dbc9fb7829ad263765bb6d3b91ce699d6e2332eef6b7dff183c2f490bd3349f1666427eaba4469fba0ac38dfd0d34 + languageName: node + linkType: hard + "optionator@npm:^0.9.3": version: 0.9.3 resolution: "optionator@npm:0.9.3" @@ -3232,6 +4639,15 @@ __metadata: languageName: node linkType: hard +"parse5@npm:^7.1.2": + version: 7.1.2 + resolution: "parse5@npm:7.1.2" + dependencies: + entities: ^4.4.0 + checksum: 59465dd05eb4c5ec87b76173d1c596e152a10e290b7abcda1aecf0f33be49646ea74840c69af975d7887543ea45564801736356c568d6b5e71792fd0f4055713 + languageName: node + linkType: hard + "path-exists@npm:^4.0.0": version: 4.0.0 resolution: "path-exists@npm:4.0.0" @@ -3246,7 +4662,7 @@ __metadata: languageName: node linkType: hard -"path-key@npm:^3.1.0": +"path-key@npm:^3.0.0, path-key@npm:^3.1.0": version: 3.1.1 resolution: "path-key@npm:3.1.1" checksum: 55cd7a9dd4b343412a8386a743f9c746ef196e57c823d90ca3ab917f90ab9f13dd0ded27252ba49dbdfcab2b091d998bc446f6220cd3cea65db407502a740020 @@ -3291,6 +4707,19 @@ __metadata: languageName: node linkType: hard +"peer-id@npm:^0.16.0": + version: 0.16.0 + resolution: "peer-id@npm:0.16.0" + dependencies: + class-is: ^1.1.0 + libp2p-crypto: ^0.21.0 + multiformats: ^9.4.5 + protobufjs: ^6.10.2 + uint8arrays: ^3.0.0 + checksum: 35dfb887c6f00789702214488e1f97dd1713ed77909b7f9be13b20003aed64cc444bf15e6bd845c01d47f424856acca7fa1f0501b785f5cb6e6707e3f05b9f41 + languageName: node + linkType: hard + "picocolors@npm:^1.0.0": version: 1.0.0 resolution: "picocolors@npm:1.0.0" @@ -3298,7 +4727,7 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^2.3.1": +"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.3.1": version: 2.3.1 resolution: "picomatch@npm:2.3.1" checksum: 050c865ce81119c4822c45d3c84f1ced46f93a0126febae20737bd05ca20589c564d6e9226977df859ed5e03dc73f02584a2b0faad36e896936238238b0446cf @@ -3378,13 +4807,51 @@ __metadata: languageName: node linkType: hard -"punycode@npm:^2.1.0": +"protobufjs@npm:^6.10.2, protobufjs@npm:^6.11.2": + version: 6.11.4 + resolution: "protobufjs@npm:6.11.4" + dependencies: + "@protobufjs/aspromise": ^1.1.2 + "@protobufjs/base64": ^1.1.2 + "@protobufjs/codegen": ^2.0.4 + "@protobufjs/eventemitter": ^1.1.0 + "@protobufjs/fetch": ^1.1.0 + "@protobufjs/float": ^1.0.2 + "@protobufjs/inquire": ^1.1.0 + "@protobufjs/path": ^1.1.2 + "@protobufjs/pool": ^1.1.0 + "@protobufjs/utf8": ^1.1.0 + "@types/long": ^4.0.1 + "@types/node": ">=13.7.0" + long: ^4.0.0 + bin: + pbjs: bin/pbjs + pbts: bin/pbts + checksum: b2fc6a01897b016c2a7e43a854ab4a3c57080f61be41e552235436e7a730711b8e89e47cb4ae52f0f065b5ab5d5989fc932f390337ce3a8ccf07203415700850 + languageName: node + linkType: hard + +"psl@npm:^1.1.33": + version: 1.9.0 + resolution: "psl@npm:1.9.0" + checksum: 20c4277f640c93d393130673f392618e9a8044c6c7bf61c53917a0fddb4952790f5f362c6c730a9c32b124813e173733f9895add8d26f566ed0ea0654b2e711d + languageName: node + linkType: hard + +"punycode@npm:^2.1.0, punycode@npm:^2.1.1, punycode@npm:^2.3.0": version: 2.3.1 resolution: "punycode@npm:2.3.1" checksum: bb0a0ceedca4c3c57a9b981b90601579058903c62be23c5e8e843d2c2d4148a3ecf029d5133486fb0e1822b098ba8bba09e89d6b21742d02fa26bda6441a6fb2 languageName: node linkType: hard +"querystringify@npm:^2.1.1": + version: 2.2.0 + resolution: "querystringify@npm:2.2.0" + checksum: 5641ea231bad7ef6d64d9998faca95611ed4b11c2591a8cae741e178a974f6a8e0ebde008475259abe1621cb15e692404e6b6626e927f7b849d5c09392604b15 + languageName: node + linkType: hard + "queue-microtask@npm:^1.2.2": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" @@ -3392,6 +4859,15 @@ __metadata: languageName: node linkType: hard +"randombytes@npm:^2.1.0": + version: 2.1.0 + resolution: "randombytes@npm:2.1.0" + dependencies: + safe-buffer: ^5.1.0 + checksum: d779499376bd4cbb435ef3ab9a957006c8682f343f14089ed5f27764e4645114196e75b7f6abf1cbd84fd247c0cb0651698444df8c9bf30e62120fbbc52269d6 + languageName: node + linkType: hard + "react-is@npm:^18.0.0": version: 18.2.0 resolution: "react-is@npm:18.2.0" @@ -3399,6 +4875,26 @@ __metadata: languageName: node linkType: hard +"readable-stream@npm:^3.4.0": + version: 3.6.2 + resolution: "readable-stream@npm:3.6.2" + dependencies: + inherits: ^2.0.3 + string_decoder: ^1.1.1 + util-deprecate: ^1.0.1 + checksum: bdcbe6c22e846b6af075e32cf8f4751c2576238c5043169a1c221c92ee2878458a816a4ea33f4c67623c0b6827c8a400409bfb3cf0bf3381392d0b1dfb52ac8d + languageName: node + linkType: hard + +"readdirp@npm:~3.6.0": + version: 3.6.0 + resolution: "readdirp@npm:3.6.0" + dependencies: + picomatch: ^2.2.1 + checksum: 1ced032e6e45670b6d7352d71d21ce7edf7b9b928494dcaba6f11fba63180d9da6cd7061ebc34175ffda6ff529f481818c962952004d273178acd70f7059b320 + languageName: node + linkType: hard + "regexp.prototype.flags@npm:^1.5.1": version: 1.5.1 resolution: "regexp.prototype.flags@npm:1.5.1" @@ -3410,6 +4906,13 @@ __metadata: languageName: node linkType: hard +"require-directory@npm:^2.1.1": + version: 2.1.1 + resolution: "require-directory@npm:2.1.1" + checksum: fb47e70bf0001fdeabdc0429d431863e9475e7e43ea5f94ad86503d918423c1543361cc5166d713eaa7029dd7a3d34775af04764bebff99ef413111a5af18c80 + languageName: node + linkType: hard + "requireindex@npm:^1.2.0": version: 1.2.0 resolution: "requireindex@npm:1.2.0" @@ -3417,6 +4920,13 @@ __metadata: languageName: node linkType: hard +"requires-port@npm:^1.0.0": + version: 1.0.0 + resolution: "requires-port@npm:1.0.0" + checksum: eee0e303adffb69be55d1a214e415cf42b7441ae858c76dfc5353148644f6fd6e698926fc4643f510d5c126d12a705e7c8ed7e38061113bdf37547ab356797ff + languageName: node + linkType: hard + "resolve-from@npm:^4.0.0": version: 4.0.0 resolution: "resolve-from@npm:4.0.0" @@ -3464,7 +4974,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^3.0.2": +"rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" dependencies: @@ -3500,6 +5010,13 @@ __metadata: languageName: node linkType: hard +"rrweb-cssom@npm:^0.6.0": + version: 0.6.0 + resolution: "rrweb-cssom@npm:0.6.0" + checksum: 182312f6e4f41d18230ccc34f14263bc8e8a6b9d30ee3ec0d2d8e643c6f27964cd7a8d638d4a00e988d93e8dc55369f4ab5a473ccfeff7a8bab95b36d2b5499c + languageName: node + linkType: hard + "run-parallel@npm:^1.1.9": version: 1.2.0 resolution: "run-parallel@npm:1.2.0" @@ -3530,6 +5047,13 @@ __metadata: languageName: node linkType: hard +"safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": + version: 5.2.1 + resolution: "safe-buffer@npm:5.2.1" + checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491 + languageName: node + linkType: hard + "safe-regex-test@npm:^1.0.0": version: 1.0.0 resolution: "safe-regex-test@npm:1.0.0" @@ -3548,6 +5072,15 @@ __metadata: languageName: node linkType: hard +"saxes@npm:^6.0.0": + version: 6.0.0 + resolution: "saxes@npm:6.0.0" + dependencies: + xmlchars: ^2.2.0 + checksum: d3fa3e2aaf6c65ed52ee993aff1891fc47d5e47d515164b5449cbf5da2cbdc396137e55590472e64c5c436c14ae64a8a03c29b9e7389fc6f14035cf4e982ef3b + languageName: node + linkType: hard + "semver@npm:^6.3.1": version: 6.3.1 resolution: "semver@npm:6.3.1" @@ -3568,6 +5101,15 @@ __metadata: languageName: node linkType: hard +"serialize-javascript@npm:6.0.0": + version: 6.0.0 + resolution: "serialize-javascript@npm:6.0.0" + dependencies: + randombytes: ^2.1.0 + checksum: 56f90b562a1bdc92e55afb3e657c6397c01a902c588c0fe3d4c490efdcc97dcd2a3074ba12df9e94630f33a5ce5b76a74784a7041294628a6f4306e0ec84bf93 + languageName: node + linkType: hard + "set-function-length@npm:^1.1.1": version: 1.1.1 resolution: "set-function-length@npm:1.1.1" @@ -3625,6 +5167,13 @@ __metadata: languageName: node linkType: hard +"signal-exit@npm:^3.0.3": + version: 3.0.7 + resolution: "signal-exit@npm:3.0.7" + checksum: a2f098f247adc367dffc27845853e9959b9e88b01cb301658cfe4194352d8d2bb32e18467c786a7fe15f1d44b233ea35633d076d5e737870b7139949d1ab6318 + languageName: node + linkType: hard + "signal-exit@npm:^4.0.1": version: 4.1.0 resolution: "signal-exit@npm:4.1.0" @@ -3655,6 +5204,15 @@ __metadata: languageName: node linkType: hard +"smoldot@npm:2.0.7": + version: 2.0.7 + resolution: "smoldot@npm:2.0.7" + dependencies: + ws: ^8.8.1 + checksum: fc039bfa0560312ae09c2136dd506f2a1994ead804b7234b49b2ecfac2fd19d306973a0fcfb66019645a8cf9a1702c270bc544a622ae40b63cf14790ea3531e0 + languageName: node + linkType: hard + "socks-proxy-agent@npm:^8.0.1": version: 8.0.2 resolution: "socks-proxy-agent@npm:8.0.2" @@ -3757,7 +5315,7 @@ __metadata: languageName: node linkType: hard -"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^4.1.0": +"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": version: 4.2.3 resolution: "string-width@npm:4.2.3" dependencies: @@ -3812,6 +5370,15 @@ __metadata: languageName: node linkType: hard +"string_decoder@npm:^1.1.1": + version: 1.3.0 + resolution: "string_decoder@npm:1.3.0" + dependencies: + safe-buffer: ~5.2.0 + checksum: 8417646695a66e73aefc4420eb3b84cc9ffd89572861fe004e6aeb13c7bc00e2f616247505d2dbbef24247c372f70268f594af7126f43548565c68c117bdeb56 + languageName: node + linkType: hard + "strip-ansi-cjs@npm:strip-ansi@^6.0.1, strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": version: 6.0.1 resolution: "strip-ansi@npm:6.0.1" @@ -3837,7 +5404,14 @@ __metadata: languageName: node linkType: hard -"strip-json-comments@npm:^3.1.1": +"strip-final-newline@npm:^2.0.0": + version: 2.0.0 + resolution: "strip-final-newline@npm:2.0.0" + checksum: 69412b5e25731e1938184b5d489c32e340605bb611d6140344abc3421b7f3c6f9984b21dff296dfcf056681b82caa3bb4cc996a965ce37bcfad663e92eae9c64 + languageName: node + linkType: hard + +"strip-json-comments@npm:3.1.1, strip-json-comments@npm:^3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" checksum: 492f73e27268f9b1c122733f28ecb0e7e8d8a531a6662efbd08e22cccb3f9475e90a1b82cab06a392f6afae6d2de636f977e231296400d0ec5304ba70f166443 @@ -3853,6 +5427,15 @@ __metadata: languageName: node linkType: hard +"supports-color@npm:8.1.1": + version: 8.1.1 + resolution: "supports-color@npm:8.1.1" + dependencies: + has-flag: ^4.0.0 + checksum: c052193a7e43c6cdc741eb7f378df605636e01ad434badf7324f17fb60c69a880d8d8fcdcb562cf94c2350e57b937d7425ab5b8326c67c2adc48f7c87c1db406 + languageName: node + linkType: hard + "supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" @@ -3869,6 +5452,13 @@ __metadata: languageName: node linkType: hard +"symbol-tree@npm:^3.2.4": + version: 3.2.4 + resolution: "symbol-tree@npm:3.2.4" + checksum: 6e8fc7e1486b8b54bea91199d9535bb72f10842e40c79e882fc94fb7b14b89866adf2fd79efa5ebb5b658bc07fb459ccce5ac0e99ef3d72f474e74aaf284029d + languageName: node + linkType: hard + "tar@npm:^6.1.11, tar@npm:^6.1.2": version: 6.2.0 resolution: "tar@npm:6.2.0" @@ -3890,6 +5480,13 @@ __metadata: languageName: node linkType: hard +"through@npm:>=2.2.7 <3": + version: 2.3.8 + resolution: "through@npm:2.3.8" + checksum: a38c3e059853c494af95d50c072b83f8b676a9ba2818dcc5b108ef252230735c54e0185437618596c790bbba8fcdaef5b290405981ffa09dce67b1f1bf190cbd + languageName: node + linkType: hard + "tinybench@npm:^2.5.0": version: 2.5.1 resolution: "tinybench@npm:2.5.1" @@ -3911,6 +5508,24 @@ __metadata: languageName: node linkType: hard +"tmp-promise@npm:^3.0.3": + version: 3.0.3 + resolution: "tmp-promise@npm:3.0.3" + dependencies: + tmp: ^0.2.0 + checksum: f854f5307dcee6455927ec3da9398f139897faf715c5c6dcee6d9471ae85136983ea06662eba2edf2533bdcb0fca66d16648e79e14381e30c7fb20be9c1aa62c + languageName: node + linkType: hard + +"tmp@npm:^0.2.0": + version: 0.2.1 + resolution: "tmp@npm:0.2.1" + dependencies: + rimraf: ^3.0.0 + checksum: 8b1214654182575124498c87ca986ac53dc76ff36e8f0e0b67139a8d221eaecfdec108c0e6ec54d76f49f1f72ab9325500b246f562b926f85bcdfca8bf35df9e + languageName: node + linkType: hard + "to-regex-range@npm:^5.0.1": version: 5.0.1 resolution: "to-regex-range@npm:5.0.1" @@ -3920,6 +5535,34 @@ __metadata: languageName: node linkType: hard +"toml@npm:^3.0.0": + version: 3.0.0 + resolution: "toml@npm:3.0.0" + checksum: 5d7f1d8413ad7780e9bdecce8ea4c3f5130dd53b0a4f2e90b93340979a137739879d7b9ce2ce05c938b8cc828897fe9e95085197342a1377dd8850bf5125f15f + languageName: node + linkType: hard + +"tough-cookie@npm:^4.1.2": + version: 4.1.3 + resolution: "tough-cookie@npm:4.1.3" + dependencies: + psl: ^1.1.33 + punycode: ^2.1.1 + universalify: ^0.2.0 + url-parse: ^1.5.3 + checksum: c9226afff36492a52118432611af083d1d8493a53ff41ec4ea48e5b583aec744b989e4280bcf476c910ec1525a89a4a0f1cae81c08b18fb2ec3a9b3a72b91dcc + languageName: node + linkType: hard + +"tr46@npm:^4.1.1": + version: 4.1.1 + resolution: "tr46@npm:4.1.1" + dependencies: + punycode: ^2.3.0 + checksum: aeeb821ac2cd792e63ec84888b4fd6598ac6ed75d861579e21a5cf9d4ee78b2c6b94e7d45036f2ca2088bc85b9b46560ad23c4482979421063b24137349dbd96 + languageName: node + linkType: hard + "ts-api-utils@npm:^1.0.1": version: 1.0.3 resolution: "ts-api-utils@npm:1.0.3" @@ -3929,6 +5572,44 @@ __metadata: languageName: node linkType: hard +"ts-node@npm:^10.9.1": + version: 10.9.1 + resolution: "ts-node@npm:10.9.1" + dependencies: + "@cspotcode/source-map-support": ^0.8.0 + "@tsconfig/node10": ^1.0.7 + "@tsconfig/node12": ^1.0.7 + "@tsconfig/node14": ^1.0.0 + "@tsconfig/node16": ^1.0.2 + acorn: ^8.4.1 + acorn-walk: ^8.1.1 + arg: ^4.1.0 + create-require: ^1.1.0 + diff: ^4.0.1 + make-error: ^1.1.1 + v8-compile-cache-lib: ^3.0.1 + yn: 3.1.1 + peerDependencies: + "@swc/core": ">=1.2.50" + "@swc/wasm": ">=1.2.50" + "@types/node": "*" + typescript: ">=2.7" + peerDependenciesMeta: + "@swc/core": + optional: true + "@swc/wasm": + optional: true + bin: + ts-node: dist/bin.js + ts-node-cwd: dist/bin-cwd.js + ts-node-esm: dist/bin-esm.js + ts-node-script: dist/bin-script.js + ts-node-transpile-only: dist/bin-transpile.js + ts-script: dist/bin-script-deprecated.js + checksum: 090adff1302ab20bd3486e6b4799e90f97726ed39e02b39e566f8ab674fd5bd5f727f43615debbfc580d33c6d9d1c6b1b3ce7d8e3cca3e20530a145ffa232c35 + languageName: node + linkType: hard + "tsconfig-paths@npm:^3.14.2": version: 3.14.2 resolution: "tsconfig-paths@npm:3.14.2" @@ -4041,23 +5722,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^5.1.6": - version: 5.2.2 - resolution: "typescript@npm:5.2.2" +"typescript@npm:^5.1.6, typescript@npm:^5.2.2": + version: 5.3.2 + resolution: "typescript@npm:5.3.2" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 7912821dac4d962d315c36800fe387cdc0a6298dba7ec171b350b4a6e988b51d7b8f051317786db1094bd7431d526b648aba7da8236607febb26cf5b871d2d3c + checksum: d92534dda639eb825db013203404c1fabca8ac630564283c9e7dc9e64fd9c9346c2de95ecebdf3e6e8c1c32941bca1cfe0da37877611feb9daf8feeaea58d230 languageName: node linkType: hard -"typescript@patch:typescript@^5.1.6#~builtin": - version: 5.2.2 - resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=5da071" +"typescript@patch:typescript@^5.1.6#~builtin, typescript@patch:typescript@^5.2.2#~builtin": + version: 5.3.2 + resolution: "typescript@patch:typescript@npm%3A5.3.2#~builtin::version=5.3.2&hash=5da071" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 07106822b4305de3f22835cbba949a2b35451cad50888759b6818421290ff95d522b38ef7919e70fb381c5fe9c1c643d7dea22c8b31652a717ddbd57b7f4d554 + checksum: c034461079fbfde3cb584ddee52afccb15b6e32a0ce186d0b2719968786f7ca73e1b07f71fac4163088790b16811c6ccf79680de190664ef66ff0ba9c1fe4a23 languageName: node linkType: hard @@ -4068,6 +5749,15 @@ __metadata: languageName: node linkType: hard +"uint8arrays@npm:^3.0.0": + version: 3.1.1 + resolution: "uint8arrays@npm:3.1.1" + dependencies: + multiformats: ^9.4.2 + checksum: b93b6c3f0a526b116799f3a3409bd4b5d5553eb3e73e485998ece7974742254fbc0d2f7988dd21ac86c4b974552f45d9ae9cf9cba9647e529f8eb1fdd2ed84d0 + languageName: node + linkType: hard + "unbox-primitive@npm:^1.0.2": version: 1.0.2 resolution: "unbox-primitive@npm:1.0.2" @@ -4105,6 +5795,20 @@ __metadata: languageName: node linkType: hard +"universalify@npm:^0.2.0": + version: 0.2.0 + resolution: "universalify@npm:0.2.0" + checksum: e86134cb12919d177c2353196a4cc09981524ee87abf621f7bc8d249dbbbebaec5e7d1314b96061497981350df786e4c5128dbf442eba104d6e765bc260678b5 + languageName: node + linkType: hard + +"universalify@npm:^2.0.0": + version: 2.0.1 + resolution: "universalify@npm:2.0.1" + checksum: ecd8469fe0db28e7de9e5289d32bd1b6ba8f7183db34f3bfc4ca53c49891c2d6aa05f3fb3936a81285a905cc509fb641a0c3fc131ec786167eff41236ae32e60 + languageName: node + linkType: hard + "uri-js@npm:^4.2.2": version: 4.4.1 resolution: "uri-js@npm:4.4.1" @@ -4114,6 +5818,23 @@ __metadata: languageName: node linkType: hard +"url-parse@npm:^1.5.3": + version: 1.5.10 + resolution: "url-parse@npm:1.5.10" + dependencies: + querystringify: ^2.1.1 + requires-port: ^1.0.0 + checksum: fbdba6b1d83336aca2216bbdc38ba658d9cfb8fc7f665eb8b17852de638ff7d1a162c198a8e4ed66001ddbf6c9888d41e4798912c62b4fd777a31657989f7bdf + languageName: node + linkType: hard + +"util-deprecate@npm:^1.0.1": + version: 1.0.2 + resolution: "util-deprecate@npm:1.0.2" + checksum: 474acf1146cb2701fe3b074892217553dfcf9a031280919ba1b8d651a068c9b15d863b7303cb15bd00a862b498e6cf4ad7b4a08fb134edd5a6f7641681cb54a2 + languageName: node + linkType: hard + "uuid@npm:^9.0.0": version: 9.0.1 resolution: "uuid@npm:9.0.1" @@ -4123,6 +5844,13 @@ __metadata: languageName: node linkType: hard +"v8-compile-cache-lib@npm:^3.0.1": + version: 3.0.1 + resolution: "v8-compile-cache-lib@npm:3.0.1" + checksum: 78089ad549e21bcdbfca10c08850022b22024cdcc2da9b168bcf5a73a6ed7bf01a9cebb9eac28e03cd23a684d81e0502797e88f3ccd27a32aeab1cfc44c39da0 + languageName: node + linkType: hard + "vite-node@npm:0.33.0": version: 0.33.0 resolution: "vite-node@npm:0.33.0" @@ -4239,6 +5967,15 @@ __metadata: languageName: node linkType: hard +"w3c-xmlserializer@npm:^4.0.0": + version: 4.0.0 + resolution: "w3c-xmlserializer@npm:4.0.0" + dependencies: + xml-name-validator: ^4.0.0 + checksum: eba070e78deb408ae8defa4d36b429f084b2b47a4741c4a9be3f27a0a3d1845e277e3072b04391a138f7e43776842627d1334e448ff13ff90ad9fb1214ee7091 + languageName: node + linkType: hard + "web-streams-polyfill@npm:^3.0.3": version: 3.2.1 resolution: "web-streams-polyfill@npm:3.2.1" @@ -4246,6 +5983,39 @@ __metadata: languageName: node linkType: hard +"webidl-conversions@npm:^7.0.0": + version: 7.0.0 + resolution: "webidl-conversions@npm:7.0.0" + checksum: f05588567a2a76428515333eff87200fae6c83c3948a7482ebb109562971e77ef6dc49749afa58abb993391227c5697b3ecca52018793e0cb4620a48f10bd21b + languageName: node + linkType: hard + +"whatwg-encoding@npm:^2.0.0": + version: 2.0.0 + resolution: "whatwg-encoding@npm:2.0.0" + dependencies: + iconv-lite: 0.6.3 + checksum: 7087810c410aa9b689cbd6af8773341a53cdc1f3aae2a882c163bd5522ec8ca4cdfc269aef417a5792f411807d5d77d50df4c24e3abb00bb60192858a40cc675 + languageName: node + linkType: hard + +"whatwg-mimetype@npm:^3.0.0": + version: 3.0.0 + resolution: "whatwg-mimetype@npm:3.0.0" + checksum: ce08bbb36b6aaf64f3a84da89707e3e6a31e5ab1c1a2379fd68df79ba712a4ab090904f0b50e6693b0dafc8e6343a6157e40bf18fdffd26e513cf95ee2a59824 + languageName: node + linkType: hard + +"whatwg-url@npm:^12.0.0, whatwg-url@npm:^12.0.1": + version: 12.0.1 + resolution: "whatwg-url@npm:12.0.1" + dependencies: + tr46: ^4.1.1 + webidl-conversions: ^7.0.0 + checksum: 8698993b763c1e7eda5ed16c31dab24bca6489626aca7caf8b5a2b64684dda6578194786f10ec42ceb1c175feea16d0a915096e6419e08d154ce551c43176972 + languageName: node + linkType: hard + "which-boxed-primitive@npm:^1.0.2": version: 1.0.2 resolution: "which-boxed-primitive@npm:1.0.2" @@ -4306,7 +6076,14 @@ __metadata: languageName: node linkType: hard -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"workerpool@npm:6.2.1": + version: 6.2.1 + resolution: "workerpool@npm:6.2.1" + checksum: c2c6eebbc5225f10f758d599a5c016fa04798bcc44e4c1dffb34050cd361d7be2e97891aa44419e7afe647b1f767b1dc0b85a5e046c409d890163f655028b09d + languageName: node + linkType: hard + +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0": version: 7.0.0 resolution: "wrap-ansi@npm:7.0.0" dependencies: @@ -4335,7 +6112,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^8.14.1, ws@npm:^8.8.1": +"ws@npm:^8.13.0, ws@npm:^8.14.1, ws@npm:^8.14.2, ws@npm:^8.8.1": version: 8.14.2 resolution: "ws@npm:8.14.2" peerDependencies: @@ -4350,6 +6127,27 @@ __metadata: languageName: node linkType: hard +"xml-name-validator@npm:^4.0.0": + version: 4.0.0 + resolution: "xml-name-validator@npm:4.0.0" + checksum: af100b79c29804f05fa35aa3683e29a321db9b9685d5e5febda3fa1e40f13f85abc40f45a6b2bf7bee33f68a1dc5e8eaef4cec100a304a9db565e6061d4cb5ad + languageName: node + linkType: hard + +"xmlchars@npm:^2.2.0": + version: 2.2.0 + resolution: "xmlchars@npm:2.2.0" + checksum: 8c70ac94070ccca03f47a81fcce3b271bd1f37a591bf5424e787ae313fcb9c212f5f6786e1fa82076a2c632c0141552babcd85698c437506dfa6ae2d58723062 + languageName: node + linkType: hard + +"y18n@npm:^5.0.5": + version: 5.0.8 + resolution: "y18n@npm:5.0.8" + checksum: 54f0fb95621ee60898a38c572c515659e51cc9d9f787fb109cef6fde4befbe1c4602dc999d30110feee37456ad0f1660fa2edcfde6a9a740f86a290999550d30 + languageName: node + linkType: hard + "yallist@npm:^4.0.0": version: 4.0.0 resolution: "yallist@npm:4.0.0" @@ -4357,6 +6155,61 @@ __metadata: languageName: node linkType: hard +"yaml@npm:^2.3.4": + version: 2.3.4 + resolution: "yaml@npm:2.3.4" + checksum: e6d1dae1c6383bcc8ba11796eef3b8c02d5082911c6723efeeb5ba50fc8e881df18d645e64de68e421b577296000bea9c75d6d9097c2f6699da3ae0406c030d8 + languageName: node + linkType: hard + +"yargs-parser@npm:20.2.4": + version: 20.2.4 + resolution: "yargs-parser@npm:20.2.4" + checksum: d251998a374b2743a20271c2fd752b9fbef24eb881d53a3b99a7caa5e8227fcafd9abf1f345ac5de46435821be25ec12189a11030c12ee6481fef6863ed8b924 + languageName: node + linkType: hard + +"yargs-parser@npm:^20.2.2": + version: 20.2.9 + resolution: "yargs-parser@npm:20.2.9" + checksum: 8bb69015f2b0ff9e17b2c8e6bfe224ab463dd00ca211eece72a4cd8a906224d2703fb8a326d36fdd0e68701e201b2a60ed7cf81ce0fd9b3799f9fe7745977ae3 + languageName: node + linkType: hard + +"yargs-unparser@npm:2.0.0": + version: 2.0.0 + resolution: "yargs-unparser@npm:2.0.0" + dependencies: + camelcase: ^6.0.0 + decamelize: ^4.0.0 + flat: ^5.0.2 + is-plain-obj: ^2.1.0 + checksum: 68f9a542c6927c3768c2f16c28f71b19008710abd6b8f8efbac6dcce26bbb68ab6503bed1d5994bdbc2df9a5c87c161110c1dfe04c6a3fe5c6ad1b0e15d9a8a3 + languageName: node + linkType: hard + +"yargs@npm:16.2.0": + version: 16.2.0 + resolution: "yargs@npm:16.2.0" + dependencies: + cliui: ^7.0.2 + escalade: ^3.1.1 + get-caller-file: ^2.0.5 + require-directory: ^2.1.1 + string-width: ^4.2.0 + y18n: ^5.0.5 + yargs-parser: ^20.2.2 + checksum: b14afbb51e3251a204d81937c86a7e9d4bdbf9a2bcee38226c900d00f522969ab675703bee2a6f99f8e20103f608382936034e64d921b74df82b63c07c5e8f59 + languageName: node + linkType: hard + +"yn@npm:3.1.1": + version: 3.1.1 + resolution: "yn@npm:3.1.1" + checksum: 2c487b0e149e746ef48cda9f8bad10fc83693cd69d7f9dcd8be4214e985de33a29c9e24f3c0d6bcf2288427040a8947406ab27f7af67ee9456e6b84854f02dd6 + languageName: node + linkType: hard + "yocto-queue@npm:^0.1.0": version: 0.1.0 resolution: "yocto-queue@npm:0.1.0" From f6592d6ea42f04e368f570f6ddc224a2748cbd33 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Wed, 22 Nov 2023 15:14:52 +0000 Subject: [PATCH 02/22] Parallelize work --- package.json | 2 +- tests/sibling-zombienet.toml | 29 ++++++++++++++--------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 9759edf..cbffd06 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "test:e2e": "vitest run tests", "prepublish": "yarn exec cp -f ../../LICENSE .", "publish": "yarn npm publish --access=public --tolerate-republish", - "test:e2e:zombienet:sibling": "yarn zombienet spawn tests/sibling-zombienet.toml" + "test:e2e:zombienet:sibling": "yarn zombienet --spawn-concurrency 3 spawn tests/sibling-zombienet.toml" }, "stableVersion": "0.0.0", "type": "module", diff --git a/tests/sibling-zombienet.toml b/tests/sibling-zombienet.toml index a5cf9fb..7b3a25c 100644 --- a/tests/sibling-zombienet.toml +++ b/tests/sibling-zombienet.toml @@ -10,29 +10,28 @@ chain = "rococo-local" name = "alice" rpc_port = 10001 -# [[relaychain.nodes]] -# name = "bob" -# rpc_port = 10002 +[[relaychain.nodes]] +name = "bob" +rpc_port = 10002 -# [[relaychain.nodes]] -# name = "charlie" -# rpc_port = 10003 +[[relaychain.nodes]] +name = "charlie" +rpc_port = 10003 [[parachains]] id = 2000 [parachains.collator] -chain = "dev" name = "provider-alice" -image = "kiltprotocol/dip-provider-node-template:dev-10385bb3b3c302a1bdbd6e4188b034a2f01047d1" +image = "kiltprotocol/dip-provider-node-template:dev-bcc1f405a48563f9620930fde26519ee332e2ab4" ws_port = 10011 command = "node-executable" -# [[parachains]] -# id = 2001 +[[parachains]] +id = 2001 -# [parachains.collator] -# name = "consumer-alice" -# image = "kiltprotocol/dip-consumer-node-template:dev-10385bb3b3c302a1bdbd6e4188b034a2f01047d1" -# ws_port = 10011 -# command = "" +[parachains.collator] +name = "consumer-alice" +image = "kiltprotocol/dip-consumer-node-template:dev-bcc1f405a48563f9620930fde26519ee332e2ab4" +ws_port = 10012 +command = "node-executable" From 023fa83568b8e9e20f7936a932a710ef9ac2b48c Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Wed, 22 Nov 2023 18:16:35 +0100 Subject: [PATCH 03/22] Use Node 18 --- .nvmrc | 2 +- package.json | 9 +++++---- tests/sibling-zombienet.toml | 24 ++++++++++++++---------- yarn.lock | 11 ++++++----- 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/.nvmrc b/.nvmrc index 27cb0ee..853c0e1 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -lts/Gallium +lts/Hydrogen diff --git a/package.json b/package.json index cbffd06..59d4941 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "typescript-object-builder": "^0.3.0" }, "devDependencies": { + "@types/node": "^20.9.4", "@typescript-eslint/eslint-plugin": "^6.2.0", "@typescript-eslint/parser": "^6.2.0", "@zombienet/cli": "^1.3.82", @@ -18,11 +19,11 @@ "eslint-plugin-license-header": "^0.6.0", "prettier": "^3.0.0", "rimraf": "^5.0.1", - "typescript": "^5.1.6", + "typescript": "^5.3.2", "vitest": "^0.33.0" }, "engines": { - "node": ">=16.0" + "node": ">=18.0" }, "exports": { "import": "./dist/esm/index.js", @@ -50,10 +51,10 @@ "test:e2e": "vitest run tests", "prepublish": "yarn exec cp -f ../../LICENSE .", "publish": "yarn npm publish --access=public --tolerate-republish", - "test:e2e:zombienet:sibling": "yarn zombienet --spawn-concurrency 3 spawn tests/sibling-zombienet.toml" + "test:e2e:zombienet:sibling": "DEBUG=\"zombie*\" yarn zombienet --spawn-concurrency 3 spawn tests/sibling-zombienet.toml" }, "stableVersion": "0.0.0", "type": "module", "types": "./dist/cjs/index.d.ts", "version": "0.0.0" -} \ No newline at end of file +} diff --git a/tests/sibling-zombienet.toml b/tests/sibling-zombienet.toml index 7b3a25c..5be4633 100644 --- a/tests/sibling-zombienet.toml +++ b/tests/sibling-zombienet.toml @@ -1,37 +1,41 @@ [settings] -timeout = 1000 +enable_tracing = false +node_spawn_timeout = 600 provider = "kubernetes" +# 30 min +timeout = 1800 [relaychain] -default_image = "parity/polkadot:v1.0.0" chain = "rococo-local" +default_image = "parity/polkadot:v1.0.0" +default_substrate_cli_args_version = 1 [[relaychain.nodes]] -name = "alice" -rpc_port = 10001 +name = "relay-alice" +ws_port = 10001 [[relaychain.nodes]] -name = "bob" -rpc_port = 10002 +name = "relay-bob" +ws_port = 10002 [[relaychain.nodes]] -name = "charlie" -rpc_port = 10003 +name = "relay-charlie" +ws_port = 10003 [[parachains]] id = 2000 [parachains.collator] +command = "node-executable" name = "provider-alice" image = "kiltprotocol/dip-provider-node-template:dev-bcc1f405a48563f9620930fde26519ee332e2ab4" ws_port = 10011 -command = "node-executable" [[parachains]] id = 2001 [parachains.collator] +command = "node-executable" name = "consumer-alice" image = "kiltprotocol/dip-consumer-node-template:dev-bcc1f405a48563f9620930fde26519ee332e2ab4" ws_port = 10012 -command = "node-executable" diff --git a/yarn.lock b/yarn.lock index ec5d7c1..cc2d528 100644 --- a/yarn.lock +++ b/yarn.lock @@ -350,6 +350,7 @@ __metadata: "@kiltprotocol/types": 0.34.0-dip-1 "@polkadot/api": ^10.10.1 "@polkadot/util": ^12.5.1 + "@types/node": ^20.9.4 "@typescript-eslint/eslint-plugin": ^6.2.0 "@typescript-eslint/parser": ^6.2.0 "@zombienet/cli": ^1.3.82 @@ -359,7 +360,7 @@ __metadata: eslint-plugin-license-header: ^0.6.0 prettier: ^3.0.0 rimraf: ^5.0.1 - typescript: ^5.1.6 + typescript: ^5.3.2 typescript-object-builder: ^0.3.0 vitest: ^0.33.0 languageName: unknown @@ -1518,7 +1519,7 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:>=13.7.0": +"@types/node@npm:>=13.7.0, @types/node@npm:^20.9.4": version: 20.9.4 resolution: "@types/node@npm:20.9.4" dependencies: @@ -5722,7 +5723,7 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^5.1.6, typescript@npm:^5.2.2": +"typescript@npm:^5.2.2, typescript@npm:^5.3.2": version: 5.3.2 resolution: "typescript@npm:5.3.2" bin: @@ -5732,9 +5733,9 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@^5.1.6#~builtin, typescript@patch:typescript@^5.2.2#~builtin": +"typescript@patch:typescript@^5.2.2#~builtin, typescript@patch:typescript@^5.3.2#~builtin": version: 5.3.2 - resolution: "typescript@patch:typescript@npm%3A5.3.2#~builtin::version=5.3.2&hash=5da071" + resolution: "typescript@patch:typescript@npm%3A5.3.2#~builtin::version=5.3.2&hash=14eedb" bin: tsc: bin/tsc tsserver: bin/tsserver From 44bbf686039e18eaf3a04dc4cbcff618a2f76c69 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Thu, 23 Nov 2023 10:10:45 +0100 Subject: [PATCH 04/22] Change to image compiled in release mode --- tests/sibling-zombienet.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sibling-zombienet.toml b/tests/sibling-zombienet.toml index 5be4633..347315a 100644 --- a/tests/sibling-zombienet.toml +++ b/tests/sibling-zombienet.toml @@ -28,7 +28,7 @@ id = 2000 [parachains.collator] command = "node-executable" name = "provider-alice" -image = "kiltprotocol/dip-provider-node-template:dev-bcc1f405a48563f9620930fde26519ee332e2ab4" +image = "kiltprotocol/dip-provider-node-template:dev-release-bcc1f405a48563f9620930fde26519ee332e2ab4" ws_port = 10011 [[parachains]] @@ -37,5 +37,5 @@ id = 2001 [parachains.collator] command = "node-executable" name = "consumer-alice" -image = "kiltprotocol/dip-consumer-node-template:dev-bcc1f405a48563f9620930fde26519ee332e2ab4" +image = "kiltprotocol/dip-consumer-node-template:dev-release-bcc1f405a48563f9620930fde26519ee332e2ab4" ws_port = 10012 From 8ba8b3e08e42812151401ac4a036611f6fa51403 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Thu, 23 Nov 2023 11:19:51 +0100 Subject: [PATCH 05/22] Remove debug mode for zombienet --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 59d4941..a038d89 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "test:e2e": "vitest run tests", "prepublish": "yarn exec cp -f ../../LICENSE .", "publish": "yarn npm publish --access=public --tolerate-republish", - "test:e2e:zombienet:sibling": "DEBUG=\"zombie*\" yarn zombienet --spawn-concurrency 3 spawn tests/sibling-zombienet.toml" + "test:e2e:zombienet:sibling": "yarn zombienet --spawn-concurrency 3 spawn tests/sibling-zombienet.toml" }, "stableVersion": "0.0.0", "type": "module", From c628637d8d62879e635bfacc1bb7f2b9fcd80d4b Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Thu, 23 Nov 2023 12:33:54 +0100 Subject: [PATCH 06/22] Add both rpc_port and ws_port options to config file --- tests/sibling-zombienet.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/sibling-zombienet.toml b/tests/sibling-zombienet.toml index 347315a..7f63ddc 100644 --- a/tests/sibling-zombienet.toml +++ b/tests/sibling-zombienet.toml @@ -12,14 +12,17 @@ default_substrate_cli_args_version = 1 [[relaychain.nodes]] name = "relay-alice" +rpc_port = 10001 ws_port = 10001 [[relaychain.nodes]] name = "relay-bob" +rpc_port = 10002 ws_port = 10002 [[relaychain.nodes]] name = "relay-charlie" +rpc_port = 10003 ws_port = 10003 [[parachains]] @@ -29,6 +32,7 @@ id = 2000 command = "node-executable" name = "provider-alice" image = "kiltprotocol/dip-provider-node-template:dev-release-bcc1f405a48563f9620930fde26519ee332e2ab4" +rpc_port = 10011 ws_port = 10011 [[parachains]] @@ -38,4 +42,5 @@ id = 2001 command = "node-executable" name = "consumer-alice" image = "kiltprotocol/dip-consumer-node-template:dev-release-bcc1f405a48563f9620930fde26519ee332e2ab4" +rpc_port = 10012 ws_port = 10012 From c57f9787d1a0c39adc3fd6e7e15ebccbe8b3af93 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Mon, 27 Nov 2023 11:08:25 +0100 Subject: [PATCH 07/22] Fix zombienet config --- tests/sibling-zombienet.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/sibling-zombienet.toml b/tests/sibling-zombienet.toml index 7f63ddc..ec1a01a 100644 --- a/tests/sibling-zombienet.toml +++ b/tests/sibling-zombienet.toml @@ -1,9 +1,6 @@ [settings] enable_tracing = false -node_spawn_timeout = 600 provider = "kubernetes" -# 30 min -timeout = 1800 [relaychain] chain = "rococo-local" From 6a20c7ff8684051a73b65c6a6eeb627f192bca29 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Mon, 27 Nov 2023 16:11:45 +0100 Subject: [PATCH 08/22] WIP tests --- package.json | 13 +- src/parent.ts | 17 -- src/sibling.ts | 20 --- tests/sibling.test.ts | 72 +++++++++ tests/utils.ts | 110 +++++++++++++ .../sibling.toml} | 0 tsconfig.base.json | 7 +- tsconfig.check.json | 7 - tsconfig.cjs.json | 7 +- tsconfig.esm.json | 15 ++ tsconfig.json | 13 +- yarn.lock | 147 ++++++++++++++++++ 12 files changed, 371 insertions(+), 57 deletions(-) create mode 100644 tests/sibling.test.ts create mode 100644 tests/utils.ts rename tests/{sibling-zombienet.toml => zombienet/sibling.toml} (100%) delete mode 100644 tsconfig.check.json create mode 100644 tsconfig.esm.json diff --git a/package.json b/package.json index a038d89..21e832c 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,10 @@ "@kiltprotocol/did": "0.34.0-dip-1", "@kiltprotocol/types": "0.34.0-dip-1", "@polkadot/api": "^10.10.1", - "@polkadot/util": "^12.5.1", - "typescript-object-builder": "^0.3.0" + "@polkadot/util": "^12.5.1" }, "devDependencies": { + "@kiltprotocol/sdk-js": "^0.34.0-dip-1", "@types/node": "^20.9.4", "@typescript-eslint/eslint-plugin": "^6.2.0", "@typescript-eslint/parser": "^6.2.0", @@ -20,6 +20,7 @@ "prettier": "^3.0.0", "rimraf": "^5.0.1", "typescript": "^5.3.2", + "typescript-object-builder": "^0.3.0", "vitest": "^0.33.0" }, "engines": { @@ -43,15 +44,15 @@ "scripts": { "build": "yarn build:cjs && yarn build:esm", "build:cjs": "run -T tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json", - "build:esm": "run -T tsc -p tsconfig.json && echo '{\"type\": \"module\"}' > ./dist/esm/package.json", - "check": "tsc -p tsconfig.check.json", + "build:esm": "run -T tsc -p tsconfig.esm.json && echo '{\"type\": \"module\"}' > ./dist/esm/package.json", + "check": "tsc -p tsconfig.json", "clean": "yarn rimraf -g */{cjs,esm}", "lint": "eslint --ext .ts . && prettier -c .", "lint:fix": "prettier -w . && eslint --fix --ext .ts .", - "test:e2e": "vitest run tests", "prepublish": "yarn exec cp -f ../../LICENSE .", "publish": "yarn npm publish --access=public --tolerate-republish", - "test:e2e:zombienet:sibling": "yarn zombienet --spawn-concurrency 3 spawn tests/sibling-zombienet.toml" + "test:e2e": "vitest run tests", + "test:e2e:zombienet:sibling:start": "yarn zombienet --spawn-concurrency 3 spawn tests/zombienet/sibling.toml" }, "stableVersion": "0.0.0", "type": "module", diff --git a/src/parent.ts b/src/parent.ts index 382d548..b1b76aa 100644 --- a/src/parent.ts +++ b/src/parent.ts @@ -8,7 +8,6 @@ import { toChain } from "@kiltprotocol/did" import { ApiPromise } from "@polkadot/api" import { u8aToHex } from "@polkadot/util" -import { ObjectBuilder } from "typescript-object-builder" import { defaultValues, @@ -51,26 +50,10 @@ export type DipParentProofInput = { linkedAccounts?: readonly PalletDidLookupLinkableAccountLinkableAccountId[] } -/** - * Return a new instance of the builder to generate DIP proofs for the parent relaychain. - * - * @returns A fresh instance of an [[ObjectBuilder]]. - */ -export function dipParentProofBuilder(): ObjectBuilder { - return ObjectBuilder.new() -} /** * Generate a submittable extrinsic for the provided call which includes a complete DIP proof according to the parameters provided, to be used on the relay chain of which the provider chain is a parachain. * - * Parameters can be provided directly or can be combined on the builder. - * - * @example - * const builder = dipParentProofBuilder() - * builder.with(...).with(...).with(...) - * const params = builder.build() - * const proof = generateDipProofForParent(params) - * * @param params The DIP proof params. * @param params.call The [[Call]] on the relay chain that requires a DIP origin. * @param params.didUri The DID URI of the DIP subject that is performing the cross-chain operation. diff --git a/src/sibling.ts b/src/sibling.ts index e1467bb..cf144ee 100644 --- a/src/sibling.ts +++ b/src/sibling.ts @@ -8,7 +8,6 @@ import { toChain } from "@kiltprotocol/did" import { ApiPromise } from "@polkadot/api" import { u8aToHex } from "@polkadot/util" -import { ObjectBuilder } from "typescript-object-builder" import { defaultValues, @@ -52,27 +51,8 @@ export type DipSiblingProofInput = { linkedAccounts?: readonly PalletDidLookupLinkableAccountLinkableAccountId[] } -/** - * Return a new instance of the builder to generate DIP proofs for a sibling parachain. - * - * @returns A fresh instance of an [[ObjectBuilder]]. - */ -export function dipSiblingProofBuilder(): ObjectBuilder { - return ObjectBuilder.new() -} - /** * Generate a submittable extrinsic for the provided call which includes a complete DIP proof according to the parameters provided, to be used on a consumer chain of which the provider chain is a sibling. - * - * Parameters can be provided directly or can be combined on the builder. - * - * @example - * const builder = dipSiblingProofBuilder() - * builder.with(...).with(...).with(...) - * const params = builder.build() - * const proof = generateDipProofForSibling(params) - * - * * @param params The DIP proof params. * @param params.call The [[Call]] on the consumer chain that requires a DIP origin. * @param params.consumerApi The [[ApiPromise]] instance for the consumer chain. diff --git a/tests/sibling.test.ts b/tests/sibling.test.ts new file mode 100644 index 0000000..63db937 --- /dev/null +++ b/tests/sibling.test.ts @@ -0,0 +1,72 @@ +/** + * Copyright (c) 2023, BOTLabs GmbH. + * + * This source code is licensed under the BSD 4-Clause "Original" license + * found in the LICENSE file in the root directory of this source tree. + */ + +import * as Kilt from "@kiltprotocol/sdk-js" +import { ApiPromise, WsProvider } from "@polkadot/api" +import { ObjectBuilder } from "typescript-object-builder" +import { beforeAll, describe, it, beforeEach } from "vitest" + +import { createProviderApi } from './utils.js' + +import type { DipSiblingProofInput } from '@kiltprotocol/dip-sdk' +import type { DidDocument, KiltAddress, SignExtrinsicCallback, VerificationKeyType } from "@kiltprotocol/types" +import { GetStoreTxSignCallback } from "@kiltprotocol/did" + +const partialSiblingBuilder = + ObjectBuilder.new() + .with('accountIdRuntimeType', 'AccountId32') + .with('blockNumberRuntimeType', 'u32') + .with('identityDetailsRuntimeType', 'Option') +const keyring = new Kilt.Utils.Keyring({ type: 'sr25519', ss58Format: Kilt.Utils.ss58Format }) +const sudoKeypair = keyring.addFromUri('//Alice') + +Kilt.ConfigService.set({ 'submitTxResolveOn': Kilt.Blockchain.IS_IN_BLOCK }) + +describe('V0', () => { + let v0SiblingBuilder: typeof partialSiblingBuilder = Object.create(partialSiblingBuilder) + + let relayApi: ApiPromise + let providerApi: ApiPromise + let consumerApi: ApiPromise + let submitterKeypair: Kilt.KeyringPair + let did: DidDocument + let didKeypair: Kilt.KeyringPair + + beforeAll(async () => { + relayApi = await ApiPromise.create({ provider: new WsProvider('ws://127.0.0.1:35265') }) + providerApi = await Kilt.connect('ws://127.0.0.1:43931') + consumerApi = await ApiPromise.create({ provider: new WsProvider('ws://127.0.0.1:42107') }) + + v0SiblingBuilder = v0SiblingBuilder.with('relayApi', relayApi).with('providerApi', providerApi).with('consumerApi', consumerApi) + }) + + beforeEach(async () => { + // TODO: Deploy the `utility` pallet on the provider and consumer templates, and batch all txs into a single `api.tx.utility.batchAll()`. + const newSubmitterKeypair = keyring.addFromMnemonic(Kilt.Utils.Crypto.mnemonicGenerate()) + const balanceTransferTx = providerApi.tx.balances.transfer(newSubmitterKeypair.address, 10 ** 15) + await Kilt.Blockchain.signAndSubmitTx(balanceTransferTx, sudoKeypair) + const newDidKeypair = keyring.addFromMnemonic(Kilt.Utils.Crypto.mnemonicGenerate()) + // @ts-expect-error We know that the type is an "sr25519" + const newLightDid = Kilt.Did.createLightDidDocument({ authentication: [{ ...newDidKeypair }] }) + const signCallback: GetStoreTxSignCallback = (async ({ data }) => ({ signature: await newDidKeypair.sign(data), keyType: newDidKeypair.type as VerificationKeyType })) + const creationTx = await Kilt.Did.getStoreTx(newLightDid, newSubmitterKeypair.address as KiltAddress, signCallback) + await Kilt.Blockchain.signAndSubmitTx(creationTx, newSubmitterKeypair) + const newFullDid = (await Kilt.Did.resolve(newLightDid.uri))?.document as DidDocument + const web3NameTx = await Kilt.Did.authorizeTx(newFullDid.uri, providerApi.tx.web3Names.claim('test'), signCallback, newSubmitterKeypair.address as KiltAddress) + await Kilt.Blockchain.signAndSubmitTx(web3NameTx, newSubmitterKeypair) + const commitIdentityTx = await Kilt.Did.authorizeTx(newFullDid.uri, providerApi.tx.dipProvider.commitIdentity(Kilt.Did.toChain(newFullDid.uri), 0), signCallback, newSubmitterKeypair.address as KiltAddress) + await Kilt.Blockchain.signAndSubmitTx(commitIdentityTx, newSubmitterKeypair, { resolveOn: Kilt.Blockchain.IS_FINALIZED }) + submitterKeypair = newSubmitterKeypair + did = newFullDid + didKeypair = newDidKeypair + }, 60_000) + + it('Test successful call', async () => { + + await ApiPromise.create({ provider: new WsProvider('ws://127.0.0.1:35265') }) + }) +}) diff --git a/tests/utils.ts b/tests/utils.ts new file mode 100644 index 0000000..44f4caf --- /dev/null +++ b/tests/utils.ts @@ -0,0 +1,110 @@ +/** + * Copyright (c) 2023, BOTLabs GmbH. + * + * This source code is licensed under the BSD 4-Clause "Original" license + * found in the LICENSE file in the root directory of this source tree. + */ + +import { didCalls, types } from "@kiltprotocol/type-definitions" +import { ApiPromise, WsProvider } from "@polkadot/api" + +import type { DefinitionsCall, RegistryTypes } from '@polkadot/types/types' + +const dipProviderCalls: DefinitionsCall = { + DipProvider: [ + { + methods: { + generate_proof: { + description: + 'Generate a Merkle proof for the DIP protocol for the specified request parameters.', + params: [ + { + name: 'request', + type: 'DipProofRequest', + }, + ], + type: 'Result', + }, + }, + version: 1, + }, + ], + ...didCalls, +} +const dipProviderTypes: RegistryTypes = { + ...types, + IdentityCommitmentVersion: 'u16', + // DipProvider state_call + DipProofRequest: { + identifier: 'AccountId32', + version: 'IdentityCommitmentVersion', + keys: 'Vec', + accounts: 'Vec', + shouldIncludeWeb3Name: 'bool', + }, + CompleteMerkleProof: { + root: 'MerkleRoot', + proof: 'MerkleProof', + }, + MerkleRoot: 'Hash', + MerkleProof: { + blinded: 'BlindedLeaves', + revealed: 'RevealedLeaves', + }, + BlindedLeaves: 'Vec', + BlindedValue: 'Bytes', + RevealedLeaves: 'Vec', + RevealedLeaf: { + _enum: { + DidKey: '(DidKeyMerkleKey, DidKeyMerkleValue)', + Web3Name: '(Web3NameMerkleKey, Web3NameMerkleValue)', + LinkedAccount: '(LinkedAccountMerkleKey, LinkedAccountMerkleValue)', + }, + }, + DidKeyMerkleKey: '(KeyId, KeyRelationship)', + KeyId: 'Hash', + KeyRelationship: { + _enum: { + Encryption: 'Null', + Verification: 'VerificationRelationship', + }, + }, + VerificationRelationship: { + _enum: [ + 'Authentication', + 'CapabilityDelegation', + 'CapabilityInvocation', + 'AssertionMethod', + ], + }, + DidKeyMerkleValue: 'DidDidDetailsDidPublicKeyDetails', + Web3NameMerkleKey: 'Text', + Web3NameMerkleValue: 'BlockNumber', + LinkedAccountMerkleKey: 'PalletDidLookupLinkableAccountLinkableAccountId', + LinkedAccountMerkleValue: 'Null', + RuntimeApiDipProofError: { + _enum: { + IdentityProvider: 'LinkedDidIdentityProviderError', + MerkleProof: 'DidMerkleProofError', + }, + }, + LinkedDidIdentityProviderError: { + _enum: ['DidNotFound', 'DidDeleted', 'Internal'], + }, + DidIdentityProviderError: { + _enum: ['DidNotFound', 'Internal'], + }, + DidMerkleProofError: { + _enum: [ + 'UnsupportedVersion', + 'KeyNotFound', + 'LinkedAccountNotFound', + 'Web3NameNotFound', + 'Internal', + ], + }, +} + +export async function createProviderApi(address: string): Promise { + return ApiPromise.create({ provider: new WsProvider(address), runtime: dipProviderCalls, types: dipProviderTypes }) +} diff --git a/tests/sibling-zombienet.toml b/tests/zombienet/sibling.toml similarity index 100% rename from tests/sibling-zombienet.toml rename to tests/zombienet/sibling.toml diff --git a/tsconfig.base.json b/tsconfig.base.json index ab55f87..5850851 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -9,10 +9,11 @@ "forceConsistentCasingInFileNames": true, "baseUrl": ".", "sourceMap": false, - "declaration": false, "declarationMap": false, "esModuleInterop": false, - "skipLibCheck": true + "skipLibCheck": true, }, - "exclude": ["node_modules", "**/*.test.ts", "**/*.d.ts"] + "exclude": [ + "**/*.d.ts" + ] } diff --git a/tsconfig.check.json b/tsconfig.check.json deleted file mode 100644 index 234f24e..0000000 --- a/tsconfig.check.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "noEmit": true - }, - "include": ["tests/**/*.ts", "src/**/*.ts"] -} diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json index 252cc94..8215b13 100644 --- a/tsconfig.cjs.json +++ b/tsconfig.cjs.json @@ -5,5 +5,10 @@ "module": "CommonJS", "declaration": true }, - "include": ["src"] + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "node_modules", + ] } diff --git a/tsconfig.esm.json b/tsconfig.esm.json new file mode 100644 index 0000000..70f4eed --- /dev/null +++ b/tsconfig.esm.json @@ -0,0 +1,15 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "outDir": "dist/esm", + "module": "Node16", + "moduleResolution": "Node16", + "declaration": true + }, + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "node_modules", + ] +} diff --git a/tsconfig.json b/tsconfig.json index 600ade1..fd3993f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,17 @@ { "extends": "./tsconfig.base.json", "compilerOptions": { - "outDir": "dist/esm", "module": "Node16", "moduleResolution": "Node16", - "declaration": true + "noEmit": true, + "paths": { + "@kiltprotocol/dip-sdk": [ + "src/index.ts" + ] + } }, - "include": ["src"] + "include": [ + "tests/**/*.ts", + "src/**/*.ts" + ] } diff --git a/yarn.lock b/yarn.lock index cc2d528..935e3a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -303,6 +303,25 @@ __metadata: languageName: node linkType: hard +"@kiltprotocol/asset-did@npm:0.34.0": + version: 0.34.0 + resolution: "@kiltprotocol/asset-did@npm:0.34.0" + dependencies: + "@kiltprotocol/types": 0.34.0 + "@kiltprotocol/utils": 0.34.0 + checksum: 5af3ab90c19b83fe82bcecd39e3d6578a42198a855c3d2a00f3e921070da628775d3742001ecc288ed89211bbc5ba861ccd4a092f5ca620425c299d8aae57ee5 + languageName: node + linkType: hard + +"@kiltprotocol/augment-api@npm:0.34.0": + version: 0.34.0 + resolution: "@kiltprotocol/augment-api@npm:0.34.0" + dependencies: + "@kiltprotocol/type-definitions": 0.34.0 + checksum: 21d9944e980a080ec3bbc24e5733970ef5d444d3cbb916a45c7a70fb86e23ee31386c498e2b3ef1958e2e4c17587c38000c3e71ff2fcae3458870e812564328b + languageName: node + linkType: hard + "@kiltprotocol/augment-api@npm:0.34.0-dip-1": version: 0.34.0-dip-1 resolution: "@kiltprotocol/augment-api@npm:0.34.0-dip-1" @@ -312,6 +331,30 @@ __metadata: languageName: node linkType: hard +"@kiltprotocol/chain-helpers@npm:0.34.0": + version: 0.34.0 + resolution: "@kiltprotocol/chain-helpers@npm:0.34.0" + dependencies: + "@kiltprotocol/config": 0.34.0 + "@kiltprotocol/types": 0.34.0 + "@kiltprotocol/utils": 0.34.0 + "@polkadot/api": ^10.4.0 + "@polkadot/types": ^10.4.0 + checksum: 75af0407b5ae816d758a5338438980fac1ba402857afa9ddd05c91267aee4d18df301cd3ca3804135723c0c067edf6607f9923e857668b1cd8a4db6f2cd30cdb + languageName: node + linkType: hard + +"@kiltprotocol/config@npm:0.34.0": + version: 0.34.0 + resolution: "@kiltprotocol/config@npm:0.34.0" + dependencies: + "@kiltprotocol/types": 0.34.0 + "@polkadot/api": ^10.4.0 + typescript-logging: ^1.0.0 + checksum: 325ab05b72029b89fe74392073044ce137b4482f75bb939aef55b1d442933bc36e9ceca3e708b7bd1ce423e748f32fc176dec02b41abe866123c35196b345fd7 + languageName: node + linkType: hard + "@kiltprotocol/config@npm:0.34.0-dip-1": version: 0.34.0-dip-1 resolution: "@kiltprotocol/config@npm:0.34.0-dip-1" @@ -323,6 +366,45 @@ __metadata: languageName: node linkType: hard +"@kiltprotocol/core@npm:0.34.0": + version: 0.34.0 + resolution: "@kiltprotocol/core@npm:0.34.0" + dependencies: + "@kiltprotocol/asset-did": 0.34.0 + "@kiltprotocol/augment-api": 0.34.0 + "@kiltprotocol/chain-helpers": 0.34.0 + "@kiltprotocol/config": 0.34.0 + "@kiltprotocol/did": 0.34.0 + "@kiltprotocol/type-definitions": 0.34.0 + "@kiltprotocol/types": 0.34.0 + "@kiltprotocol/utils": 0.34.0 + "@polkadot/api": ^10.4.0 + "@polkadot/keyring": ^12.0.0 + "@polkadot/types": ^10.4.0 + "@polkadot/util": ^12.0.0 + "@polkadot/util-crypto": ^12.0.0 + checksum: d29af7bcae221a230e01bbf639feb954d1316c81c5f214508ea9e0e3b5d14b13ee4bef0d9a4dfc55a51bca6901a0ff1d65e799dc81a1417ed295ebe73020a09a + languageName: node + linkType: hard + +"@kiltprotocol/did@npm:0.34.0": + version: 0.34.0 + resolution: "@kiltprotocol/did@npm:0.34.0" + dependencies: + "@kiltprotocol/augment-api": 0.34.0 + "@kiltprotocol/config": 0.34.0 + "@kiltprotocol/types": 0.34.0 + "@kiltprotocol/utils": 0.34.0 + "@polkadot/api": ^10.4.0 + "@polkadot/keyring": ^12.0.0 + "@polkadot/types": ^10.4.0 + "@polkadot/types-codec": ^10.4.0 + "@polkadot/util": ^12.0.0 + "@polkadot/util-crypto": ^12.0.0 + checksum: 726938609d082a166d2b281629d044cd673c1433e269eb2fcea0b6629274076f0310f6cbe15bedbd1552af6976d61cf03c7c001bedbe9744b9cdf9cb95d7b26c + languageName: node + linkType: hard + "@kiltprotocol/did@npm:0.34.0-dip-1": version: 0.34.0-dip-1 resolution: "@kiltprotocol/did@npm:0.34.0-dip-1" @@ -347,6 +429,7 @@ __metadata: resolution: "@kiltprotocol/dip-sdk@workspace:." dependencies: "@kiltprotocol/did": 0.34.0-dip-1 + "@kiltprotocol/sdk-js": ^0.34.0-dip-1 "@kiltprotocol/types": 0.34.0-dip-1 "@polkadot/api": ^10.10.1 "@polkadot/util": ^12.5.1 @@ -366,6 +449,41 @@ __metadata: languageName: unknown linkType: soft +"@kiltprotocol/messaging@npm:0.34.0": + version: 0.34.0 + resolution: "@kiltprotocol/messaging@npm:0.34.0" + dependencies: + "@kiltprotocol/core": 0.34.0 + "@kiltprotocol/did": 0.34.0 + "@kiltprotocol/types": 0.34.0 + "@kiltprotocol/utils": 0.34.0 + "@polkadot/util": ^12.0.0 + checksum: c04de6ee015127d025d59fa469c01d831b02d6e0372cd005664efbbeb0ef9df68edf0ed869caa8b3752442d355a53eaca8f7c7ca99ba7678a4cb099b8a51ff37 + languageName: node + linkType: hard + +"@kiltprotocol/sdk-js@npm:^0.34.0-dip-1": + version: 0.34.0 + resolution: "@kiltprotocol/sdk-js@npm:0.34.0" + dependencies: + "@kiltprotocol/chain-helpers": 0.34.0 + "@kiltprotocol/config": 0.34.0 + "@kiltprotocol/core": 0.34.0 + "@kiltprotocol/did": 0.34.0 + "@kiltprotocol/messaging": 0.34.0 + "@kiltprotocol/types": 0.34.0 + "@kiltprotocol/utils": 0.34.0 + checksum: 4001a6dd05da8ffaf2c0be7d91d6007ae5d41dd20e4903e73026e7b26871265bd52c8cb24b830b0d5b1ac5a8d14c355bf55f12b5b982fcb9a7c51233f25dc95e + languageName: node + linkType: hard + +"@kiltprotocol/type-definitions@npm:0.34.0": + version: 0.34.0 + resolution: "@kiltprotocol/type-definitions@npm:0.34.0" + checksum: be189e53514d4f26f5ac54f8bcd9672ad0d311a12a01e3f9c43c8cf1c637f953e085ee2ffa2c617c8ca763b8a22dc17af3a099658e08f401654f4ca44bb62af2 + languageName: node + linkType: hard + "@kiltprotocol/type-definitions@npm:0.34.0-dip-1": version: 0.34.0-dip-1 resolution: "@kiltprotocol/type-definitions@npm:0.34.0-dip-1" @@ -373,6 +491,19 @@ __metadata: languageName: node linkType: hard +"@kiltprotocol/types@npm:0.34.0": + version: 0.34.0 + resolution: "@kiltprotocol/types@npm:0.34.0" + dependencies: + "@polkadot/api": ^10.4.0 + "@polkadot/keyring": ^12.0.0 + "@polkadot/types": ^10.4.0 + "@polkadot/util": ^12.0.0 + "@polkadot/util-crypto": ^12.0.0 + checksum: e6ea69749c71f405eb20c20783b230c7a335f20346730601fe00bea0cc0c55b6c229de02cb76bdd536df645a4f4dd4e2d03f3cb43c7be8a10127148ca08570a7 + languageName: node + linkType: hard + "@kiltprotocol/types@npm:0.34.0-dip-1": version: 0.34.0-dip-1 resolution: "@kiltprotocol/types@npm:0.34.0-dip-1" @@ -386,6 +517,22 @@ __metadata: languageName: node linkType: hard +"@kiltprotocol/utils@npm:0.34.0": + version: 0.34.0 + resolution: "@kiltprotocol/utils@npm:0.34.0" + dependencies: + "@kiltprotocol/types": 0.34.0 + "@polkadot/api": ^10.4.0 + "@polkadot/keyring": ^12.0.0 + "@polkadot/util": ^12.0.0 + "@polkadot/util-crypto": ^12.0.0 + cbor-web: ^9.0.0 + tweetnacl: ^1.0.3 + uuid: ^9.0.0 + checksum: de67168544d16ba03d0d8177a14e7defad53c97bd24055d5722bb89e7eeb6b9bbb82e30163cc05aef382f55d8719dd4ffb4372c146f368d4852f1659131fdba9 + languageName: node + linkType: hard + "@kiltprotocol/utils@npm:0.34.0-dip-1": version: 0.34.0-dip-1 resolution: "@kiltprotocol/utils@npm:0.34.0-dip-1" From 419529e2fe41e483e44c5f0541e0beec3689a11e Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Mon, 27 Nov 2023 16:55:24 +0100 Subject: [PATCH 09/22] Add scripts to start and stop zombienet --- package.json | 3 ++- scripts/start-zombienet | 15 +++++++++++++++ scripts/stop-zombienet | 13 +++++++++++++ tmp/tests/zombienet/sibling.toml | 1 + 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 scripts/start-zombienet create mode 100755 scripts/stop-zombienet create mode 100644 tmp/tests/zombienet/sibling.toml diff --git a/package.json b/package.json index 21e832c..2efd496 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,8 @@ "prepublish": "yarn exec cp -f ../../LICENSE .", "publish": "yarn npm publish --access=public --tolerate-republish", "test:e2e": "vitest run tests", - "test:e2e:zombienet:sibling:start": "yarn zombienet --spawn-concurrency 3 spawn tests/zombienet/sibling.toml" + "test:e2e:zombienet:sibling:start": "./scripts/start-zombienet tests/zombienet/sibling.toml", + "test:e2e:zombienet:sibling:stop": "./scripts/stop-zombienet tests/zombienet/sibling.toml" }, "stableVersion": "0.0.0", "type": "module", diff --git a/scripts/start-zombienet b/scripts/start-zombienet new file mode 100755 index 0000000..007445d --- /dev/null +++ b/scripts/start-zombienet @@ -0,0 +1,15 @@ +#!/usr/bin/env sh + +if [ $# -ne 1 ]; then + echo 'One argument indicating the Zombienet config file path is expected.' + exit 1 +fi + +CONFIG_FILE_PATH=$1 +TMP_FOLDER_FOR_FILE="./tmp/$(dirname $CONFIG_FILE_PATH)" +TMP_FILE_FOR_FILE="./tmp/$CONFIG_FILE_PATH" + +set -x +yarn zombienet --spawn-concurrency 3 spawn $CONFIG_FILE_PATH >/dev/null 2>&1 & +mkdir -p $TMP_FOLDER_FOR_FILE && touch $TMP_FILE_FOR_FILE +echo $! > $TMP_FILE_FOR_FILE diff --git a/scripts/stop-zombienet b/scripts/stop-zombienet new file mode 100755 index 0000000..575532d --- /dev/null +++ b/scripts/stop-zombienet @@ -0,0 +1,13 @@ +#!/usr/bin/env sh + +if [ $# -ne 1 ]; then + echo 'One argument indicating the Zombienet config file path is expected.' + exit 1 +fi + +CONFIG_FILE_PATH=$1 +TMP_FILE_FOR_FILE="./tmp/$CONFIG_FILE_PATH" + +set -x +PID=$(cat $TMP_FILE_FOR_FILE) +kill $PID >/dev/null diff --git a/tmp/tests/zombienet/sibling.toml b/tmp/tests/zombienet/sibling.toml new file mode 100644 index 0000000..51e4f26 --- /dev/null +++ b/tmp/tests/zombienet/sibling.toml @@ -0,0 +1 @@ +2071925 From 3ec89098bf37881d7fdd0969797dbc311096a514 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Mon, 27 Nov 2023 17:09:53 +0100 Subject: [PATCH 10/22] Fix scripts --- scripts/start-zombienet | 2 ++ scripts/stop-zombienet | 5 +++++ tmp/tests/zombienet/sibling.toml | 1 - 3 files changed, 7 insertions(+), 1 deletion(-) delete mode 100644 tmp/tests/zombienet/sibling.toml diff --git a/scripts/start-zombienet b/scripts/start-zombienet index 007445d..d1c24bf 100755 --- a/scripts/start-zombienet +++ b/scripts/start-zombienet @@ -1,5 +1,7 @@ #!/usr/bin/env sh +# Starts a Zombienet network with the provided config file, and saves its pid in a file under the `tmp` directory in the root of the project. + if [ $# -ne 1 ]; then echo 'One argument indicating the Zombienet config file path is expected.' exit 1 diff --git a/scripts/stop-zombienet b/scripts/stop-zombienet index 575532d..58c6e60 100755 --- a/scripts/stop-zombienet +++ b/scripts/stop-zombienet @@ -1,5 +1,7 @@ #!/usr/bin/env sh +# Stops a previously-run Zombienet network with the provided config file by killing the process with the retrieved pid and delete any temp files for it. + if [ $# -ne 1 ]; then echo 'One argument indicating the Zombienet config file path is expected.' exit 1 @@ -11,3 +13,6 @@ TMP_FILE_FOR_FILE="./tmp/$CONFIG_FILE_PATH" set -x PID=$(cat $TMP_FILE_FOR_FILE) kill $PID >/dev/null +rm -rf $TMP_FILE_FOR_FILE +# Remove whole hierarchy if not other file is present. +find ./tmp -depth -type d -empty -exec rmdir "{}" \; diff --git a/tmp/tests/zombienet/sibling.toml b/tmp/tests/zombienet/sibling.toml deleted file mode 100644 index 51e4f26..0000000 --- a/tmp/tests/zombienet/sibling.toml +++ /dev/null @@ -1 +0,0 @@ -2071925 From ed390a5f1896c54193ed4a1f217e0d998dc0d770 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Mon, 27 Nov 2023 18:01:11 +0100 Subject: [PATCH 11/22] WIP --- package.json | 2 +- scripts/start-zombienet | 15 +++++++++++---- scripts/stop-zombienet | 4 +++- tests/sibling.test.ts | 19 ++++++++++++------- tests/zombienet/sibling.toml | 4 ++-- 5 files changed, 29 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 2efd496..15e138f 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "prepublish": "yarn exec cp -f ../../LICENSE .", "publish": "yarn npm publish --access=public --tolerate-republish", "test:e2e": "vitest run tests", - "test:e2e:zombienet:sibling:start": "./scripts/start-zombienet tests/zombienet/sibling.toml", + "test:e2e:zombienet:sibling:start": "yarn test:e2e:zombienet:sibling:stop; ./scripts/start-zombienet tests/zombienet/sibling.toml", "test:e2e:zombienet:sibling:stop": "./scripts/stop-zombienet tests/zombienet/sibling.toml" }, "stableVersion": "0.0.0", diff --git a/scripts/start-zombienet b/scripts/start-zombienet index d1c24bf..e0b8724 100755 --- a/scripts/start-zombienet +++ b/scripts/start-zombienet @@ -7,11 +7,18 @@ if [ $# -ne 1 ]; then exit 1 fi +# Path of the Zombienet config file provided to the script CONFIG_FILE_PATH=$1 +# Tmp folder under "./tmp" from the project's root TMP_FOLDER_FOR_FILE="./tmp/$(dirname $CONFIG_FILE_PATH)" -TMP_FILE_FOR_FILE="./tmp/$CONFIG_FILE_PATH" +# Path to store the pid of the current Zombienet setup +TMP_PID_FILE_FOR_FILE="./tmp/$CONFIG_FILE_PATH" +# Path to store the out logs of the current Zombienet setup +TMP_LOG_FILE_FOR_FILE="$TMP_PID_FILE_FOR_FILE-out.txt" +# Path to store the err logs of the current Zombienet setup +TMP_ERR_FILE_FOR_FILE="$TMP_PID_FILE_FOR_FILE-err.txt" set -x -yarn zombienet --spawn-concurrency 3 spawn $CONFIG_FILE_PATH >/dev/null 2>&1 & -mkdir -p $TMP_FOLDER_FOR_FILE && touch $TMP_FILE_FOR_FILE -echo $! > $TMP_FILE_FOR_FILE +mkdir -p $TMP_FOLDER_FOR_FILE && touch $TMP_FILE_FOR_FILE $TMP_LOG_FILE_FOR_FILE $TMP_ERR_FILE_FOR_FILE +yarn zombienet --spawn-concurrency 3 spawn $CONFIG_FILE_PATH >$TMP_LOG_FILE_FOR_FILE 2>$TMP_ERR_FILE_FOR_FILE & +echo $! > $TMP_PID_FILE_FOR_FILE diff --git a/scripts/stop-zombienet b/scripts/stop-zombienet index 58c6e60..a444702 100755 --- a/scripts/stop-zombienet +++ b/scripts/stop-zombienet @@ -9,10 +9,12 @@ fi CONFIG_FILE_PATH=$1 TMP_FILE_FOR_FILE="./tmp/$CONFIG_FILE_PATH" +TMP_LOG_FILE_FOR_FILE="$TMP_FILE_FOR_FILE-out.txt" +TMP_ERR_FILE_FOR_FILE="$TMP_FILE_FOR_FILE-err.txt" set -x PID=$(cat $TMP_FILE_FOR_FILE) kill $PID >/dev/null -rm -rf $TMP_FILE_FOR_FILE +rm -rf $TMP_FILE_FOR_FILE $TMP_LOG_FILE_FOR_FILE $TMP_ERR_FILE_FOR_FILE # Remove whole hierarchy if not other file is present. find ./tmp -depth -type d -empty -exec rmdir "{}" \; diff --git a/tests/sibling.test.ts b/tests/sibling.test.ts index 63db937..eb715a7 100644 --- a/tests/sibling.test.ts +++ b/tests/sibling.test.ts @@ -5,6 +5,8 @@ * found in the LICENSE file in the root directory of this source tree. */ +// TODO: Push new Docker images baeing built on the kilt-node, update the Zombienet configuration and try again + import * as Kilt from "@kiltprotocol/sdk-js" import { ApiPromise, WsProvider } from "@polkadot/api" import { ObjectBuilder } from "typescript-object-builder" @@ -45,21 +47,24 @@ describe('V0', () => { }) beforeEach(async () => { - // TODO: Deploy the `utility` pallet on the provider and consumer templates, and batch all txs into a single `api.tx.utility.batchAll()`. const newSubmitterKeypair = keyring.addFromMnemonic(Kilt.Utils.Crypto.mnemonicGenerate()) const balanceTransferTx = providerApi.tx.balances.transfer(newSubmitterKeypair.address, 10 ** 15) await Kilt.Blockchain.signAndSubmitTx(balanceTransferTx, sudoKeypair) const newDidKeypair = keyring.addFromMnemonic(Kilt.Utils.Crypto.mnemonicGenerate()) // @ts-expect-error We know that the type is an "sr25519" const newLightDid = Kilt.Did.createLightDidDocument({ authentication: [{ ...newDidKeypair }] }) + const newFullDidUri = Kilt.Did.getFullDidUri(newLightDid.uri) const signCallback: GetStoreTxSignCallback = (async ({ data }) => ({ signature: await newDidKeypair.sign(data), keyType: newDidKeypair.type as VerificationKeyType })) - const creationTx = await Kilt.Did.getStoreTx(newLightDid, newSubmitterKeypair.address as KiltAddress, signCallback) - await Kilt.Blockchain.signAndSubmitTx(creationTx, newSubmitterKeypair) + const didCreationTx = await Kilt.Did.getStoreTx(newLightDid, newSubmitterKeypair.address as KiltAddress, signCallback) + const web3NameTx = await Kilt.Did.authorizeTx(newFullDidUri, providerApi.tx.web3Names.claim('test'), signCallback, newSubmitterKeypair.address as KiltAddress) + const commitIdentityTx = await Kilt.Did.authorizeTx(newFullDidUri, providerApi.tx.dipProvider.commitIdentity(Kilt.Did.toChain(newFullDidUri), 0), signCallback, newSubmitterKeypair.address as KiltAddress) + const batchedTx = providerApi.tx.utility.batchAll([ + didCreationTx, + web3NameTx, + commitIdentityTx + ]) + await Kilt.Blockchain.signAndSubmitTx(batchedTx, newSubmitterKeypair, { resolveOn: Kilt.Blockchain.IS_FINALIZED }) const newFullDid = (await Kilt.Did.resolve(newLightDid.uri))?.document as DidDocument - const web3NameTx = await Kilt.Did.authorizeTx(newFullDid.uri, providerApi.tx.web3Names.claim('test'), signCallback, newSubmitterKeypair.address as KiltAddress) - await Kilt.Blockchain.signAndSubmitTx(web3NameTx, newSubmitterKeypair) - const commitIdentityTx = await Kilt.Did.authorizeTx(newFullDid.uri, providerApi.tx.dipProvider.commitIdentity(Kilt.Did.toChain(newFullDid.uri), 0), signCallback, newSubmitterKeypair.address as KiltAddress) - await Kilt.Blockchain.signAndSubmitTx(commitIdentityTx, newSubmitterKeypair, { resolveOn: Kilt.Blockchain.IS_FINALIZED }) submitterKeypair = newSubmitterKeypair did = newFullDid didKeypair = newDidKeypair diff --git a/tests/zombienet/sibling.toml b/tests/zombienet/sibling.toml index ec1a01a..d6126f4 100644 --- a/tests/zombienet/sibling.toml +++ b/tests/zombienet/sibling.toml @@ -28,7 +28,7 @@ id = 2000 [parachains.collator] command = "node-executable" name = "provider-alice" -image = "kiltprotocol/dip-provider-node-template:dev-release-bcc1f405a48563f9620930fde26519ee332e2ab4" +image = "kiltprotocol/dip-provider-node-template:dev-release-55e45f8f952bd07ec3d6925ac26455c95a92fe9e" rpc_port = 10011 ws_port = 10011 @@ -38,6 +38,6 @@ id = 2001 [parachains.collator] command = "node-executable" name = "consumer-alice" -image = "kiltprotocol/dip-consumer-node-template:dev-release-bcc1f405a48563f9620930fde26519ee332e2ab4" +image = "kiltprotocol/dip-consumer-node-template:dev-release-55e45f8f952bd07ec3d6925ac26455c95a92fe9e" rpc_port = 10012 ws_port = 10012 From 87cf135cc11b70f69aff06eb4443e120c7d442ad Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Tue, 28 Nov 2023 17:50:31 +0100 Subject: [PATCH 12/22] WIP tests --- package.json | 7 +- src/index.ts | 2 +- src/sibling.ts | 6 +- src/utils.ts | 39 +++--- tests/sibling.test.ts | 74 ++++++++---- tests/utils.ts | 4 +- tests/zombienet/sibling.toml | 4 +- tsconfig.esm.json | 1 - tsconfig.json | 7 +- yarn.lock | 224 ++++++++++------------------------- 10 files changed, 154 insertions(+), 214 deletions(-) diff --git a/package.json b/package.json index 15e138f..ba7e460 100644 --- a/package.json +++ b/package.json @@ -2,17 +2,18 @@ "bugs": "https://github.com/KILTprotocol/dip-sdk/issues", "description": "An SDK to help integration of the KILT Decentralized Identity Provider (DIP) protocol using KILT as an Identity Provider.", "dependencies": { - "@kiltprotocol/did": "0.34.0-dip-1", - "@kiltprotocol/types": "0.34.0-dip-1", + "@kiltprotocol/did": "0.34.0-dip-2", + "@kiltprotocol/types": "0.34.0-dip-2", "@polkadot/api": "^10.10.1", "@polkadot/util": "^12.5.1" }, "devDependencies": { - "@kiltprotocol/sdk-js": "^0.34.0-dip-1", + "@kiltprotocol/sdk-js": "0.34.0-dip-2", "@types/node": "^20.9.4", "@typescript-eslint/eslint-plugin": "^6.2.0", "@typescript-eslint/parser": "^6.2.0", "@zombienet/cli": "^1.3.82", + "bn.js": "^5.2.1", "eslint": "^8.45.0", "eslint-config-prettier": "^8.9.0", "eslint-plugin-import": "^2.27.5", diff --git a/src/index.ts b/src/index.ts index de08d7e..f4edd39 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,7 +6,7 @@ */ /** - * @module @kiltprotocol/dip + * @module @kiltprotocol/dip-sdk */ export * from "./parent.js" diff --git a/src/sibling.ts b/src/sibling.ts index cf144ee..b5d86ca 100644 --- a/src/sibling.ts +++ b/src/sibling.ts @@ -98,7 +98,7 @@ export async function generateDipAuthorizedTxForSibling({ linkedAccounts = defaultValues.linkedAccounts, }: DipSiblingProofInput): Promise { const { - proof: providerStateRootProof, + proof: { proof: providerStateRootProof }, providerBlockHeight: providerStateRootProofProviderBlockHeight, relayBlockHeight: providerStateRootProofRelayBlockHeight, } = await generateProviderStateRootProof({ @@ -112,7 +112,7 @@ export async function generateDipAuthorizedTxForSibling({ providerStateRootProofProviderBlockHeight - 1, ) - const { proof: dipCommitmentProof } = await generateDipCommitmentProof({ + const { proof: { proof: dipCommitmentProof } } = await generateDipCommitmentProof({ didUri, providerApi, providerBlockHash: dipRootProofBlockHash, @@ -170,5 +170,5 @@ export async function generateDipAuthorizedTxForSibling({ }, }, }, - }) + }, call) } diff --git a/src/utils.ts b/src/utils.ts index df1be79..a2db796 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -18,7 +18,7 @@ import type { import type { ApiPromise } from "@polkadot/api" import type { KeyringPair } from "@polkadot/keyring/types" import type { Call, Hash, ReadProof } from "@polkadot/types/interfaces" -import type { Option } from "@polkadot/types-codec" +import type { Result } from "@polkadot/types-codec" import type { Codec } from "@polkadot/types-codec/types" export const defaultValues = { @@ -39,7 +39,6 @@ type ProviderStateRootProofRes = { proof: ReadProof providerBlockHeight: number relayBlockHeight: number - relayParentBlockHash: Hash } /** * Generate a state proof that proofs the head of the specified parachain. @@ -57,40 +56,47 @@ export async function generateProviderStateRootProof({ // Optional providerBlockHeight, }: ProviderStateRootProofOpts): Promise { + console.log("A") const [providerBlockNumber, providerBlockHash] = await (async () => { if (providerBlockHeight !== undefined) { - const blockHash = ( - await providerApi.derive.chain.getBlockByNumber(providerBlockHeight) - ).hash + console.log("B") + const blockHash = await providerApi.rpc.chain.getBlockHash(providerBlockHeight) + console.log("C") return [providerBlockHeight, blockHash] } + console.log("D") const providerLastFinalizedBlockHash = await providerApi.rpc.chain.getFinalizedHead() + console.log("E") const providerLastFinalizedBlockHeight = await providerApi.rpc.chain .getHeader(providerLastFinalizedBlockHash) .then((h) => h.number.toNumber()) + console.log("F") return [providerLastFinalizedBlockHeight, providerLastFinalizedBlockHash] })() + console.log("G") const providerApiAtBlock = await providerApi.at(providerBlockHash) + console.log("H") const providerChainId = await providerApiAtBlock.query.parachainInfo.parachainId() - const relayParentBlockNumber = await providerApi - .at(providerBlockHash) - .then((api) => api.query.parachainSystem.lastRelayChainBlockNumber()) + console.log("I") + const relayParentBlockNumber = await providerApiAtBlock.query.parachainSystem.lastRelayChainBlockNumber() + console.log("J") const relayParentBlockHash = await relayApi.rpc.chain.getBlockHash( relayParentBlockNumber, ) + console.log("K") const proof = await relayApi.rpc.state.getReadProof( [relayApi.query.paras.heads.key(providerChainId)], relayParentBlockHash, ) + console.log("L") return { proof, providerBlockHeight: providerBlockNumber, - relayBlockHeight: relayParentBlockNumber.toNumber(), - relayParentBlockHash, + relayBlockHeight: (relayParentBlockNumber as any).toNumber(), } } @@ -169,15 +175,20 @@ export async function generateDipIdentityProof({ providerApi, version, }: DipIdentityProofOpts): Promise { - const proof = (await providerApi.call.dipProvider.generateProof({ + const proof = (await providerApi.call.dipProvider.generateProof>({ identifier: toChain(did), version, keys: keyIds.map((keyId) => keyId.substring(1)), accounts: linkedAccounts, shouldIncludeWeb3Name: includeWeb3Name, - })) as Option + })) + + if (proof.isErr) { + throw new Error(providerApi.findError(proof.asErr.toHex()).docs.join('\n')) + } - const okProof = proof.unwrap() as any + // TODO: Better way to cast this? + const okProof = proof.asOk.toJSON() as any return { ...okProof } } @@ -241,7 +252,7 @@ export async function generateDipDidSignature({ }, }: DipDidSignatureOpts): Promise { const blockNumber = - blockHeight ?? (await api.query.system.number()).toNumber() + blockHeight ?? ((await api.query.system.number()) as any).toNumber() const genesis = genesisHash ?? (await api.query.system.blockHash(0)) const identityDetails = ( await api.query.dipConsumer.identityEntries>(toChain(didUri)) diff --git a/tests/sibling.test.ts b/tests/sibling.test.ts index eb715a7..c99fb26 100644 --- a/tests/sibling.test.ts +++ b/tests/sibling.test.ts @@ -5,18 +5,19 @@ * found in the LICENSE file in the root directory of this source tree. */ -// TODO: Push new Docker images baeing built on the kilt-node, update the Zombienet configuration and try again - import * as Kilt from "@kiltprotocol/sdk-js" import { ApiPromise, WsProvider } from "@polkadot/api" +import { BN } from "bn.js" import { ObjectBuilder } from "typescript-object-builder" import { beforeAll, describe, it, beforeEach } from "vitest" -import { createProviderApi } from './utils.js' +import { generateDipAuthorizedTxForSibling } from "../src/index.js" +import { createConsumerApi, createProviderApi } from "./utils.js" -import type { DipSiblingProofInput } from '@kiltprotocol/dip-sdk' -import type { DidDocument, KiltAddress, SignExtrinsicCallback, VerificationKeyType } from "@kiltprotocol/types" -import { GetStoreTxSignCallback } from "@kiltprotocol/did" +import type { DipSiblingProofInput } from "../src/index.js" +import type { GetStoreTxSignCallback } from "@kiltprotocol/did" +import type { DidDocument, KiltAddress, VerificationKeyType } from "@kiltprotocol/types" +import type { Call } from "@polkadot/types/interfaces" const partialSiblingBuilder = ObjectBuilder.new() @@ -29,8 +30,6 @@ const sudoKeypair = keyring.addFromUri('//Alice') Kilt.ConfigService.set({ 'submitTxResolveOn': Kilt.Blockchain.IS_IN_BLOCK }) describe('V0', () => { - let v0SiblingBuilder: typeof partialSiblingBuilder = Object.create(partialSiblingBuilder) - let relayApi: ApiPromise let providerApi: ApiPromise let consumerApi: ApiPromise @@ -39,39 +38,72 @@ describe('V0', () => { let didKeypair: Kilt.KeyringPair beforeAll(async () => { - relayApi = await ApiPromise.create({ provider: new WsProvider('ws://127.0.0.1:35265') }) - providerApi = await Kilt.connect('ws://127.0.0.1:43931') - consumerApi = await ApiPromise.create({ provider: new WsProvider('ws://127.0.0.1:42107') }) + const [r, p, c] = await Promise.all([ + ApiPromise.create({ provider: new WsProvider('ws://127.0.0.1:32813') }), + createProviderApi('ws://127.0.0.1:41231'), + ApiPromise.create({ provider: new WsProvider('ws://127.0.0.1:45695') }), + ]) + relayApi = r + providerApi = p + consumerApi = c - v0SiblingBuilder = v0SiblingBuilder.with('relayApi', relayApi).with('providerApi', providerApi).with('consumerApi', consumerApi) + Kilt.ConfigService.set({ api: providerApi }) }) beforeEach(async () => { const newSubmitterKeypair = keyring.addFromMnemonic(Kilt.Utils.Crypto.mnemonicGenerate()) - const balanceTransferTx = providerApi.tx.balances.transfer(newSubmitterKeypair.address, 10 ** 15) - await Kilt.Blockchain.signAndSubmitTx(balanceTransferTx, sudoKeypair) + const balanceTransferTxOnProviderChain = providerApi.tx.balances.transfer(newSubmitterKeypair.address, 10 ** 15) + const balanceTransferTxOnConsumerChain = consumerApi.tx.balances.transfer(newSubmitterKeypair.address, 10 ** 15) + await Promise.all([ + Kilt.Blockchain.signAndSubmitTx(balanceTransferTxOnProviderChain, sudoKeypair), + balanceTransferTxOnConsumerChain.signAndSend(sudoKeypair) + ]) const newDidKeypair = keyring.addFromMnemonic(Kilt.Utils.Crypto.mnemonicGenerate()) // @ts-expect-error We know that the type is an "sr25519" const newLightDid = Kilt.Did.createLightDidDocument({ authentication: [{ ...newDidKeypair }] }) const newFullDidUri = Kilt.Did.getFullDidUri(newLightDid.uri) const signCallback: GetStoreTxSignCallback = (async ({ data }) => ({ signature: await newDidKeypair.sign(data), keyType: newDidKeypair.type as VerificationKeyType })) const didCreationTx = await Kilt.Did.getStoreTx(newLightDid, newSubmitterKeypair.address as KiltAddress, signCallback) - const web3NameTx = await Kilt.Did.authorizeTx(newFullDidUri, providerApi.tx.web3Names.claim('test'), signCallback, newSubmitterKeypair.address as KiltAddress) - const commitIdentityTx = await Kilt.Did.authorizeTx(newFullDidUri, providerApi.tx.dipProvider.commitIdentity(Kilt.Did.toChain(newFullDidUri), 0), signCallback, newSubmitterKeypair.address as KiltAddress) + const web3NameTx = await Kilt.Did.authorizeTx(newFullDidUri, providerApi.tx.web3Names.claim(Kilt.Utils.UUID.generate().substring(2, 25)), signCallback, newSubmitterKeypair.address as KiltAddress, { txCounter: new BN(1) }) + const commitIdentityTx = await Kilt.Did.authorizeTx(newFullDidUri, providerApi.tx.dipProvider.commitIdentity(Kilt.Did.toChain(newFullDidUri), 0), signCallback, newSubmitterKeypair.address as KiltAddress, { txCounter: new BN(2) }) const batchedTx = providerApi.tx.utility.batchAll([ didCreationTx, web3NameTx, commitIdentityTx ]) await Kilt.Blockchain.signAndSubmitTx(batchedTx, newSubmitterKeypair, { resolveOn: Kilt.Blockchain.IS_FINALIZED }) - const newFullDid = (await Kilt.Did.resolve(newLightDid.uri))?.document as DidDocument + const newFullDid = (await Kilt.Did.resolve(newFullDidUri))?.document as DidDocument submitterKeypair = newSubmitterKeypair did = newFullDid didKeypair = newDidKeypair - }, 60_000) + }, 100_000) + + /* + * TODO: Print the DID mnemonic so that it can be used in the DID CLI utility + * Generate the extrinsic via the DID CLI and via the tests (using the block number used in the CLI execution), and check the differences. + */ it('Test successful call', async () => { + const builder: typeof partialSiblingBuilder = Object.create(partialSiblingBuilder) - await ApiPromise.create({ provider: new WsProvider('ws://127.0.0.1:35265') }) - }) -}) + const args = builder + .with('call', consumerApi.tx.postIt.post('Hello, world!').method as Call) + .with('consumerApi', consumerApi) + .with('includeWeb3Name', true) + .with('keyIds', [did.authentication[0].id]) + .with('keyRelationship', 'authentication') + .with('didUri', did.uri) + .with('proofVersion', 0) + .with('providerApi', providerApi) + .with('relayApi', relayApi) + .with('signer', (async ({ data }) => ({ signature: await didKeypair.sign(data), keyType: didKeypair.type as VerificationKeyType }))) + // .with('submitterAddress', submitterKeypair.address) + .with('submitterAddress', sudoKeypair.address) + .with('providerBlockHeight', 1971) + .build() + + const crossChainTx = await generateDipAuthorizedTxForSibling(args) + console.log(crossChainTx.toHex()) + // await crossChainTx.signAndSend(submitterKeypair) + }, 36_000) +}, 100_000) diff --git a/tests/utils.ts b/tests/utils.ts index 44f4caf..fc52c3e 100644 --- a/tests/utils.ts +++ b/tests/utils.ts @@ -31,7 +31,7 @@ const dipProviderCalls: DefinitionsCall = { ], ...didCalls, } -const dipProviderTypes: RegistryTypes = { +const dipTypes: RegistryTypes = { ...types, IdentityCommitmentVersion: 'u16', // DipProvider state_call @@ -106,5 +106,5 @@ const dipProviderTypes: RegistryTypes = { } export async function createProviderApi(address: string): Promise { - return ApiPromise.create({ provider: new WsProvider(address), runtime: dipProviderCalls, types: dipProviderTypes }) + return ApiPromise.create({ provider: new WsProvider(address), runtime: dipProviderCalls, types: dipTypes }) } diff --git a/tests/zombienet/sibling.toml b/tests/zombienet/sibling.toml index d6126f4..ef6ef51 100644 --- a/tests/zombienet/sibling.toml +++ b/tests/zombienet/sibling.toml @@ -28,7 +28,7 @@ id = 2000 [parachains.collator] command = "node-executable" name = "provider-alice" -image = "kiltprotocol/dip-provider-node-template:dev-release-55e45f8f952bd07ec3d6925ac26455c95a92fe9e" +image = "kiltprotocol/dip-provider-node-template:dev-release-f4e8bbfe2a0fb6d5be8fe2172ee8eb868e72716a" rpc_port = 10011 ws_port = 10011 @@ -38,6 +38,6 @@ id = 2001 [parachains.collator] command = "node-executable" name = "consumer-alice" -image = "kiltprotocol/dip-consumer-node-template:dev-release-55e45f8f952bd07ec3d6925ac26455c95a92fe9e" +image = "kiltprotocol/dip-consumer-node-template:dev-release-f4e8bbfe2a0fb6d5be8fe2172ee8eb868e72716a" rpc_port = 10012 ws_port = 10012 diff --git a/tsconfig.esm.json b/tsconfig.esm.json index 70f4eed..90c494e 100644 --- a/tsconfig.esm.json +++ b/tsconfig.esm.json @@ -3,7 +3,6 @@ "compilerOptions": { "outDir": "dist/esm", "module": "Node16", - "moduleResolution": "Node16", "declaration": true }, "include": [ diff --git a/tsconfig.json b/tsconfig.json index fd3993f..24a3346 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,12 +3,7 @@ "compilerOptions": { "module": "Node16", "moduleResolution": "Node16", - "noEmit": true, - "paths": { - "@kiltprotocol/dip-sdk": [ - "src/index.ts" - ] - } + "noEmit": true }, "include": [ "tests/**/*.ts", diff --git a/yarn.lock b/yarn.lock index 935e3a6..f38bd9f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -303,124 +303,75 @@ __metadata: languageName: node linkType: hard -"@kiltprotocol/asset-did@npm:0.34.0": - version: 0.34.0 - resolution: "@kiltprotocol/asset-did@npm:0.34.0" +"@kiltprotocol/augment-api@npm:0.34.0-dip-2": + version: 0.34.0-dip-2 + resolution: "@kiltprotocol/augment-api@npm:0.34.0-dip-2" dependencies: - "@kiltprotocol/types": 0.34.0 - "@kiltprotocol/utils": 0.34.0 - checksum: 5af3ab90c19b83fe82bcecd39e3d6578a42198a855c3d2a00f3e921070da628775d3742001ecc288ed89211bbc5ba861ccd4a092f5ca620425c299d8aae57ee5 + "@kiltprotocol/type-definitions": 0.34.0-dip-2 + checksum: 60b1a0bd40a9ecdb6b62f22c8d542670e4d62c7861ffc628e0784d04ab2c99ddf98f3bd8694546c5ed1f62c2265ffef517111e50d2589b7b8ea9bb0d2859f72d languageName: node linkType: hard -"@kiltprotocol/augment-api@npm:0.34.0": - version: 0.34.0 - resolution: "@kiltprotocol/augment-api@npm:0.34.0" +"@kiltprotocol/chain-helpers@npm:0.34.0-dip-2": + version: 0.34.0-dip-2 + resolution: "@kiltprotocol/chain-helpers@npm:0.34.0-dip-2" dependencies: - "@kiltprotocol/type-definitions": 0.34.0 - checksum: 21d9944e980a080ec3bbc24e5733970ef5d444d3cbb916a45c7a70fb86e23ee31386c498e2b3ef1958e2e4c17587c38000c3e71ff2fcae3458870e812564328b - languageName: node - linkType: hard - -"@kiltprotocol/augment-api@npm:0.34.0-dip-1": - version: 0.34.0-dip-1 - resolution: "@kiltprotocol/augment-api@npm:0.34.0-dip-1" - dependencies: - "@kiltprotocol/type-definitions": 0.34.0-dip-1 - checksum: 9f4c5a390d6e9441395b4bb8b7c30fff78f2f73b41f7570a2911a6b760e1538a51465543132f12f9131f3d8fa2a64deaef07562724bdbcb3c8dd5fa51d8525e7 - languageName: node - linkType: hard - -"@kiltprotocol/chain-helpers@npm:0.34.0": - version: 0.34.0 - resolution: "@kiltprotocol/chain-helpers@npm:0.34.0" - dependencies: - "@kiltprotocol/config": 0.34.0 - "@kiltprotocol/types": 0.34.0 - "@kiltprotocol/utils": 0.34.0 + "@kiltprotocol/config": 0.34.0-dip-2 + "@kiltprotocol/types": 0.34.0-dip-2 + "@kiltprotocol/utils": 0.34.0-dip-2 "@polkadot/api": ^10.4.0 "@polkadot/types": ^10.4.0 - checksum: 75af0407b5ae816d758a5338438980fac1ba402857afa9ddd05c91267aee4d18df301cd3ca3804135723c0c067edf6607f9923e857668b1cd8a4db6f2cd30cdb - languageName: node - linkType: hard - -"@kiltprotocol/config@npm:0.34.0": - version: 0.34.0 - resolution: "@kiltprotocol/config@npm:0.34.0" - dependencies: - "@kiltprotocol/types": 0.34.0 - "@polkadot/api": ^10.4.0 - typescript-logging: ^1.0.0 - checksum: 325ab05b72029b89fe74392073044ce137b4482f75bb939aef55b1d442933bc36e9ceca3e708b7bd1ce423e748f32fc176dec02b41abe866123c35196b345fd7 + checksum: f974f84a22f4317115a596cdc75f477ae7cc4bd424a54ae45b27019f9f68c0ad72fe1364e3c7228c4b0060338382c358f0997071f4235d0c88a4e8d5f6df60e3 languageName: node linkType: hard -"@kiltprotocol/config@npm:0.34.0-dip-1": - version: 0.34.0-dip-1 - resolution: "@kiltprotocol/config@npm:0.34.0-dip-1" +"@kiltprotocol/config@npm:0.34.0-dip-2": + version: 0.34.0-dip-2 + resolution: "@kiltprotocol/config@npm:0.34.0-dip-2" dependencies: - "@kiltprotocol/types": 0.34.0-dip-1 + "@kiltprotocol/types": 0.34.0-dip-2 "@polkadot/api": ^10.4.0 typescript-logging: ^1.0.0 - checksum: 49f8059070687f825b1eb0cd0715e3896007cc8afe48a5810ec704c98509a9694134897fbbe35cc64dddfbc41641baa521f4b5a183959e927cde1dbb8e414074 + checksum: 99f7280503d721cb691aad723a9e8d1b25fd673c3ebeae71acfe6a0468a22a23672750041959606a52963e2de58642e38b8aa13dc60eefff22ead156c9ff8d3d languageName: node linkType: hard -"@kiltprotocol/core@npm:0.34.0": - version: 0.34.0 - resolution: "@kiltprotocol/core@npm:0.34.0" +"@kiltprotocol/core@npm:0.34.0-dip-2": + version: 0.34.0-dip-2 + resolution: "@kiltprotocol/core@npm:0.34.0-dip-2" dependencies: - "@kiltprotocol/asset-did": 0.34.0 - "@kiltprotocol/augment-api": 0.34.0 - "@kiltprotocol/chain-helpers": 0.34.0 - "@kiltprotocol/config": 0.34.0 - "@kiltprotocol/did": 0.34.0 - "@kiltprotocol/type-definitions": 0.34.0 - "@kiltprotocol/types": 0.34.0 - "@kiltprotocol/utils": 0.34.0 + "@kiltprotocol/augment-api": 0.34.0-dip-2 + "@kiltprotocol/chain-helpers": 0.34.0-dip-2 + "@kiltprotocol/config": 0.34.0-dip-2 + "@kiltprotocol/did": 0.34.0-dip-2 + "@kiltprotocol/type-definitions": 0.34.0-dip-2 + "@kiltprotocol/types": 0.34.0-dip-2 + "@kiltprotocol/utils": 0.34.0-dip-2 "@polkadot/api": ^10.4.0 "@polkadot/keyring": ^12.0.0 "@polkadot/types": ^10.4.0 "@polkadot/util": ^12.0.0 "@polkadot/util-crypto": ^12.0.0 - checksum: d29af7bcae221a230e01bbf639feb954d1316c81c5f214508ea9e0e3b5d14b13ee4bef0d9a4dfc55a51bca6901a0ff1d65e799dc81a1417ed295ebe73020a09a + checksum: 93df85736526490f261765524f8b94b006db1c370d43e1546aea6bb496d170429e72784e4b6092e0a5b4b684aa4a7da7fe8497e79a5b1b2b8e2fb59f5fe8d603 languageName: node linkType: hard -"@kiltprotocol/did@npm:0.34.0": - version: 0.34.0 - resolution: "@kiltprotocol/did@npm:0.34.0" - dependencies: - "@kiltprotocol/augment-api": 0.34.0 - "@kiltprotocol/config": 0.34.0 - "@kiltprotocol/types": 0.34.0 - "@kiltprotocol/utils": 0.34.0 - "@polkadot/api": ^10.4.0 - "@polkadot/keyring": ^12.0.0 - "@polkadot/types": ^10.4.0 - "@polkadot/types-codec": ^10.4.0 - "@polkadot/util": ^12.0.0 - "@polkadot/util-crypto": ^12.0.0 - checksum: 726938609d082a166d2b281629d044cd673c1433e269eb2fcea0b6629274076f0310f6cbe15bedbd1552af6976d61cf03c7c001bedbe9744b9cdf9cb95d7b26c - languageName: node - linkType: hard - -"@kiltprotocol/did@npm:0.34.0-dip-1": - version: 0.34.0-dip-1 - resolution: "@kiltprotocol/did@npm:0.34.0-dip-1" +"@kiltprotocol/did@npm:0.34.0-dip-2": + version: 0.34.0-dip-2 + resolution: "@kiltprotocol/did@npm:0.34.0-dip-2" dependencies: "@digitalbazaar/security-context": ^1.0.0 - "@kiltprotocol/augment-api": 0.34.0-dip-1 - "@kiltprotocol/config": 0.34.0-dip-1 - "@kiltprotocol/types": 0.34.0-dip-1 - "@kiltprotocol/utils": 0.34.0-dip-1 + "@kiltprotocol/augment-api": 0.34.0-dip-2 + "@kiltprotocol/config": 0.34.0-dip-2 + "@kiltprotocol/types": 0.34.0-dip-2 + "@kiltprotocol/utils": 0.34.0-dip-2 "@polkadot/api": ^10.4.0 "@polkadot/keyring": ^12.0.0 "@polkadot/types": ^10.4.0 "@polkadot/types-codec": ^10.4.0 "@polkadot/util": ^12.0.0 "@polkadot/util-crypto": ^12.0.0 - checksum: 2a8a683e7b909fcdcf976e46902d715dbd2b47c49b9f749cc8eae7c074d9ad99dc4e33ff7630c67a399db77ac06dace87b182cebabd93963cefbc5e451c9419e + checksum: be4a91e31da0d25f49ab6156907f851ebc1aa032a0ebdea98955158ac74502488e46f45ff537bd738f1752320bece5d1f4f97a64ffdfbba48cad91ceeda33b2f languageName: node linkType: hard @@ -428,15 +379,16 @@ __metadata: version: 0.0.0-use.local resolution: "@kiltprotocol/dip-sdk@workspace:." dependencies: - "@kiltprotocol/did": 0.34.0-dip-1 - "@kiltprotocol/sdk-js": ^0.34.0-dip-1 - "@kiltprotocol/types": 0.34.0-dip-1 + "@kiltprotocol/did": 0.34.0-dip-2 + "@kiltprotocol/sdk-js": 0.34.0-dip-2 + "@kiltprotocol/types": 0.34.0-dip-2 "@polkadot/api": ^10.10.1 "@polkadot/util": ^12.5.1 "@types/node": ^20.9.4 "@typescript-eslint/eslint-plugin": ^6.2.0 "@typescript-eslint/parser": ^6.2.0 "@zombienet/cli": ^1.3.82 + bn.js: ^5.2.1 eslint: ^8.45.0 eslint-config-prettier: ^8.9.0 eslint-plugin-import: ^2.27.5 @@ -449,95 +401,45 @@ __metadata: languageName: unknown linkType: soft -"@kiltprotocol/messaging@npm:0.34.0": - version: 0.34.0 - resolution: "@kiltprotocol/messaging@npm:0.34.0" +"@kiltprotocol/sdk-js@npm:0.34.0-dip-2": + version: 0.34.0-dip-2 + resolution: "@kiltprotocol/sdk-js@npm:0.34.0-dip-2" dependencies: - "@kiltprotocol/core": 0.34.0 - "@kiltprotocol/did": 0.34.0 - "@kiltprotocol/types": 0.34.0 - "@kiltprotocol/utils": 0.34.0 - "@polkadot/util": ^12.0.0 - checksum: c04de6ee015127d025d59fa469c01d831b02d6e0372cd005664efbbeb0ef9df68edf0ed869caa8b3752442d355a53eaca8f7c7ca99ba7678a4cb099b8a51ff37 + "@kiltprotocol/chain-helpers": 0.34.0-dip-2 + "@kiltprotocol/config": 0.34.0-dip-2 + "@kiltprotocol/core": 0.34.0-dip-2 + "@kiltprotocol/did": 0.34.0-dip-2 + "@kiltprotocol/types": 0.34.0-dip-2 + "@kiltprotocol/utils": 0.34.0-dip-2 + checksum: 9fb182c8bd9f8c302a9c896157ba36bbf89b6f130ac22b1cc4937d8d716130935718ee2ff80a77ac9360133bfc6821524d88f9b805d1d300b2f9f0c9473ac892 languageName: node linkType: hard -"@kiltprotocol/sdk-js@npm:^0.34.0-dip-1": - version: 0.34.0 - resolution: "@kiltprotocol/sdk-js@npm:0.34.0" - dependencies: - "@kiltprotocol/chain-helpers": 0.34.0 - "@kiltprotocol/config": 0.34.0 - "@kiltprotocol/core": 0.34.0 - "@kiltprotocol/did": 0.34.0 - "@kiltprotocol/messaging": 0.34.0 - "@kiltprotocol/types": 0.34.0 - "@kiltprotocol/utils": 0.34.0 - checksum: 4001a6dd05da8ffaf2c0be7d91d6007ae5d41dd20e4903e73026e7b26871265bd52c8cb24b830b0d5b1ac5a8d14c355bf55f12b5b982fcb9a7c51233f25dc95e +"@kiltprotocol/type-definitions@npm:0.34.0-dip-2": + version: 0.34.0-dip-2 + resolution: "@kiltprotocol/type-definitions@npm:0.34.0-dip-2" + checksum: c3a9a92195fbafe803bc3bdc9eb179e66adbebc1d3b0185ac38c196e21088d422b843ab7f360ef25229625ee1b3a0ca9c62595a00f75a1731802e91daf80a467 languageName: node linkType: hard -"@kiltprotocol/type-definitions@npm:0.34.0": - version: 0.34.0 - resolution: "@kiltprotocol/type-definitions@npm:0.34.0" - checksum: be189e53514d4f26f5ac54f8bcd9672ad0d311a12a01e3f9c43c8cf1c637f953e085ee2ffa2c617c8ca763b8a22dc17af3a099658e08f401654f4ca44bb62af2 - languageName: node - linkType: hard - -"@kiltprotocol/type-definitions@npm:0.34.0-dip-1": - version: 0.34.0-dip-1 - resolution: "@kiltprotocol/type-definitions@npm:0.34.0-dip-1" - checksum: bccb97850dfc3fa8037722f168a20a944fa3eca544ff8373ee5df93d50b1de42188a167f4c20c7f8be5c3e0db70cb856302bb9a9c0203568a8277362084b7e88 - languageName: node - linkType: hard - -"@kiltprotocol/types@npm:0.34.0": - version: 0.34.0 - resolution: "@kiltprotocol/types@npm:0.34.0" - dependencies: - "@polkadot/api": ^10.4.0 - "@polkadot/keyring": ^12.0.0 - "@polkadot/types": ^10.4.0 - "@polkadot/util": ^12.0.0 - "@polkadot/util-crypto": ^12.0.0 - checksum: e6ea69749c71f405eb20c20783b230c7a335f20346730601fe00bea0cc0c55b6c229de02cb76bdd536df645a4f4dd4e2d03f3cb43c7be8a10127148ca08570a7 - languageName: node - linkType: hard - -"@kiltprotocol/types@npm:0.34.0-dip-1": - version: 0.34.0-dip-1 - resolution: "@kiltprotocol/types@npm:0.34.0-dip-1" +"@kiltprotocol/types@npm:0.34.0-dip-2": + version: 0.34.0-dip-2 + resolution: "@kiltprotocol/types@npm:0.34.0-dip-2" dependencies: "@polkadot/api": ^10.4.0 "@polkadot/keyring": ^12.0.0 "@polkadot/types": ^10.4.0 "@polkadot/util": ^12.0.0 "@polkadot/util-crypto": ^12.0.0 - checksum: 2bd0322da0234c03920653802ee71cfdff199b9ddc36b3c74ad3cad3ac96f124353363ae555a7dc278083abdb19aa7dc5c11d2065cf42d88bca54a97d6906de9 - languageName: node - linkType: hard - -"@kiltprotocol/utils@npm:0.34.0": - version: 0.34.0 - resolution: "@kiltprotocol/utils@npm:0.34.0" - dependencies: - "@kiltprotocol/types": 0.34.0 - "@polkadot/api": ^10.4.0 - "@polkadot/keyring": ^12.0.0 - "@polkadot/util": ^12.0.0 - "@polkadot/util-crypto": ^12.0.0 - cbor-web: ^9.0.0 - tweetnacl: ^1.0.3 - uuid: ^9.0.0 - checksum: de67168544d16ba03d0d8177a14e7defad53c97bd24055d5722bb89e7eeb6b9bbb82e30163cc05aef382f55d8719dd4ffb4372c146f368d4852f1659131fdba9 + checksum: 92ade4df9aa82db73a14d50fb691936ee8b6f75b4bc06718265342649f66cd70a1873b3aee9be15457d2a77a69b926599de369b417a8ddefd93bedd88093bf9a languageName: node linkType: hard -"@kiltprotocol/utils@npm:0.34.0-dip-1": - version: 0.34.0-dip-1 - resolution: "@kiltprotocol/utils@npm:0.34.0-dip-1" +"@kiltprotocol/utils@npm:0.34.0-dip-2": + version: 0.34.0-dip-2 + resolution: "@kiltprotocol/utils@npm:0.34.0-dip-2" dependencies: - "@kiltprotocol/types": 0.34.0-dip-1 + "@kiltprotocol/types": 0.34.0-dip-2 "@polkadot/api": ^10.4.0 "@polkadot/keyring": ^12.0.0 "@polkadot/util": ^12.0.0 @@ -545,7 +447,7 @@ __metadata: cbor-web: ^9.0.0 tweetnacl: ^1.0.3 uuid: ^9.0.0 - checksum: bddb0a950dbc143492a1039ba4c11ee598cc9ede2cfc5e30b35a9893c336d809599c561762139537f8fa4ccbfda7986e98fc28404788c6d4212efcb4b3263304 + checksum: b56d5863e267e932db584c7edd312d6385e17ff66bf6ac9ca3ff97ad59631f2223385ee3154fcc993792cb2b07c10914ad4ce7b694766cb353c2f68aed72d79b languageName: node linkType: hard From 285adb6ca390a8b3f5c4130eba089b7e4a512ae8 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Wed, 29 Nov 2023 16:06:59 +0100 Subject: [PATCH 13/22] Tests cases passing! --- package.json | 1 - src/parent.ts | 4 +- src/sibling.ts | 38 +++--- src/utils.ts | 29 ++--- tests/sibling.test.ts | 291 +++++++++++++++++++++++++++++++----------- tests/utils.ts | 173 ++++++++++++++++++------- tsconfig.base.json | 6 +- tsconfig.cjs.json | 8 +- tsconfig.esm.json | 8 +- tsconfig.json | 5 +- yarn.lock | 8 -- 11 files changed, 388 insertions(+), 183 deletions(-) diff --git a/package.json b/package.json index ba7e460..1851f8e 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "prettier": "^3.0.0", "rimraf": "^5.0.1", "typescript": "^5.3.2", - "typescript-object-builder": "^0.3.0", "vitest": "^0.33.0" }, "engines": { diff --git a/src/parent.ts b/src/parent.ts index b1b76aa..b115d45 100644 --- a/src/parent.ts +++ b/src/parent.ts @@ -50,7 +50,6 @@ export type DipParentProofInput = { linkedAccounts?: readonly PalletDidLookupLinkableAccountLinkableAccountId[] } - /** * Generate a submittable extrinsic for the provided call which includes a complete DIP proof according to the parameters provided, to be used on the relay chain of which the provider chain is a parachain. * @@ -100,7 +99,6 @@ export async function generateDipAuthorizedTxForParent({ proof: providerStateRootProof, providerBlockHeight: providerStateRootProofProviderBlockHeight, relayBlockHeight: providerStateRootProofRelayBlockHeight, - relayParentBlockHash: providerStateRootProofRelayBlockHash, } = await generateProviderStateRootProof({ relayApi, providerApi, @@ -108,7 +106,7 @@ export async function generateDipAuthorizedTxForParent({ }) const providerStateRootProofRelayBlockHeader = - await relayApi.rpc.chain.getHeader(providerStateRootProofRelayBlockHash) + await relayApi.rpc.chain.getHeader(providerStateRootProof.at) // Proof of commitment must be generated with the state root at the block before the last one finalized. const dipRootProofBlockHash = await providerApi.rpc.chain.getBlockHash( diff --git a/src/sibling.ts b/src/sibling.ts index b5d86ca..979ace0 100644 --- a/src/sibling.ts +++ b/src/sibling.ts @@ -112,7 +112,9 @@ export async function generateDipAuthorizedTxForSibling({ providerStateRootProofProviderBlockHeight - 1, ) - const { proof: { proof: dipCommitmentProof } } = await generateDipCommitmentProof({ + const { + proof: { proof: dipCommitmentProof }, + } = await generateDipCommitmentProof({ didUri, providerApi, providerBlockHash: dipRootProofBlockHash, @@ -150,25 +152,29 @@ export async function generateDipAuthorizedTxForSibling({ }, }) - return consumerApi.tx.dipConsumer.dispatchAs(toChain(didUri), { - [`V${proofVersion}`]: { - paraStateRoot: { - relayBlockHeight: providerStateRootProofRelayBlockHeight, - proof: providerStateRootProof, - }, - dipIdentityCommitment: dipCommitmentProof, - did: { - leaves: { - blinded: dipIdentityProof.blinded, - revealed: dipIdentityProof.revealed, + return consumerApi.tx.dipConsumer.dispatchAs( + toChain(didUri), + { + [`V${proofVersion}`]: { + paraStateRoot: { + relayBlockHeight: providerStateRootProofRelayBlockHeight, + proof: providerStateRootProof, }, - signature: { + dipIdentityCommitment: dipCommitmentProof, + did: { + leaves: { + blinded: dipIdentityProof.blinded, + revealed: dipIdentityProof.revealed, + }, signature: { - [didSignatureType]: u8aToHex(didSignature), + signature: { + [didSignatureType]: u8aToHex(didSignature), + }, + blockNumber: didSignatureBlockNumber, }, - blockNumber: didSignatureBlockNumber, }, }, }, - }, call) + call, + ) } diff --git a/src/utils.ts b/src/utils.ts index a2db796..6b8ed4f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -18,7 +18,7 @@ import type { import type { ApiPromise } from "@polkadot/api" import type { KeyringPair } from "@polkadot/keyring/types" import type { Call, Hash, ReadProof } from "@polkadot/types/interfaces" -import type { Result } from "@polkadot/types-codec" +import type { Result, Option } from "@polkadot/types-codec" import type { Codec } from "@polkadot/types-codec/types" export const defaultValues = { @@ -56,42 +56,33 @@ export async function generateProviderStateRootProof({ // Optional providerBlockHeight, }: ProviderStateRootProofOpts): Promise { - console.log("A") const [providerBlockNumber, providerBlockHash] = await (async () => { if (providerBlockHeight !== undefined) { - console.log("B") - const blockHash = await providerApi.rpc.chain.getBlockHash(providerBlockHeight) - console.log("C") + const blockHash = + await providerApi.rpc.chain.getBlockHash(providerBlockHeight) return [providerBlockHeight, blockHash] } - console.log("D") const providerLastFinalizedBlockHash = await providerApi.rpc.chain.getFinalizedHead() - console.log("E") const providerLastFinalizedBlockHeight = await providerApi.rpc.chain .getHeader(providerLastFinalizedBlockHash) .then((h) => h.number.toNumber()) - console.log("F") return [providerLastFinalizedBlockHeight, providerLastFinalizedBlockHash] })() - console.log("G") const providerApiAtBlock = await providerApi.at(providerBlockHash) - console.log("H") const providerChainId = await providerApiAtBlock.query.parachainInfo.parachainId() - console.log("I") - const relayParentBlockNumber = await providerApiAtBlock.query.parachainSystem.lastRelayChainBlockNumber() - console.log("J") + const relayParentBlockNumber = + await providerApiAtBlock.query.parachainSystem.lastRelayChainBlockNumber() + // This refers to the previously finalized block, we need the current one. const relayParentBlockHash = await relayApi.rpc.chain.getBlockHash( relayParentBlockNumber, ) - console.log("K") const proof = await relayApi.rpc.state.getReadProof( [relayApi.query.paras.heads.key(providerChainId)], relayParentBlockHash, ) - console.log("L") return { proof, @@ -175,16 +166,18 @@ export async function generateDipIdentityProof({ providerApi, version, }: DipIdentityProofOpts): Promise { - const proof = (await providerApi.call.dipProvider.generateProof>({ + const proof = await providerApi.call.dipProvider.generateProof< + Result + >({ identifier: toChain(did), version, keys: keyIds.map((keyId) => keyId.substring(1)), accounts: linkedAccounts, shouldIncludeWeb3Name: includeWeb3Name, - })) + }) if (proof.isErr) { - throw new Error(providerApi.findError(proof.asErr.toHex()).docs.join('\n')) + throw new Error(providerApi.findError(proof.asErr.toHex()).docs.join("\n")) } // TODO: Better way to cast this? diff --git a/tests/sibling.test.ts b/tests/sibling.test.ts index c99fb26..82e7dc2 100644 --- a/tests/sibling.test.ts +++ b/tests/sibling.test.ts @@ -5,105 +5,254 @@ * found in the LICENSE file in the root directory of this source tree. */ +import { setTimeout } from "timers/promises" + import * as Kilt from "@kiltprotocol/sdk-js" import { ApiPromise, WsProvider } from "@polkadot/api" +import { blake2AsHex } from "@polkadot/util-crypto" import { BN } from "bn.js" -import { ObjectBuilder } from "typescript-object-builder" -import { beforeAll, describe, it, beforeEach } from "vitest" +import { beforeAll, describe, it, expect, beforeEach } from "vitest" +import { createProviderApi, signAndSubmitTx } from "./utils.js" import { generateDipAuthorizedTxForSibling } from "../src/index.js" -import { createConsumerApi, createProviderApi } from "./utils.js" import type { DipSiblingProofInput } from "../src/index.js" -import type { GetStoreTxSignCallback } from "@kiltprotocol/did" -import type { DidDocument, KiltAddress, VerificationKeyType } from "@kiltprotocol/types" +import type { GetStoreTxSignCallback, Web3Name } from "@kiltprotocol/did" +import type { + DidDocument, + KiltAddress, + VerificationKeyType, +} from "@kiltprotocol/types" +import type { Option } from "@polkadot/types/codec" import type { Call } from "@polkadot/types/interfaces" +import type { Codec } from "@polkadot/types/types" + +const baseConfig: Pick< + DipSiblingProofInput, + | "accountIdRuntimeType" + | "blockNumberRuntimeType" + | "identityDetailsRuntimeType" +> = { + accountIdRuntimeType: "AccountId32", + blockNumberRuntimeType: "u32", + identityDetailsRuntimeType: "Option", +} +const web3NameRuntimeType = "Text" +const keyring = new Kilt.Utils.Keyring({ + type: "sr25519", + ss58Format: Kilt.Utils.ss58Format, +}) +const providerAndConsumerSudoKeypair = keyring.addFromUri("//Alice") -const partialSiblingBuilder = - ObjectBuilder.new() - .with('accountIdRuntimeType', 'AccountId32') - .with('blockNumberRuntimeType', 'u32') - .with('identityDetailsRuntimeType', 'Option') -const keyring = new Kilt.Utils.Keyring({ type: 'sr25519', ss58Format: Kilt.Utils.ss58Format }) -const sudoKeypair = keyring.addFromUri('//Alice') +Kilt.ConfigService.set({ submitTxResolveOn: Kilt.Blockchain.IS_IN_BLOCK }) -Kilt.ConfigService.set({ 'submitTxResolveOn': Kilt.Blockchain.IS_IN_BLOCK }) +describe("V0", () => { + // beforeAll + let v0Config: typeof baseConfig & + Pick< + DipSiblingProofInput, + "consumerApi" | "proofVersion" | "providerApi" | "relayApi" + > -describe('V0', () => { - let relayApi: ApiPromise - let providerApi: ApiPromise - let consumerApi: ApiPromise + // beforeEach let submitterKeypair: Kilt.KeyringPair let did: DidDocument + let web3Name: Web3Name let didKeypair: Kilt.KeyringPair + let lastTestSetupProviderBlockNumber: number + let testConfig: typeof v0Config & + Pick< + DipSiblingProofInput, + | "didUri" + | "signer" + | "keyIds" + | "keyRelationship" + | "includeWeb3Name" + | "submitterAddress" + > beforeAll(async () => { - const [r, p, c] = await Promise.all([ - ApiPromise.create({ provider: new WsProvider('ws://127.0.0.1:32813') }), - createProviderApi('ws://127.0.0.1:41231'), - ApiPromise.create({ provider: new WsProvider('ws://127.0.0.1:45695') }), + const [relayApi, providerApi, consumerApi] = await Promise.all([ + ApiPromise.create({ provider: new WsProvider("ws://127.0.0.1:45703") }), + createProviderApi("ws://127.0.0.1:46741"), + ApiPromise.create({ provider: new WsProvider("ws://127.0.0.1:45781") }), ]) - relayApi = r - providerApi = p - consumerApi = c - Kilt.ConfigService.set({ api: providerApi }) + + v0Config = { + ...baseConfig, + consumerApi, + proofVersion: 0, + providerApi, + relayApi, + } }) beforeEach(async () => { - const newSubmitterKeypair = keyring.addFromMnemonic(Kilt.Utils.Crypto.mnemonicGenerate()) - const balanceTransferTxOnProviderChain = providerApi.tx.balances.transfer(newSubmitterKeypair.address, 10 ** 15) - const balanceTransferTxOnConsumerChain = consumerApi.tx.balances.transfer(newSubmitterKeypair.address, 10 ** 15) + const { providerApi, consumerApi } = v0Config + const newSubmitterKeypair = keyring.addFromMnemonic( + Kilt.Utils.Crypto.mnemonicGenerate(), + ) + const balanceTransferTxOnProviderChain = providerApi.tx.balances.transfer( + newSubmitterKeypair.address, + 10 ** 15, + ) + const balanceTransferTxOnConsumerChain = consumerApi.tx.balances.transfer( + newSubmitterKeypair.address, + 10 ** 15, + ) await Promise.all([ - Kilt.Blockchain.signAndSubmitTx(balanceTransferTxOnProviderChain, sudoKeypair), - balanceTransferTxOnConsumerChain.signAndSend(sudoKeypair) + Kilt.Blockchain.signAndSubmitTx( + balanceTransferTxOnProviderChain, + providerAndConsumerSudoKeypair, + ), + balanceTransferTxOnConsumerChain.signAndSend( + providerAndConsumerSudoKeypair, + ), ]) - const newDidKeypair = keyring.addFromMnemonic(Kilt.Utils.Crypto.mnemonicGenerate()) - // @ts-expect-error We know that the type is an "sr25519" - const newLightDid = Kilt.Did.createLightDidDocument({ authentication: [{ ...newDidKeypair }] }) + const newDidKeypair = keyring.addFromMnemonic( + Kilt.Utils.Crypto.mnemonicGenerate(), + ) + const newLightDid = Kilt.Did.createLightDidDocument({ + // @ts-expect-error We know that the type is an "sr25519" + authentication: [{ ...newDidKeypair }], + }) const newFullDidUri = Kilt.Did.getFullDidUri(newLightDid.uri) - const signCallback: GetStoreTxSignCallback = (async ({ data }) => ({ signature: await newDidKeypair.sign(data), keyType: newDidKeypair.type as VerificationKeyType })) - const didCreationTx = await Kilt.Did.getStoreTx(newLightDid, newSubmitterKeypair.address as KiltAddress, signCallback) - const web3NameTx = await Kilt.Did.authorizeTx(newFullDidUri, providerApi.tx.web3Names.claim(Kilt.Utils.UUID.generate().substring(2, 25)), signCallback, newSubmitterKeypair.address as KiltAddress, { txCounter: new BN(1) }) - const commitIdentityTx = await Kilt.Did.authorizeTx(newFullDidUri, providerApi.tx.dipProvider.commitIdentity(Kilt.Did.toChain(newFullDidUri), 0), signCallback, newSubmitterKeypair.address as KiltAddress, { txCounter: new BN(2) }) + const signCallback: GetStoreTxSignCallback = async ({ data }) => ({ + signature: await newDidKeypair.sign(data), + keyType: newDidKeypair.type as VerificationKeyType, + }) + const didCreationTx = await Kilt.Did.getStoreTx( + newLightDid, + newSubmitterKeypair.address as KiltAddress, + signCallback, + ) + const newWeb3Name = Kilt.Utils.UUID.generate().substring(2, 25) + const web3NameTx = await Kilt.Did.authorizeTx( + newFullDidUri, + providerApi.tx.web3Names.claim(newWeb3Name), + signCallback, + newSubmitterKeypair.address as KiltAddress, + { txCounter: new BN(1) }, + ) + const commitIdentityTx = await Kilt.Did.authorizeTx( + newFullDidUri, + providerApi.tx.dipProvider.commitIdentity( + Kilt.Did.toChain(newFullDidUri), + 0, + ), + signCallback, + newSubmitterKeypair.address as KiltAddress, + { txCounter: new BN(2) }, + ) const batchedTx = providerApi.tx.utility.batchAll([ didCreationTx, web3NameTx, - commitIdentityTx + commitIdentityTx, ]) - await Kilt.Blockchain.signAndSubmitTx(batchedTx, newSubmitterKeypair, { resolveOn: Kilt.Blockchain.IS_FINALIZED }) - const newFullDid = (await Kilt.Did.resolve(newFullDidUri))?.document as DidDocument + await Kilt.Blockchain.signAndSubmitTx(batchedTx, newSubmitterKeypair, { + resolveOn: Kilt.Blockchain.IS_FINALIZED, + }) + // FIXME: Timeout needed since it seems `.getFinalizedHead()` still returns the previous block number as the latest finalized, even if we wait for finalization above. This results in invalid storage proofs. + await setTimeout(12_000) + lastTestSetupProviderBlockNumber = ( + await providerApi.query.system.number() + ).toNumber() + const newFullDid = (await Kilt.Did.resolve(newFullDidUri)) + ?.document as DidDocument submitterKeypair = newSubmitterKeypair did = newFullDid + web3Name = newWeb3Name didKeypair = newDidKeypair - }, 100_000) - - /* - * TODO: Print the DID mnemonic so that it can be used in the DID CLI utility - * Generate the extrinsic via the DID CLI and via the tests (using the block number used in the CLI execution), and check the differences. - */ - - it('Test successful call', async () => { - const builder: typeof partialSiblingBuilder = Object.create(partialSiblingBuilder) - - const args = builder - .with('call', consumerApi.tx.postIt.post('Hello, world!').method as Call) - .with('consumerApi', consumerApi) - .with('includeWeb3Name', true) - .with('keyIds', [did.authentication[0].id]) - .with('keyRelationship', 'authentication') - .with('didUri', did.uri) - .with('proofVersion', 0) - .with('providerApi', providerApi) - .with('relayApi', relayApi) - .with('signer', (async ({ data }) => ({ signature: await didKeypair.sign(data), keyType: didKeypair.type as VerificationKeyType }))) - // .with('submitterAddress', submitterKeypair.address) - .with('submitterAddress', sudoKeypair.address) - .with('providerBlockHeight', 1971) - .build() - - const crossChainTx = await generateDipAuthorizedTxForSibling(args) - console.log(crossChainTx.toHex()) - // await crossChainTx.signAndSend(submitterKeypair) - }, 36_000) -}, 100_000) + + testConfig = { + ...v0Config, + didUri: did.uri, + signer: async ({ data }) => ({ + signature: await didKeypair.sign(data), + keyType: didKeypair.type as VerificationKeyType, + }), + keyIds: [did.authentication[0].id], + keyRelationship: "authentication", + includeWeb3Name: true, + submitterAddress: submitterKeypair.address, + } + }, 96_000) + + it("Successful post on the consumer's PostIt pallet using the default latest finalized block", async () => { + const { consumerApi } = testConfig + const postText = "Hello, world!" + const config: DipSiblingProofInput = { + ...testConfig, + call: consumerApi.tx.postIt.post(postText).method as Call, + } + + const crossChainTx = await generateDipAuthorizedTxForSibling(config) + const { status } = await signAndSubmitTx( + consumerApi, + crossChainTx, + submitterKeypair, + ) + expect(status.isInBlock, "Status of submitted tx should be in block.").toBe( + true, + ) + const blockHash = status.asInBlock + const blockNumber = (await consumerApi.rpc.chain.getHeader(blockHash)) + .number + // The example PostIt pallet generates the storage key for a post by hashing (block number, submitter's username, content of the post). + const postKey = blake2AsHex( + consumerApi + .createType(`(BlockNumber, ${web3NameRuntimeType}, Bytes)`, [ + blockNumber, + web3Name, + postText, + ]) + .toHex(), + ) + const postEntry = + await consumerApi.query.postIt.posts>(postKey) + expect( + postEntry.isSome, + "Post should successfully be stored on the chain", + ).toBe(true) + }) + + it("Successful post on the consumer's PostIt pallet using the same block as the previous operation, explicitly", async () => { + const { consumerApi } = testConfig + const postText = "Hello, world!" + const config: DipSiblingProofInput = { + ...testConfig, + call: consumerApi.tx.postIt.post(postText).method as Call, + providerBlockHeight: lastTestSetupProviderBlockNumber, + } + + const crossChainTx = await generateDipAuthorizedTxForSibling(config) + const { status } = await signAndSubmitTx( + consumerApi, + crossChainTx, + submitterKeypair, + ) + expect(status.isInBlock, "Status of submitted tx should be in block.").toBe( + true, + ) + const blockHash = status.asInBlock + const blockNumber = (await consumerApi.rpc.chain.getHeader(blockHash)) + .number + // The example PostIt pallet generates the storage key for a post by hashing (block number, submitter's username, content of the post). + const postKey = blake2AsHex( + consumerApi + .createType(`(BlockNumber, ${web3NameRuntimeType}, Bytes)`, [ + blockNumber, + web3Name, + postText, + ]) + .toHex(), + ) + const postEntry = + await consumerApi.query.postIt.posts>(postKey) + expect( + postEntry.isSome, + "Post should successfully be stored on the chain", + ).toBe(true) + }) +}, 60_000) diff --git a/tests/utils.ts b/tests/utils.ts index fc52c3e..d344508 100644 --- a/tests/utils.ts +++ b/tests/utils.ts @@ -5,10 +5,17 @@ * found in the LICENSE file in the root directory of this source tree. */ +import * as Kilt from "@kiltprotocol/sdk-js" import { didCalls, types } from "@kiltprotocol/type-definitions" -import { ApiPromise, WsProvider } from "@polkadot/api" +import { ApiPromise, SubmittableResult, WsProvider } from "@polkadot/api" -import type { DefinitionsCall, RegistryTypes } from '@polkadot/types/types' +import type { KeyringPair, SubmittableExtrinsic } from "@kiltprotocol/types" +import type { + AnyNumber, + ISubmittableResult, + DefinitionsCall, + RegistryTypes, +} from "@polkadot/types/types" const dipProviderCalls: DefinitionsCall = { DipProvider: [ @@ -16,14 +23,14 @@ const dipProviderCalls: DefinitionsCall = { methods: { generate_proof: { description: - 'Generate a Merkle proof for the DIP protocol for the specified request parameters.', + "Generate a Merkle proof for the DIP protocol for the specified request parameters.", params: [ { - name: 'request', - type: 'DipProofRequest', + name: "request", + type: "DipProofRequest", }, ], - type: 'Result', + type: "Result", }, }, version: 1, @@ -33,78 +40,152 @@ const dipProviderCalls: DefinitionsCall = { } const dipTypes: RegistryTypes = { ...types, - IdentityCommitmentVersion: 'u16', + IdentityCommitmentVersion: "u16", // DipProvider state_call DipProofRequest: { - identifier: 'AccountId32', - version: 'IdentityCommitmentVersion', - keys: 'Vec', - accounts: 'Vec', - shouldIncludeWeb3Name: 'bool', + identifier: "AccountId32", + version: "IdentityCommitmentVersion", + keys: "Vec", + accounts: "Vec", + shouldIncludeWeb3Name: "bool", }, CompleteMerkleProof: { - root: 'MerkleRoot', - proof: 'MerkleProof', + root: "MerkleRoot", + proof: "MerkleProof", }, - MerkleRoot: 'Hash', + MerkleRoot: "Hash", MerkleProof: { - blinded: 'BlindedLeaves', - revealed: 'RevealedLeaves', + blinded: "BlindedLeaves", + revealed: "RevealedLeaves", }, - BlindedLeaves: 'Vec', - BlindedValue: 'Bytes', - RevealedLeaves: 'Vec', + BlindedLeaves: "Vec", + BlindedValue: "Bytes", + RevealedLeaves: "Vec", RevealedLeaf: { _enum: { - DidKey: '(DidKeyMerkleKey, DidKeyMerkleValue)', - Web3Name: '(Web3NameMerkleKey, Web3NameMerkleValue)', - LinkedAccount: '(LinkedAccountMerkleKey, LinkedAccountMerkleValue)', + DidKey: "(DidKeyMerkleKey, DidKeyMerkleValue)", + Web3Name: "(Web3NameMerkleKey, Web3NameMerkleValue)", + LinkedAccount: "(LinkedAccountMerkleKey, LinkedAccountMerkleValue)", }, }, - DidKeyMerkleKey: '(KeyId, KeyRelationship)', - KeyId: 'Hash', + DidKeyMerkleKey: "(KeyId, KeyRelationship)", + KeyId: "Hash", KeyRelationship: { _enum: { - Encryption: 'Null', - Verification: 'VerificationRelationship', + Encryption: "Null", + Verification: "VerificationRelationship", }, }, VerificationRelationship: { _enum: [ - 'Authentication', - 'CapabilityDelegation', - 'CapabilityInvocation', - 'AssertionMethod', + "Authentication", + "CapabilityDelegation", + "CapabilityInvocation", + "AssertionMethod", ], }, - DidKeyMerkleValue: 'DidDidDetailsDidPublicKeyDetails', - Web3NameMerkleKey: 'Text', - Web3NameMerkleValue: 'BlockNumber', - LinkedAccountMerkleKey: 'PalletDidLookupLinkableAccountLinkableAccountId', - LinkedAccountMerkleValue: 'Null', + DidKeyMerkleValue: "DidDidDetailsDidPublicKeyDetails", + Web3NameMerkleKey: "Text", + Web3NameMerkleValue: "BlockNumber", + LinkedAccountMerkleKey: "PalletDidLookupLinkableAccountLinkableAccountId", + LinkedAccountMerkleValue: "Null", RuntimeApiDipProofError: { _enum: { - IdentityProvider: 'LinkedDidIdentityProviderError', - MerkleProof: 'DidMerkleProofError', + IdentityProvider: "LinkedDidIdentityProviderError", + MerkleProof: "DidMerkleProofError", }, }, LinkedDidIdentityProviderError: { - _enum: ['DidNotFound', 'DidDeleted', 'Internal'], + _enum: ["DidNotFound", "DidDeleted", "Internal"], }, DidIdentityProviderError: { - _enum: ['DidNotFound', 'Internal'], + _enum: ["DidNotFound", "Internal"], }, DidMerkleProofError: { _enum: [ - 'UnsupportedVersion', - 'KeyNotFound', - 'LinkedAccountNotFound', - 'Web3NameNotFound', - 'Internal', + "UnsupportedVersion", + "KeyNotFound", + "LinkedAccountNotFound", + "Web3NameNotFound", + "Internal", ], }, } export async function createProviderApi(address: string): Promise { - return ApiPromise.create({ provider: new WsProvider(address), runtime: dipProviderCalls, types: dipTypes }) + return ApiPromise.create({ + provider: new WsProvider(address), + runtime: dipProviderCalls, + types: dipTypes, + }) +} + +// Taken from the KILT SDK +export async function signAndSubmitTx( + api: ApiPromise, + tx: SubmittableExtrinsic, + signer: KeyringPair, + { + tip, + ...opts + }: Partial & + Partial<{ tip: AnyNumber }> = {}, +): Promise { + const signedTx = await tx.signAsync(signer, { tip }) + return submitSignedTx(api, signedTx, opts) +} + +// Taken from the KILT SDK +async function submitSignedTx( + api: ApiPromise, + tx: SubmittableExtrinsic, + opts: Partial = {}, +): Promise { + const { + resolveOn = (result: ISubmittableResult) => + Kilt.Blockchain.IS_IN_BLOCK(result), + rejectOn = (result: ISubmittableResult) => + Kilt.Blockchain.EXTRINSIC_FAILED(result) || + Kilt.Blockchain.IS_ERROR(result), + } = opts + + const { promise, subscription } = + Kilt.ChainHelpers.SubscriptionPromise.makeSubscriptionPromise({ + ...opts, + resolveOn, + rejectOn, + }) + + let latestResult: SubmittableResult | undefined + const unsubscribe = await tx.send((result) => { + latestResult = result + subscription(result) + }) + + function handleDisconnect(): void { + const result = new SubmittableResult({ + events: latestResult?.events || [], + internalError: new Error("connection error"), + status: + latestResult?.status || + api.registry.createType("ExtrinsicStatus", "future"), + txHash: api.registry.createType("Hash"), + }) + subscription(result) + } + + api.once("disconnected", handleDisconnect) + + try { + return await promise + } catch (e) { + throw ( + Kilt.ChainHelpers.ErrorHandler.getExtrinsicError( + e as ISubmittableResult, + ) || e + ) + } finally { + unsubscribe() + api.off("disconnected", handleDisconnect) + } } diff --git a/tsconfig.base.json b/tsconfig.base.json index 5850851..f21eb33 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -11,9 +11,7 @@ "sourceMap": false, "declarationMap": false, "esModuleInterop": false, - "skipLibCheck": true, + "skipLibCheck": true }, - "exclude": [ - "**/*.d.ts" - ] + "exclude": ["**/*.d.ts"] } diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json index 8215b13..168842e 100644 --- a/tsconfig.cjs.json +++ b/tsconfig.cjs.json @@ -5,10 +5,6 @@ "module": "CommonJS", "declaration": true }, - "include": [ - "src/**/*.ts" - ], - "exclude": [ - "node_modules", - ] + "include": ["src/**/*.ts"], + "exclude": ["node_modules"] } diff --git a/tsconfig.esm.json b/tsconfig.esm.json index 90c494e..e1af5d8 100644 --- a/tsconfig.esm.json +++ b/tsconfig.esm.json @@ -5,10 +5,6 @@ "module": "Node16", "declaration": true }, - "include": [ - "src/**/*.ts" - ], - "exclude": [ - "node_modules", - ] + "include": ["src/**/*.ts"], + "exclude": ["node_modules"] } diff --git a/tsconfig.json b/tsconfig.json index 24a3346..786b27e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,8 +5,5 @@ "moduleResolution": "Node16", "noEmit": true }, - "include": [ - "tests/**/*.ts", - "src/**/*.ts" - ] + "include": ["tests/**/*.ts", "src/**/*.ts"] } diff --git a/yarn.lock b/yarn.lock index f38bd9f..688bbd7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -396,7 +396,6 @@ __metadata: prettier: ^3.0.0 rimraf: ^5.0.1 typescript: ^5.3.2 - typescript-object-builder: ^0.3.0 vitest: ^0.33.0 languageName: unknown linkType: soft @@ -5765,13 +5764,6 @@ __metadata: languageName: node linkType: hard -"typescript-object-builder@npm:^0.3.0": - version: 0.3.0 - resolution: "typescript-object-builder@npm:0.3.0" - checksum: 913fd400b2d959c473a446e933448699b46b42a92dec06efaf36b3e1167930dee47ef5eacbf337768fd10d4ac3ee06a6cdf50eede5331e6e976dfbeabf9bb0b0 - languageName: node - linkType: hard - "typescript@npm:^5.2.2, typescript@npm:^5.3.2": version: 5.3.2 resolution: "typescript@npm:5.3.2" From 7be5ee0116d65f712a115b00d5b2c4603f726401 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Thu, 30 Nov 2023 09:00:02 +0100 Subject: [PATCH 14/22] Simplify test environment setup --- package.json | 3 +-- scripts/start-zombienet | 24 ------------------------ scripts/stop-zombienet | 20 -------------------- 3 files changed, 1 insertion(+), 46 deletions(-) delete mode 100755 scripts/start-zombienet delete mode 100755 scripts/stop-zombienet diff --git a/package.json b/package.json index 1851f8e..380ec8c 100644 --- a/package.json +++ b/package.json @@ -52,8 +52,7 @@ "prepublish": "yarn exec cp -f ../../LICENSE .", "publish": "yarn npm publish --access=public --tolerate-republish", "test:e2e": "vitest run tests", - "test:e2e:zombienet:sibling:start": "yarn test:e2e:zombienet:sibling:stop; ./scripts/start-zombienet tests/zombienet/sibling.toml", - "test:e2e:zombienet:sibling:stop": "./scripts/stop-zombienet tests/zombienet/sibling.toml" + "test:e2e:zombienet:sibling:start": "yarn zombienet --spawn-concurrency 3 spawn tests/zombienet/sibling.toml" }, "stableVersion": "0.0.0", "type": "module", diff --git a/scripts/start-zombienet b/scripts/start-zombienet deleted file mode 100755 index e0b8724..0000000 --- a/scripts/start-zombienet +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env sh - -# Starts a Zombienet network with the provided config file, and saves its pid in a file under the `tmp` directory in the root of the project. - -if [ $# -ne 1 ]; then - echo 'One argument indicating the Zombienet config file path is expected.' - exit 1 -fi - -# Path of the Zombienet config file provided to the script -CONFIG_FILE_PATH=$1 -# Tmp folder under "./tmp" from the project's root -TMP_FOLDER_FOR_FILE="./tmp/$(dirname $CONFIG_FILE_PATH)" -# Path to store the pid of the current Zombienet setup -TMP_PID_FILE_FOR_FILE="./tmp/$CONFIG_FILE_PATH" -# Path to store the out logs of the current Zombienet setup -TMP_LOG_FILE_FOR_FILE="$TMP_PID_FILE_FOR_FILE-out.txt" -# Path to store the err logs of the current Zombienet setup -TMP_ERR_FILE_FOR_FILE="$TMP_PID_FILE_FOR_FILE-err.txt" - -set -x -mkdir -p $TMP_FOLDER_FOR_FILE && touch $TMP_FILE_FOR_FILE $TMP_LOG_FILE_FOR_FILE $TMP_ERR_FILE_FOR_FILE -yarn zombienet --spawn-concurrency 3 spawn $CONFIG_FILE_PATH >$TMP_LOG_FILE_FOR_FILE 2>$TMP_ERR_FILE_FOR_FILE & -echo $! > $TMP_PID_FILE_FOR_FILE diff --git a/scripts/stop-zombienet b/scripts/stop-zombienet deleted file mode 100755 index a444702..0000000 --- a/scripts/stop-zombienet +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env sh - -# Stops a previously-run Zombienet network with the provided config file by killing the process with the retrieved pid and delete any temp files for it. - -if [ $# -ne 1 ]; then - echo 'One argument indicating the Zombienet config file path is expected.' - exit 1 -fi - -CONFIG_FILE_PATH=$1 -TMP_FILE_FOR_FILE="./tmp/$CONFIG_FILE_PATH" -TMP_LOG_FILE_FOR_FILE="$TMP_FILE_FOR_FILE-out.txt" -TMP_ERR_FILE_FOR_FILE="$TMP_FILE_FOR_FILE-err.txt" - -set -x -PID=$(cat $TMP_FILE_FOR_FILE) -kill $PID >/dev/null -rm -rf $TMP_FILE_FOR_FILE $TMP_LOG_FILE_FOR_FILE $TMP_ERR_FILE_FOR_FILE -# Remove whole hierarchy if not other file is present. -find ./tmp -depth -type d -empty -exec rmdir "{}" \; From 818b857f400eb4e9c788a733c624a2f53be03cf8 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Thu, 30 Nov 2023 09:19:02 +0100 Subject: [PATCH 15/22] Remove parent mentions and simplify test cases --- .eslintrc.json | 44 ++++- README.md | 16 ++ package.json | 2 +- src/index.ts | 1 - src/parent.ts | 178 ------------------ tests/sibling.test.ts | 48 ++--- .../zombienet/{sibling.toml => network.toml} | 0 7 files changed, 77 insertions(+), 212 deletions(-) delete mode 100644 src/parent.ts rename tests/zombienet/{sibling.toml => network.toml} (100%) diff --git a/.eslintrc.json b/.eslintrc.json index 783f531..9758dfc 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -11,13 +11,19 @@ "plugin:import/recommended", "prettier" ], - "ignorePatterns": ["**/*.d.ts", "**/*.js"], + "ignorePatterns": [ + "**/*.d.ts", + "**/*.js" + ], "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": 2018, "sourceType": "module" }, - "plugins": ["@typescript-eslint", "license-header"], + "plugins": [ + "@typescript-eslint", + "license-header" + ], "rules": { "no-constant-condition": [ "error", @@ -28,7 +34,12 @@ "no-console": [ "error", { - "allow": ["warn", "error", "info", "debug"] + "allow": [ + "warn", + "error", + "info", + "debug" + ] } ], "@typescript-eslint/ban-ts-comment": [ @@ -58,12 +69,22 @@ "args": "none" } ], - "@typescript-eslint/prefer-for-of": ["error"], + "@typescript-eslint/prefer-for-of": [ + "error" + ], // "@typescript-eslint/prefer-optional-chain": ["error"], - "@typescript-eslint/prefer-ts-expect-error": ["error"], - "license-header/header": ["error", "./license-header.js"], + "@typescript-eslint/prefer-ts-expect-error": [ + "error" + ], + "license-header/header": [ + "error", + "./license-header.js" + ], "import/no-unresolved": "off", - "import/extensions": ["error", "ignorePackages"], + "import/extensions": [ + "error", + "ignorePackages" + ], "import/newline-after-import": [ "error", { @@ -77,12 +98,17 @@ "builtin", "external", "internal", - ["index", "parent", "sibling"], + [ + "index", + "sibling" + ], "object", "type" ], "newlines-between": "always", - "pathGroupsExcludedImportTypes": ["builtin"], + "pathGroupsExcludedImportTypes": [ + "builtin" + ], "alphabetize": { "order": "asc", "caseInsensitive": true diff --git a/README.md b/README.md index 40cc286..aab187c 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,19 @@ YARN: ``` yarn add @kiltprotocol/dip-sdk ``` + +## End-to-end testing + +The end-to-end testing use a Zombienet-based setup with a Kubernetes provider. +Hence, a Kubernetes cluster, e.g., [minikube](https://minikube.sigs.k8s.io/docs/start/) must be installed on the machine where the tests are to be executed. +For more information on how to set up the machine to spawn Zombienet-based network, please refer to the [official Zombienet repository](https://github.com/paritytech/zombienet). + +### Test execution + +Test execution requires the following steps: + +1. Switch to the expected Node version with `nvm use` +2. Install the repo dependencies with `yarn install` +3. Spin up the Zombienet network with `yarn test:e2e:deploy`. +4. Once the network deployment is complete, change the address for relaychain, provider, and consumer parachains in the test files within the `tests/*.test.ts` to point to the `relay-alice`, `provider-alice`, and `consumer-alice` nodes. +5. Run the end-to-end tests with `yarn test:e2e`. diff --git a/package.json b/package.json index 380ec8c..821dccf 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "prepublish": "yarn exec cp -f ../../LICENSE .", "publish": "yarn npm publish --access=public --tolerate-republish", "test:e2e": "vitest run tests", - "test:e2e:zombienet:sibling:start": "yarn zombienet --spawn-concurrency 3 spawn tests/zombienet/sibling.toml" + "test:e2e:deploy": "yarn zombienet --spawn-concurrency 3 spawn tests/zombienet/network.toml" }, "stableVersion": "0.0.0", "type": "module", diff --git a/src/index.ts b/src/index.ts index f4edd39..5c9216c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,6 +9,5 @@ * @module @kiltprotocol/dip-sdk */ -export * from "./parent.js" export * from "./sibling.js" export * from "./utils.js" diff --git a/src/parent.ts b/src/parent.ts deleted file mode 100644 index b115d45..0000000 --- a/src/parent.ts +++ /dev/null @@ -1,178 +0,0 @@ -/** - * Copyright (c) 2023, BOTLabs GmbH. - * - * This source code is licensed under the BSD 4-Clause "Original" license - * found in the LICENSE file in the root directory of this source tree. - */ - -import { toChain } from "@kiltprotocol/did" -import { ApiPromise } from "@polkadot/api" -import { u8aToHex } from "@polkadot/util" - -import { - defaultValues, - generateDipCommitmentProof, - generateDipDidSignature, - generateDipIdentityProof, - generateProviderStateRootProof, -} from "./utils.js" - -import type { PalletDidLookupLinkableAccountLinkableAccountId } from "@kiltprotocol/augment-api" -import type { - DidUri, - VerificationKeyRelationship, - SubmittableExtrinsic, - DidKey, - SignExtrinsicCallback, -} from "@kiltprotocol/types" -import type { KeyringPair } from "@polkadot/keyring/types" -import type { Call, Hash } from "@polkadot/types/interfaces" - -export type DipParentProofInput = { - call: Call - didUri: DidUri - keyIds: Array - proofVersion: number - providerApi: ApiPromise - relayApi: ApiPromise - signer: SignExtrinsicCallback - submitterAddress: KeyringPair["address"] - keyRelationship: VerificationKeyRelationship - // Optional, retrieved from chain otherwise - blockHeight?: number - genesisHash?: Hash - providerBlockHeight?: number - // With defaults - accountIdRuntimeType?: string - blockNumberRuntimeType?: string - identityDetailsRuntimeType?: string - includeWeb3Name?: boolean - linkedAccounts?: readonly PalletDidLookupLinkableAccountLinkableAccountId[] -} - -/** - * Generate a submittable extrinsic for the provided call which includes a complete DIP proof according to the parameters provided, to be used on the relay chain of which the provider chain is a parachain. - * - * @param params The DIP proof params. - * @param params.call The [[Call]] on the relay chain that requires a DIP origin. - * @param params.didUri The DID URI of the DIP subject that is performing the cross-chain operation. - * @param params.keyIds The verification method IDs of the DID to be revealed in the cross-chain operation. - * @param params.proofVersion The version of the DIP proof to generate. - * @param params.providerApi The [[ApiPromise]] instance for the provider chain. - * @param params.relayApi The [[ApiPromise]] instance for the relay chain. - * @param params.signer The signing callback to sign the cross-chain transaction. - * @param params.submitterAddress The address of the tx submitter on the relay chain. - * @param params.keyRelationship The [[VerificationKeyRelationship]] required for the DIP operation to be authorized on the relay chain. - * @param params.blockHeight [OPTIONAL] The block number on the relay chain to use for the DID signature. If not provided, the latest best block number is used. - * @param params.genesisHash [OPTIONAL] The genesis hash of the relay chain to use for the DID signature. If not provided, it is retrieved at runtime from the relay chain. - * @param params.providerBlockHeight [OPTIONAL] The block number of the provider to use for the generation of the DIP proof. If not provided, the latest finalized block number is used. - * @param params.accountIdRuntimeType [OPTIONAL] The runtime type definition for an `AccountId` on the relay chain. If not provided, the `AccountId` type is used. - * @param params.blockNumberRuntimeType [OPTIONAL] The runtime type definition for a `BlockNumber` on the relay chain. If not provided, the `u64` type is used. - * @param params.identityDetailsRuntimeType [OPTIONAL] The runtime type definition for the `IdentityDetails` on the relay chain. If not provided, the `Option` type, representing a simple nonce, is used. - * @param params.includeWeb3Name [OPTIONAL] Flag indicating whether the generated DIP proof should include the web3name of the DID subject. If not provided, the web3name is not revealed. - * @param params.linkedAccounts [OPTIONAL] The list of linked accounts to reveal in the generated DIP proof. If not provided, no account is revealed. - * - * @returns The [[SubmittableExtrinsic]] containing the signed cross-chain operation, that must be submitted by the account specified as the `submitterAddress` parameter. - */ -export async function generateDipAuthorizedTxForParent({ - call, - didUri, - keyIds, - proofVersion, - providerApi, - relayApi, - signer, - submitterAddress, - keyRelationship, - // Optional - blockHeight, - genesisHash, - providerBlockHeight, - // With defaults - accountIdRuntimeType = defaultValues.accountIdRuntimeType, - blockNumberRuntimeType = defaultValues.blockNumberRuntimeType, - identityDetailsRuntimeType = defaultValues.identityDetailsRuntimeType, - includeWeb3Name = defaultValues.includeWeb3Name, - linkedAccounts = defaultValues.linkedAccounts, -}: DipParentProofInput): Promise { - const { - proof: providerStateRootProof, - providerBlockHeight: providerStateRootProofProviderBlockHeight, - relayBlockHeight: providerStateRootProofRelayBlockHeight, - } = await generateProviderStateRootProof({ - relayApi, - providerApi, - providerBlockHeight, - }) - - const providerStateRootProofRelayBlockHeader = - await relayApi.rpc.chain.getHeader(providerStateRootProof.at) - - // Proof of commitment must be generated with the state root at the block before the last one finalized. - const dipRootProofBlockHash = await providerApi.rpc.chain.getBlockHash( - providerStateRootProofProviderBlockHeight - 1, - ) - - const { proof: dipCommitmentProof } = await generateDipCommitmentProof({ - didUri, - providerApi, - providerBlockHash: dipRootProofBlockHash, - version: proofVersion, - }) - - const { proof: dipIdentityProof } = await generateDipIdentityProof({ - didUri, - providerApi, - keyIds, - linkedAccounts, - version: proofVersion, - includeWeb3Name, - }) - - const { - blockNumber: didSignatureBlockNumber, - signature: didSignature, - type: didSignatureType, - } = await generateDipDidSignature({ - provider: { - didUri, - signer, - keyRelationship, - }, - consumer: { - api: relayApi, - call, - submitterAddress, - accountIdRuntimeType, - blockHeight, - blockNumberRuntimeType, - genesisHash, - identityDetailsRuntimeType, - }, - }) - - return relayApi.tx.dipConsumer.dispatchAs(toChain(didUri), { - [`V${proofVersion}`]: { - paraStateRoot: { - relayBlockHeight: providerStateRootProofRelayBlockHeight, - proof: providerStateRootProof, - }, - header: { - ...providerStateRootProofRelayBlockHeader.toJSON(), - }, - dipIdentityCommitment: dipCommitmentProof, - did: { - leaves: { - blinded: dipIdentityProof.blinded, - revealed: dipIdentityProof.revealed, - }, - signature: { - signature: { - [didSignatureType]: u8aToHex(didSignature), - }, - blockNumber: didSignatureBlockNumber, - }, - }, - }, - }) -} diff --git a/tests/sibling.test.ts b/tests/sibling.test.ts index 82e7dc2..b77b6fe 100644 --- a/tests/sibling.test.ts +++ b/tests/sibling.test.ts @@ -46,6 +46,10 @@ const providerAndConsumerSudoKeypair = keyring.addFromUri("//Alice") Kilt.ConfigService.set({ submitTxResolveOn: Kilt.Blockchain.IS_IN_BLOCK }) +const relayAddress = "ws://127.0.0.1:42037" +const providerAddress = "ws://127.0.0.1:46157" +const consumerAddress = "ws://127.0.0.1:40171" + describe("V0", () => { // beforeAll let v0Config: typeof baseConfig & @@ -73,9 +77,9 @@ describe("V0", () => { beforeAll(async () => { const [relayApi, providerApi, consumerApi] = await Promise.all([ - ApiPromise.create({ provider: new WsProvider("ws://127.0.0.1:45703") }), - createProviderApi("ws://127.0.0.1:46741"), - ApiPromise.create({ provider: new WsProvider("ws://127.0.0.1:45781") }), + ApiPromise.create({ provider: new WsProvider(relayAddress) }), + createProviderApi(providerAddress), + ApiPromise.create({ provider: new WsProvider(consumerAddress) }), ]) Kilt.ConfigService.set({ api: providerApi }) @@ -179,7 +183,7 @@ describe("V0", () => { } }, 96_000) - it("Successful post on the consumer's PostIt pallet using the default latest finalized block", async () => { + it("Successful post on the consumer's PostIt pallet", async () => { const { consumerApi } = testConfig const postText = "Hello, world!" const config: DipSiblingProofInput = { @@ -215,43 +219,41 @@ describe("V0", () => { postEntry.isSome, "Post should successfully be stored on the chain", ).toBe(true) - }) - it("Successful post on the consumer's PostIt pallet using the same block as the previous operation, explicitly", async () => { - const { consumerApi } = testConfig - const postText = "Hello, world!" - const config: DipSiblingProofInput = { - ...testConfig, - call: consumerApi.tx.postIt.post(postText).method as Call, + // Try again using an explicit block number + const newPostText = "Hello, world 2!" + const newConfig: DipSiblingProofInput = { + ...config, providerBlockHeight: lastTestSetupProviderBlockNumber, + call: consumerApi.tx.postIt.post(newPostText).method as Call, } - const crossChainTx = await generateDipAuthorizedTxForSibling(config) - const { status } = await signAndSubmitTx( + const newCrossChainTx = await generateDipAuthorizedTxForSibling(newConfig) + const { status: newStatus } = await signAndSubmitTx( consumerApi, - crossChainTx, + newCrossChainTx, submitterKeypair, ) - expect(status.isInBlock, "Status of submitted tx should be in block.").toBe( + expect(newStatus.isInBlock, "Status of submitted tx should be in block.").toBe( true, ) - const blockHash = status.asInBlock - const blockNumber = (await consumerApi.rpc.chain.getHeader(blockHash)) + const newBlockHash = newStatus.asInBlock + const newBlockNumber = (await consumerApi.rpc.chain.getHeader(newBlockHash)) .number // The example PostIt pallet generates the storage key for a post by hashing (block number, submitter's username, content of the post). - const postKey = blake2AsHex( + const newPostKey = blake2AsHex( consumerApi .createType(`(BlockNumber, ${web3NameRuntimeType}, Bytes)`, [ - blockNumber, + newBlockNumber, web3Name, - postText, + newPostText, ]) .toHex(), ) - const postEntry = - await consumerApi.query.postIt.posts>(postKey) + const newPostEntry = + await consumerApi.query.postIt.posts>(newPostKey) expect( - postEntry.isSome, + newPostEntry.isSome, "Post should successfully be stored on the chain", ).toBe(true) }) diff --git a/tests/zombienet/sibling.toml b/tests/zombienet/network.toml similarity index 100% rename from tests/zombienet/sibling.toml rename to tests/zombienet/network.toml From fb19b706e1a57a3e807946ac2e9df83b3864f3ce Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Thu, 30 Nov 2023 09:33:06 +0100 Subject: [PATCH 16/22] Finish line --- tests/sibling.test.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/sibling.test.ts b/tests/sibling.test.ts index b77b6fe..eec48ff 100644 --- a/tests/sibling.test.ts +++ b/tests/sibling.test.ts @@ -14,7 +14,7 @@ import { BN } from "bn.js" import { beforeAll, describe, it, expect, beforeEach } from "vitest" import { createProviderApi, signAndSubmitTx } from "./utils.js" -import { generateDipAuthorizedTxForSibling } from "../src/index.js" + import type { DipSiblingProofInput } from "../src/index.js" import type { GetStoreTxSignCallback, Web3Name } from "@kiltprotocol/did" @@ -27,6 +27,8 @@ import type { Option } from "@polkadot/types/codec" import type { Call } from "@polkadot/types/interfaces" import type { Codec } from "@polkadot/types/types" +import { generateDipAuthorizedTxForSibling } from "../src/index.js" + const baseConfig: Pick< DipSiblingProofInput, | "accountIdRuntimeType" @@ -46,9 +48,9 @@ const providerAndConsumerSudoKeypair = keyring.addFromUri("//Alice") Kilt.ConfigService.set({ submitTxResolveOn: Kilt.Blockchain.IS_IN_BLOCK }) -const relayAddress = "ws://127.0.0.1:42037" -const providerAddress = "ws://127.0.0.1:46157" -const consumerAddress = "ws://127.0.0.1:40171" +const relayAddress = "ws://127.0.0.1:33925" +const providerAddress = "ws://127.0.0.1:45931" +const consumerAddress = "ws://127.0.0.1:45279" describe("V0", () => { // beforeAll @@ -183,7 +185,7 @@ describe("V0", () => { } }, 96_000) - it("Successful post on the consumer's PostIt pallet", async () => { + it("Successful posts on the consumer's PostIt pallet", async () => { const { consumerApi } = testConfig const postText = "Hello, world!" const config: DipSiblingProofInput = { From 42960e4557a503584c7a02a8b7a0710864de1cf4 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Thu, 30 Nov 2023 13:15:15 +0100 Subject: [PATCH 17/22] Refine tests --- .env.test | 3 + .eslintrc.json | 44 +---- .gitignore | 3 + README.md | 2 +- package.json | 5 +- src/utils.ts | 2 +- tests/sibling.test.ts | 382 ++++++++++++++++++++++-------------------- tests/utils.ts | 29 +++- yarn.lock | 8 + 9 files changed, 254 insertions(+), 224 deletions(-) create mode 100644 .env.test diff --git a/.env.test b/.env.test new file mode 100644 index 0000000..4643dca --- /dev/null +++ b/.env.test @@ -0,0 +1,3 @@ +RELAY_ADDRESS="ws://127.0.0.1:32835" +PROVIDER_ADDRESS="ws://127.0.0.1:41115" +CONSUMER_ADDRESS="ws://127.0.0.1:35167" diff --git a/.eslintrc.json b/.eslintrc.json index 9758dfc..c640169 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -11,19 +11,13 @@ "plugin:import/recommended", "prettier" ], - "ignorePatterns": [ - "**/*.d.ts", - "**/*.js" - ], + "ignorePatterns": ["**/*.d.ts", "**/*.js"], "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": 2018, "sourceType": "module" }, - "plugins": [ - "@typescript-eslint", - "license-header" - ], + "plugins": ["@typescript-eslint", "license-header"], "rules": { "no-constant-condition": [ "error", @@ -34,12 +28,7 @@ "no-console": [ "error", { - "allow": [ - "warn", - "error", - "info", - "debug" - ] + "allow": ["warn", "error", "info", "debug"] } ], "@typescript-eslint/ban-ts-comment": [ @@ -69,22 +58,12 @@ "args": "none" } ], - "@typescript-eslint/prefer-for-of": [ - "error" - ], + "@typescript-eslint/prefer-for-of": ["error"], // "@typescript-eslint/prefer-optional-chain": ["error"], - "@typescript-eslint/prefer-ts-expect-error": [ - "error" - ], - "license-header/header": [ - "error", - "./license-header.js" - ], + "@typescript-eslint/prefer-ts-expect-error": ["error"], + "license-header/header": ["error", "./license-header.js"], "import/no-unresolved": "off", - "import/extensions": [ - "error", - "ignorePackages" - ], + "import/extensions": ["error", "ignorePackages"], "import/newline-after-import": [ "error", { @@ -98,17 +77,12 @@ "builtin", "external", "internal", - [ - "index", - "sibling" - ], + ["index", "sibling"], "object", "type" ], "newlines-between": "always", - "pathGroupsExcludedImportTypes": [ - "builtin" - ], + "pathGroupsExcludedImportTypes": ["builtin"], "alphabetize": { "order": "asc", "caseInsensitive": true diff --git a/.gitignore b/.gitignore index c0bba76..941f726 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ cjs # VSCode .vscode + +# Tests +.env diff --git a/README.md b/README.md index aab187c..ecd0079 100644 --- a/README.md +++ b/README.md @@ -35,5 +35,5 @@ Test execution requires the following steps: 1. Switch to the expected Node version with `nvm use` 2. Install the repo dependencies with `yarn install` 3. Spin up the Zombienet network with `yarn test:e2e:deploy`. -4. Once the network deployment is complete, change the address for relaychain, provider, and consumer parachains in the test files within the `tests/*.test.ts` to point to the `relay-alice`, `provider-alice`, and `consumer-alice` nodes. +4. Once the network deployment is complete, create a `.env.test` file with `RELAY_ADDRESS`, `PROVIDER_ADDRESS`, and `CONSUMER_ADDRESS` values pointing to the started nodes for relaychain, provider chain and consumer chain respectively. 5. Run the end-to-end tests with `yarn test:e2e`. diff --git a/package.json b/package.json index 821dccf..22efc7b 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@typescript-eslint/parser": "^6.2.0", "@zombienet/cli": "^1.3.82", "bn.js": "^5.2.1", + "dotenv": "^16.3.1", "eslint": "^8.45.0", "eslint-config-prettier": "^8.9.0", "eslint-plugin-import": "^2.27.5", @@ -24,7 +25,7 @@ "vitest": "^0.33.0" }, "engines": { - "node": ">=18.0" + "node": ">=16.0" }, "exports": { "import": "./dist/esm/index.js", @@ -51,7 +52,7 @@ "lint:fix": "prettier -w . && eslint --fix --ext .ts .", "prepublish": "yarn exec cp -f ../../LICENSE .", "publish": "yarn npm publish --access=public --tolerate-republish", - "test:e2e": "vitest run tests", + "test:e2e": "yarn build && vitest run tests", "test:e2e:deploy": "yarn zombienet --spawn-concurrency 3 spawn tests/zombienet/network.toml" }, "stableVersion": "0.0.0", diff --git a/src/utils.ts b/src/utils.ts index 6b8ed4f..30ddf58 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -244,7 +244,7 @@ export async function generateDipDidSignature({ genesisHash, }, }: DipDidSignatureOpts): Promise { - const blockNumber = + const blockNumber: number = blockHeight ?? ((await api.query.system.number()) as any).toNumber() const genesis = genesisHash ?? (await api.query.system.blockHash(0)) const identityDetails = ( diff --git a/tests/sibling.test.ts b/tests/sibling.test.ts index eec48ff..b4ae307 100644 --- a/tests/sibling.test.ts +++ b/tests/sibling.test.ts @@ -11,13 +11,17 @@ import * as Kilt from "@kiltprotocol/sdk-js" import { ApiPromise, WsProvider } from "@polkadot/api" import { blake2AsHex } from "@polkadot/util-crypto" import { BN } from "bn.js" -import { beforeAll, describe, it, expect, beforeEach } from "vitest" +import dotenv from "dotenv" +import { beforeAll, describe, it, expect } from "vitest" -import { createProviderApi, signAndSubmitTx } from "./utils.js" +import { + createProviderApi, + signAndSubmitTx, + withCrossModuleSystemImport, +} from "./utils.js" - -import type { DipSiblingProofInput } from "../src/index.js" import type { GetStoreTxSignCallback, Web3Name } from "@kiltprotocol/did" +import type { DipSiblingProofInput } from "@kiltprotocol/dip-sdk" import type { DidDocument, KiltAddress, @@ -27,7 +31,7 @@ import type { Option } from "@polkadot/types/codec" import type { Call } from "@polkadot/types/interfaces" import type { Codec } from "@polkadot/types/types" -import { generateDipAuthorizedTxForSibling } from "../src/index.js" +dotenv.config({ path: ".env.test" }) const baseConfig: Pick< DipSiblingProofInput, @@ -48,9 +52,9 @@ const providerAndConsumerSudoKeypair = keyring.addFromUri("//Alice") Kilt.ConfigService.set({ submitTxResolveOn: Kilt.Blockchain.IS_IN_BLOCK }) -const relayAddress = "ws://127.0.0.1:33925" -const providerAddress = "ws://127.0.0.1:45931" -const consumerAddress = "ws://127.0.0.1:45279" +const relayAddress = process.env["RELAY_ADDRESS"] as string +const providerAddress = process.env["PROVIDER_ADDRESS"] as string +const consumerAddress = process.env["CONSUMER_ADDRESS"] as string describe("V0", () => { // beforeAll @@ -60,23 +64,6 @@ describe("V0", () => { "consumerApi" | "proofVersion" | "providerApi" | "relayApi" > - // beforeEach - let submitterKeypair: Kilt.KeyringPair - let did: DidDocument - let web3Name: Web3Name - let didKeypair: Kilt.KeyringPair - let lastTestSetupProviderBlockNumber: number - let testConfig: typeof v0Config & - Pick< - DipSiblingProofInput, - | "didUri" - | "signer" - | "keyIds" - | "keyRelationship" - | "includeWeb3Name" - | "submitterAddress" - > - beforeAll(async () => { const [relayApi, providerApi, consumerApi] = await Promise.all([ ApiPromise.create({ provider: new WsProvider(relayAddress) }), @@ -94,169 +81,198 @@ describe("V0", () => { } }) - beforeEach(async () => { - const { providerApi, consumerApi } = v0Config - const newSubmitterKeypair = keyring.addFromMnemonic( - Kilt.Utils.Crypto.mnemonicGenerate(), - ) - const balanceTransferTxOnProviderChain = providerApi.tx.balances.transfer( - newSubmitterKeypair.address, - 10 ** 15, - ) - const balanceTransferTxOnConsumerChain = consumerApi.tx.balances.transfer( - newSubmitterKeypair.address, - 10 ** 15, - ) - await Promise.all([ - Kilt.Blockchain.signAndSubmitTx( - balanceTransferTxOnProviderChain, - providerAndConsumerSudoKeypair, - ), - balanceTransferTxOnConsumerChain.signAndSend( - providerAndConsumerSudoKeypair, - ), - ]) - const newDidKeypair = keyring.addFromMnemonic( - Kilt.Utils.Crypto.mnemonicGenerate(), - ) - const newLightDid = Kilt.Did.createLightDidDocument({ - // @ts-expect-error We know that the type is an "sr25519" - authentication: [{ ...newDidKeypair }], - }) - const newFullDidUri = Kilt.Did.getFullDidUri(newLightDid.uri) - const signCallback: GetStoreTxSignCallback = async ({ data }) => ({ - signature: await newDidKeypair.sign(data), - keyType: newDidKeypair.type as VerificationKeyType, - }) - const didCreationTx = await Kilt.Did.getStoreTx( - newLightDid, - newSubmitterKeypair.address as KiltAddress, - signCallback, - ) - const newWeb3Name = Kilt.Utils.UUID.generate().substring(2, 25) - const web3NameTx = await Kilt.Did.authorizeTx( - newFullDidUri, - providerApi.tx.web3Names.claim(newWeb3Name), - signCallback, - newSubmitterKeypair.address as KiltAddress, - { txCounter: new BN(1) }, - ) - const commitIdentityTx = await Kilt.Did.authorizeTx( - newFullDidUri, - providerApi.tx.dipProvider.commitIdentity( - Kilt.Did.toChain(newFullDidUri), - 0, - ), - signCallback, - newSubmitterKeypair.address as KiltAddress, - { txCounter: new BN(2) }, - ) - const batchedTx = providerApi.tx.utility.batchAll([ - didCreationTx, - web3NameTx, - commitIdentityTx, - ]) - await Kilt.Blockchain.signAndSubmitTx(batchedTx, newSubmitterKeypair, { - resolveOn: Kilt.Blockchain.IS_FINALIZED, - }) - // FIXME: Timeout needed since it seems `.getFinalizedHead()` still returns the previous block number as the latest finalized, even if we wait for finalization above. This results in invalid storage proofs. - await setTimeout(12_000) - lastTestSetupProviderBlockNumber = ( - await providerApi.query.system.number() - ).toNumber() - const newFullDid = (await Kilt.Did.resolve(newFullDidUri)) - ?.document as DidDocument - submitterKeypair = newSubmitterKeypair - did = newFullDid - web3Name = newWeb3Name - didKeypair = newDidKeypair + describe("CJS + ESM", () => { + // beforeAll + let submitterKeypair: Kilt.KeyringPair + let did: DidDocument + let web3Name: Web3Name + let didKeypair: Kilt.KeyringPair + let lastTestSetupProviderBlockNumber: number + let testConfig: typeof v0Config & + Pick< + DipSiblingProofInput, + | "didUri" + | "signer" + | "keyIds" + | "keyRelationship" + | "includeWeb3Name" + | "submitterAddress" + > - testConfig = { - ...v0Config, - didUri: did.uri, - signer: async ({ data }) => ({ - signature: await didKeypair.sign(data), - keyType: didKeypair.type as VerificationKeyType, - }), - keyIds: [did.authentication[0].id], - keyRelationship: "authentication", - includeWeb3Name: true, - submitterAddress: submitterKeypair.address, - } - }, 96_000) + beforeAll(async () => { + const { providerApi, consumerApi } = v0Config + const newSubmitterKeypair = keyring.addFromMnemonic( + Kilt.Utils.Crypto.mnemonicGenerate(), + ) + const balanceTransferTxOnProviderChain = providerApi.tx.balances.transfer( + newSubmitterKeypair.address, + 10 ** 15, + ) + const balanceTransferTxOnConsumerChain = consumerApi.tx.balances.transfer( + newSubmitterKeypair.address, + 10 ** 15, + ) + await Promise.all([ + Kilt.Blockchain.signAndSubmitTx( + balanceTransferTxOnProviderChain, + providerAndConsumerSudoKeypair, + ), + balanceTransferTxOnConsumerChain.signAndSend( + providerAndConsumerSudoKeypair, + ), + ]) + const newDidKeypair = keyring.addFromMnemonic( + Kilt.Utils.Crypto.mnemonicGenerate(), + ) + const newLightDid = Kilt.Did.createLightDidDocument({ + // @ts-expect-error We know that the type is an "sr25519" + authentication: [{ ...newDidKeypair }], + }) + const newFullDidUri = Kilt.Did.getFullDidUri(newLightDid.uri) + const signCallback: GetStoreTxSignCallback = async ({ data }) => ({ + signature: await newDidKeypair.sign(data), + keyType: newDidKeypair.type as VerificationKeyType, + }) + const didCreationTx = await Kilt.Did.getStoreTx( + newLightDid, + newSubmitterKeypair.address as KiltAddress, + signCallback, + ) + const newWeb3Name = Kilt.Utils.UUID.generate().substring(2, 25) + const web3NameTx = await Kilt.Did.authorizeTx( + newFullDidUri, + providerApi.tx.web3Names.claim(newWeb3Name), + signCallback, + newSubmitterKeypair.address as KiltAddress, + { txCounter: new BN(1) }, + ) + const commitIdentityTx = await Kilt.Did.authorizeTx( + newFullDidUri, + providerApi.tx.dipProvider.commitIdentity( + Kilt.Did.toChain(newFullDidUri), + 0, + ), + signCallback, + newSubmitterKeypair.address as KiltAddress, + { txCounter: new BN(2) }, + ) + const batchedTx = providerApi.tx.utility.batchAll([ + didCreationTx, + web3NameTx, + commitIdentityTx, + ]) + await Kilt.Blockchain.signAndSubmitTx(batchedTx, newSubmitterKeypair, { + resolveOn: Kilt.Blockchain.IS_FINALIZED, + }) + // FIXME: Timeout needed since it seems `.getFinalizedHead()` still returns the previous block number as the latest finalized, even if we wait for finalization above. This results in invalid storage proofs. + await setTimeout(12_000) + lastTestSetupProviderBlockNumber = ( + await providerApi.query.system.number() + ).toNumber() + const newFullDid = (await Kilt.Did.resolve(newFullDidUri)) + ?.document as DidDocument + submitterKeypair = newSubmitterKeypair + did = newFullDid + web3Name = newWeb3Name + didKeypair = newDidKeypair - it("Successful posts on the consumer's PostIt pallet", async () => { - const { consumerApi } = testConfig - const postText = "Hello, world!" - const config: DipSiblingProofInput = { - ...testConfig, - call: consumerApi.tx.postIt.post(postText).method as Call, - } + testConfig = { + ...v0Config, + didUri: did.uri, + signer: async ({ data }) => ({ + signature: await didKeypair.sign(data), + keyType: didKeypair.type as VerificationKeyType, + }), + keyIds: [did.authentication[0].id], + keyRelationship: "authentication", + includeWeb3Name: true, + submitterAddress: submitterKeypair.address, + } + }, 96_000) - const crossChainTx = await generateDipAuthorizedTxForSibling(config) - const { status } = await signAndSubmitTx( - consumerApi, - crossChainTx, - submitterKeypair, - ) - expect(status.isInBlock, "Status of submitted tx should be in block.").toBe( - true, - ) - const blockHash = status.asInBlock - const blockNumber = (await consumerApi.rpc.chain.getHeader(blockHash)) - .number - // The example PostIt pallet generates the storage key for a post by hashing (block number, submitter's username, content of the post). - const postKey = blake2AsHex( - consumerApi - .createType(`(BlockNumber, ${web3NameRuntimeType}, Bytes)`, [ - blockNumber, - web3Name, - postText, - ]) - .toHex(), - ) - const postEntry = - await consumerApi.query.postIt.posts>(postKey) - expect( - postEntry.isSome, - "Post should successfully be stored on the chain", - ).toBe(true) + withCrossModuleSystemImport( + "..", + async (DipSdk) => { + it("Successful posts on the consumer's PostIt pallet", async () => { + const { consumerApi } = testConfig + const postText = "Hello, world!" + const config: DipSiblingProofInput = { + ...testConfig, + call: consumerApi.tx.postIt.post(postText).method as Call, + } - // Try again using an explicit block number - const newPostText = "Hello, world 2!" - const newConfig: DipSiblingProofInput = { - ...config, - providerBlockHeight: lastTestSetupProviderBlockNumber, - call: consumerApi.tx.postIt.post(newPostText).method as Call, - } + const crossChainTx = + await DipSdk.generateDipAuthorizedTxForSibling(config) + const { status } = await signAndSubmitTx( + consumerApi, + crossChainTx, + submitterKeypair, + ) + expect( + status.isInBlock, + "Status of submitted tx should be in block.", + ).toBe(true) + const blockHash = status.asInBlock + const blockNumber = (await consumerApi.rpc.chain.getHeader(blockHash)) + .number + // The example PostIt pallet generates the storage key for a post by hashing (block number, submitter's username, content of the post). + const postKey = blake2AsHex( + consumerApi + .createType(`(BlockNumber, ${web3NameRuntimeType}, Bytes)`, [ + blockNumber, + web3Name, + postText, + ]) + .toHex(), + ) + const postEntry = + await consumerApi.query.postIt.posts>(postKey) + expect( + postEntry.isSome, + "Post should successfully be stored on the chain", + ).toBe(true) - const newCrossChainTx = await generateDipAuthorizedTxForSibling(newConfig) - const { status: newStatus } = await signAndSubmitTx( - consumerApi, - newCrossChainTx, - submitterKeypair, - ) - expect(newStatus.isInBlock, "Status of submitted tx should be in block.").toBe( - true, - ) - const newBlockHash = newStatus.asInBlock - const newBlockNumber = (await consumerApi.rpc.chain.getHeader(newBlockHash)) - .number - // The example PostIt pallet generates the storage key for a post by hashing (block number, submitter's username, content of the post). - const newPostKey = blake2AsHex( - consumerApi - .createType(`(BlockNumber, ${web3NameRuntimeType}, Bytes)`, [ - newBlockNumber, - web3Name, - newPostText, - ]) - .toHex(), + // Try again using an explicit block number, should yield the same result. + const newPostText = "Hello, world 2!" + const newConfig: DipSiblingProofInput = { + ...config, + providerBlockHeight: lastTestSetupProviderBlockNumber, + call: consumerApi.tx.postIt.post(newPostText).method as Call, + } + + const newCrossChainTx = + await DipSdk.generateDipAuthorizedTxForSibling(newConfig) + const { status: newStatus } = await signAndSubmitTx( + consumerApi, + newCrossChainTx, + submitterKeypair, + ) + expect( + newStatus.isInBlock, + "Status of submitted tx should be in block.", + ).toBe(true) + const newBlockHash = newStatus.asInBlock + const newBlockNumber = ( + await consumerApi.rpc.chain.getHeader(newBlockHash) + ).number + // The example PostIt pallet generates the storage key for a post by hashing (block number, submitter's username, content of the post). + const newPostKey = blake2AsHex( + consumerApi + .createType(`(BlockNumber, ${web3NameRuntimeType}, Bytes)`, [ + newBlockNumber, + web3Name, + newPostText, + ]) + .toHex(), + ) + const newPostEntry = + await consumerApi.query.postIt.posts>(newPostKey) + expect( + newPostEntry.isSome, + "Post should successfully be stored on the chain", + ).toBe(true) + }) + }, ) - const newPostEntry = - await consumerApi.query.postIt.posts>(newPostKey) - expect( - newPostEntry.isSome, - "Post should successfully be stored on the chain", - ).toBe(true) }) }, 60_000) diff --git a/tests/utils.ts b/tests/utils.ts index d344508..2e57aaf 100644 --- a/tests/utils.ts +++ b/tests/utils.ts @@ -8,6 +8,7 @@ import * as Kilt from "@kiltprotocol/sdk-js" import { didCalls, types } from "@kiltprotocol/type-definitions" import { ApiPromise, SubmittableResult, WsProvider } from "@polkadot/api" +import { describe } from "vitest" import type { KeyringPair, SubmittableExtrinsic } from "@kiltprotocol/types" import type { @@ -120,7 +121,7 @@ export async function createProviderApi(address: string): Promise { }) } -// Taken from the KILT SDK +// Taken from the KILT SDK: https://github.com/KILTprotocol/sdk-js/blob/c4ab492812d19169532a399b57dd1bd013a61570/packages/chain-helpers/src/blockchain/Blockchain.ts#L179 export async function signAndSubmitTx( api: ApiPromise, tx: SubmittableExtrinsic, @@ -135,7 +136,7 @@ export async function signAndSubmitTx( return submitSignedTx(api, signedTx, opts) } -// Taken from the KILT SDK +// Taken from the KILT SDK: https://github.com/KILTprotocol/sdk-js/blob/c4ab492812d19169532a399b57dd1bd013a61570/packages/chain-helpers/src/blockchain/Blockchain.ts#L116 async function submitSignedTx( api: ApiPromise, tx: SubmittableExtrinsic, @@ -189,3 +190,27 @@ async function submitSignedTx( api.off("disconnected", handleDisconnect) } } + +const testForBothModules = describe.each([ + { module: "ESM", importer: async (module: string) => import(module) }, + { module: "CJS", importer: async (module: string) => require(module) }, +]) + +/** + * Loads `module` and passes the implementation to the `tests` closure. + * All tests defined in this closure are run twice; once using the module implementation + * as loaded by `require()` and once as loaded by `import()`. + * Note that some features, such as inline snapshots, are unavailable in these tests. + * + * @param module The module to be loaded. + * @param tests A function defining tests using vitest's `it` or `test`. Receives the loaded module implementation as its first argument. + */ +export function withCrossModuleSystemImport( + module: string, + tests: (imported: mod) => void | Promise, +): void { + return testForBothModules("$module", async ({ importer }) => { + const imported = await importer(module) + return tests(imported) + }) +} diff --git a/yarn.lock b/yarn.lock index 688bbd7..385f8cd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -389,6 +389,7 @@ __metadata: "@typescript-eslint/parser": ^6.2.0 "@zombienet/cli": ^1.3.82 bn.js: ^5.2.1 + dotenv: ^16.3.1 eslint: ^8.45.0 eslint-config-prettier: ^8.9.0 eslint-plugin-import: ^2.27.5 @@ -2564,6 +2565,13 @@ __metadata: languageName: node linkType: hard +"dotenv@npm:^16.3.1": + version: 16.3.1 + resolution: "dotenv@npm:16.3.1" + checksum: 15d75e7279018f4bafd0ee9706593dd14455ddb71b3bcba9c52574460b7ccaf67d5cf8b2c08a5af1a9da6db36c956a04a1192b101ee102a3e0cf8817bbcf3dfd + languageName: node + linkType: hard + "eastasianwidth@npm:^0.2.0": version: 0.2.0 resolution: "eastasianwidth@npm:0.2.0" From de4835e0d1ee2d4c56228837c98aafcc2a101734 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Thu, 30 Nov 2023 13:25:37 +0100 Subject: [PATCH 18/22] All tests passing --- tests/sibling.test.ts | 46 ++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/tests/sibling.test.ts b/tests/sibling.test.ts index b4ae307..0d8028d 100644 --- a/tests/sibling.test.ts +++ b/tests/sibling.test.ts @@ -193,7 +193,7 @@ describe("V0", () => { withCrossModuleSystemImport( "..", async (DipSdk) => { - it("Successful posts on the consumer's PostIt pallet", async () => { + it("Successful posts on the consumer's PostIt pallet using by default the latest provider finalized block", async () => { const { consumerApi } = testConfig const postText = "Hello, world!" const config: DipSiblingProofInput = { @@ -231,44 +231,46 @@ describe("V0", () => { postEntry.isSome, "Post should successfully be stored on the chain", ).toBe(true) + }) - // Try again using an explicit block number, should yield the same result. - const newPostText = "Hello, world 2!" - const newConfig: DipSiblingProofInput = { - ...config, - providerBlockHeight: lastTestSetupProviderBlockNumber, - call: consumerApi.tx.postIt.post(newPostText).method as Call, + it("Successful posts on the consumer's PostIt pallet using the same block as before", async () => { + const { consumerApi } = testConfig + const postText = "Hello, world!" + const config: DipSiblingProofInput = { + ...testConfig, + call: consumerApi.tx.postIt.post(postText).method as Call, + // Set explicit block number for the DIP proof + providerBlockHeight: lastTestSetupProviderBlockNumber } - const newCrossChainTx = - await DipSdk.generateDipAuthorizedTxForSibling(newConfig) - const { status: newStatus } = await signAndSubmitTx( + const crossChainTx = + await DipSdk.generateDipAuthorizedTxForSibling(config) + const { status } = await signAndSubmitTx( consumerApi, - newCrossChainTx, + crossChainTx, submitterKeypair, ) expect( - newStatus.isInBlock, + status.isInBlock, "Status of submitted tx should be in block.", ).toBe(true) - const newBlockHash = newStatus.asInBlock - const newBlockNumber = ( - await consumerApi.rpc.chain.getHeader(newBlockHash) - ).number + const blockHash = status.asInBlock + const blockNumber = (await consumerApi.rpc.chain.getHeader(blockHash)) + .number // The example PostIt pallet generates the storage key for a post by hashing (block number, submitter's username, content of the post). - const newPostKey = blake2AsHex( + const postKey = blake2AsHex( consumerApi .createType(`(BlockNumber, ${web3NameRuntimeType}, Bytes)`, [ - newBlockNumber, + blockNumber, web3Name, - newPostText, + postText, ]) .toHex(), ) - const newPostEntry = - await consumerApi.query.postIt.posts>(newPostKey) + const postEntry = + await consumerApi.query.postIt.posts>(postKey) expect( - newPostEntry.isSome, + postEntry.isSome, "Post should successfully be stored on the chain", ).toBe(true) }) From bd648277531c249126fddafb997e10642a149b75 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Thu, 30 Nov 2023 13:35:59 +0100 Subject: [PATCH 19/22] Fix lints --- .env.test | 3 - .github/workflows/build.yaml | 36 +++ .gitignore | 2 +- .yarn/versions/06802af5.yml | 2 + tests/sibling.test.ts | 2 +- yarn.lock | 462 +---------------------------------- 6 files changed, 52 insertions(+), 455 deletions(-) delete mode 100644 .env.test create mode 100644 .github/workflows/build.yaml create mode 100644 .yarn/versions/06802af5.yml diff --git a/.env.test b/.env.test deleted file mode 100644 index 4643dca..0000000 --- a/.env.test +++ /dev/null @@ -1,3 +0,0 @@ -RELAY_ADDRESS="ws://127.0.0.1:32835" -PROVIDER_ADDRESS="ws://127.0.0.1:41115" -CONSUMER_ADDRESS="ws://127.0.0.1:35167" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..ce6a852 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,36 @@ +name: Lint and Build + +on: + push: + branches: + - "main" + paths: + - "**.ts" + pull_request: + branches: + - "**" + +jobs: + lint-and-build: + runs-on: ubuntu-latest + + steps: + - name: Download source + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: ".nvmrc" + cache: "yarn" + - name: Install dependencies + run: yarn install + - name: Lint + run: yarn lint + - name: Check dependency duplication + run: if ! yarn dedupe --check; then echo "::warning ::Dependencies may be deduplicated"; fi; + - name: Check versioning + run: yarn version check + - name: Try build for CJS and ESM + run: yarn build diff --git a/.gitignore b/.gitignore index 941f726..48cc42d 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,4 @@ cjs .vscode # Tests -.env +.env.* diff --git a/.yarn/versions/06802af5.yml b/.yarn/versions/06802af5.yml new file mode 100644 index 0000000..80749ae --- /dev/null +++ b/.yarn/versions/06802af5.yml @@ -0,0 +1,2 @@ +declined: + - "@kiltprotocol/dip-sdk" diff --git a/tests/sibling.test.ts b/tests/sibling.test.ts index 0d8028d..3f32755 100644 --- a/tests/sibling.test.ts +++ b/tests/sibling.test.ts @@ -240,7 +240,7 @@ describe("V0", () => { ...testConfig, call: consumerApi.tx.postIt.post(postText).method as Call, // Set explicit block number for the DIP proof - providerBlockHeight: lastTestSetupProviderBlockNumber + providerBlockHeight: lastTestSetupProviderBlockNumber, } const crossChainTx = diff --git a/yarn.lock b/yarn.lock index 385f8cd..8e3a9b9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -537,21 +537,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/api-augment@npm:10.10.1": - version: 10.10.1 - resolution: "@polkadot/api-augment@npm:10.10.1" - dependencies: - "@polkadot/api-base": 10.10.1 - "@polkadot/rpc-augment": 10.10.1 - "@polkadot/types": 10.10.1 - "@polkadot/types-augment": 10.10.1 - "@polkadot/types-codec": 10.10.1 - "@polkadot/util": ^12.5.1 - tslib: ^2.6.2 - checksum: 16ca2d71215019faba506b6dc455ef15ea1eec8b97bd146aef49a04ae15dc9246405540219bfbea36027ee50c5dbb15885296c30ee98908afdd7a56626efd06c - languageName: node - linkType: hard - "@polkadot/api-augment@npm:10.11.1": version: 10.11.1 resolution: "@polkadot/api-augment@npm:10.11.1" @@ -567,19 +552,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/api-base@npm:10.10.1": - version: 10.10.1 - resolution: "@polkadot/api-base@npm:10.10.1" - dependencies: - "@polkadot/rpc-core": 10.10.1 - "@polkadot/types": 10.10.1 - "@polkadot/util": ^12.5.1 - rxjs: ^7.8.1 - tslib: ^2.6.2 - checksum: 374a4378484817b29c52908a9dac649b4d4f231db21a0b0b3d3ec3331c7b9b9c374c103b5e64d028c212b8ab3eb98244cd760d20e2fe5f46a8fdc1d923555047 - languageName: node - linkType: hard - "@polkadot/api-base@npm:10.11.1": version: 10.11.1 resolution: "@polkadot/api-base@npm:10.11.1" @@ -593,24 +565,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/api-derive@npm:10.10.1": - version: 10.10.1 - resolution: "@polkadot/api-derive@npm:10.10.1" - dependencies: - "@polkadot/api": 10.10.1 - "@polkadot/api-augment": 10.10.1 - "@polkadot/api-base": 10.10.1 - "@polkadot/rpc-core": 10.10.1 - "@polkadot/types": 10.10.1 - "@polkadot/types-codec": 10.10.1 - "@polkadot/util": ^12.5.1 - "@polkadot/util-crypto": ^12.5.1 - rxjs: ^7.8.1 - tslib: ^2.6.2 - checksum: ff0f016d39aa73f55a881927e6ae3dd75c2a81fe4095cdda5e558f420d815a12c204e6a2082acbef2c74867b810d41ef349de2b7924d46957be7260b71fb1512 - languageName: node - linkType: hard - "@polkadot/api-derive@npm:10.11.1": version: 10.11.1 resolution: "@polkadot/api-derive@npm:10.11.1" @@ -629,32 +583,7 @@ __metadata: languageName: node linkType: hard -"@polkadot/api@npm:10.10.1, @polkadot/api@npm:^10.10.1, @polkadot/api@npm:^10.4.0": - version: 10.10.1 - resolution: "@polkadot/api@npm:10.10.1" - dependencies: - "@polkadot/api-augment": 10.10.1 - "@polkadot/api-base": 10.10.1 - "@polkadot/api-derive": 10.10.1 - "@polkadot/keyring": ^12.5.1 - "@polkadot/rpc-augment": 10.10.1 - "@polkadot/rpc-core": 10.10.1 - "@polkadot/rpc-provider": 10.10.1 - "@polkadot/types": 10.10.1 - "@polkadot/types-augment": 10.10.1 - "@polkadot/types-codec": 10.10.1 - "@polkadot/types-create": 10.10.1 - "@polkadot/types-known": 10.10.1 - "@polkadot/util": ^12.5.1 - "@polkadot/util-crypto": ^12.5.1 - eventemitter3: ^5.0.1 - rxjs: ^7.8.1 - tslib: ^2.6.2 - checksum: de1aa727b63fb921854840fe2d18b55b99f512f4d3e08d3b895fceea7891f6dd0febe6aa5fb7b1778494c78d6a6a7ebd17d426ba2e3df459aa974b7bb8fee19c - languageName: node - linkType: hard - -"@polkadot/api@npm:10.11.1, @polkadot/api@npm:^10.11.1": +"@polkadot/api@npm:10.11.1, @polkadot/api@npm:^10.10.1, @polkadot/api@npm:^10.11.1, @polkadot/api@npm:^10.4.0": version: 10.11.1 resolution: "@polkadot/api@npm:10.11.1" dependencies: @@ -679,21 +608,7 @@ __metadata: languageName: node linkType: hard -"@polkadot/keyring@npm:^12.0.0, @polkadot/keyring@npm:^12.5.1": - version: 12.5.1 - resolution: "@polkadot/keyring@npm:12.5.1" - dependencies: - "@polkadot/util": 12.5.1 - "@polkadot/util-crypto": 12.5.1 - tslib: ^2.6.2 - peerDependencies: - "@polkadot/util": 12.5.1 - "@polkadot/util-crypto": 12.5.1 - checksum: d659e5980e4cd6b68f91448a817306666530c033410c713854547dbbbecacb7362346c3ada6c5ab9dc71437c3cf002f064d7db40d1588637b96e84ff8f35dcf4 - languageName: node - linkType: hard - -"@polkadot/keyring@npm:^12.6.1": +"@polkadot/keyring@npm:^12.0.0, @polkadot/keyring@npm:^12.6.1": version: 12.6.1 resolution: "@polkadot/keyring@npm:12.6.1" dependencies: @@ -707,17 +622,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/networks@npm:12.5.1, @polkadot/networks@npm:^12.5.1": - version: 12.5.1 - resolution: "@polkadot/networks@npm:12.5.1" - dependencies: - "@polkadot/util": 12.5.1 - "@substrate/ss58-registry": ^1.43.0 - tslib: ^2.6.2 - checksum: f8c64684f6806365c1aded6ebca52432050cc8caacd067faf339b2f37497b63b13cebb689f7b0f9c62a890566383cf1931552da82815cc52baa2166fb1772a43 - languageName: node - linkType: hard - "@polkadot/networks@npm:12.6.1, @polkadot/networks@npm:^12.6.1": version: 12.6.1 resolution: "@polkadot/networks@npm:12.6.1" @@ -729,19 +633,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/rpc-augment@npm:10.10.1": - version: 10.10.1 - resolution: "@polkadot/rpc-augment@npm:10.10.1" - dependencies: - "@polkadot/rpc-core": 10.10.1 - "@polkadot/types": 10.10.1 - "@polkadot/types-codec": 10.10.1 - "@polkadot/util": ^12.5.1 - tslib: ^2.6.2 - checksum: d19ff447fea298387e8af9b7ac44c8eb8438b0e939608414c0ddc642fbd5c2d657d199a66741d9e330f28aa587486a163238cdf058cc69994178b121a0d26738 - languageName: node - linkType: hard - "@polkadot/rpc-augment@npm:10.11.1": version: 10.11.1 resolution: "@polkadot/rpc-augment@npm:10.11.1" @@ -755,20 +646,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/rpc-core@npm:10.10.1": - version: 10.10.1 - resolution: "@polkadot/rpc-core@npm:10.10.1" - dependencies: - "@polkadot/rpc-augment": 10.10.1 - "@polkadot/rpc-provider": 10.10.1 - "@polkadot/types": 10.10.1 - "@polkadot/util": ^12.5.1 - rxjs: ^7.8.1 - tslib: ^2.6.2 - checksum: 5ab21029fbafa13e50bb48161a82c023f7015b633e258b76c2cff25bf648d7f69baf18efc291ebec8dd635b38da8223e853e15b53478268b1f6b40d2ab0b3e09 - languageName: node - linkType: hard - "@polkadot/rpc-core@npm:10.11.1": version: 10.11.1 resolution: "@polkadot/rpc-core@npm:10.11.1" @@ -783,30 +660,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/rpc-provider@npm:10.10.1": - version: 10.10.1 - resolution: "@polkadot/rpc-provider@npm:10.10.1" - dependencies: - "@polkadot/keyring": ^12.5.1 - "@polkadot/types": 10.10.1 - "@polkadot/types-support": 10.10.1 - "@polkadot/util": ^12.5.1 - "@polkadot/util-crypto": ^12.5.1 - "@polkadot/x-fetch": ^12.5.1 - "@polkadot/x-global": ^12.5.1 - "@polkadot/x-ws": ^12.5.1 - "@substrate/connect": 0.7.33 - eventemitter3: ^5.0.1 - mock-socket: ^9.3.1 - nock: ^13.3.4 - tslib: ^2.6.2 - dependenciesMeta: - "@substrate/connect": - optional: true - checksum: 44147ad7ce4bb0fccf5272bbe56b3b65c1e907f02109c8e18a5b5da8c658f84c1d7741c5e6878adacd06514254b0a7fb8254d5a222f55f25f7a573b2ba970449 - languageName: node - linkType: hard - "@polkadot/rpc-provider@npm:10.11.1": version: 10.11.1 resolution: "@polkadot/rpc-provider@npm:10.11.1" @@ -831,18 +684,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/types-augment@npm:10.10.1": - version: 10.10.1 - resolution: "@polkadot/types-augment@npm:10.10.1" - dependencies: - "@polkadot/types": 10.10.1 - "@polkadot/types-codec": 10.10.1 - "@polkadot/util": ^12.5.1 - tslib: ^2.6.2 - checksum: 40440fc2a9568c9e636f478c4f191cbb38f07256f4db7f1bb9bdbcf0b928280315afee2843090a006a3dfd16e000f22dd6a9bd5687dd6400a1fc3dcd6ee59a25 - languageName: node - linkType: hard - "@polkadot/types-augment@npm:10.11.1": version: 10.11.1 resolution: "@polkadot/types-augment@npm:10.11.1" @@ -855,18 +696,7 @@ __metadata: languageName: node linkType: hard -"@polkadot/types-codec@npm:10.10.1, @polkadot/types-codec@npm:^10.4.0": - version: 10.10.1 - resolution: "@polkadot/types-codec@npm:10.10.1" - dependencies: - "@polkadot/util": ^12.5.1 - "@polkadot/x-bigint": ^12.5.1 - tslib: ^2.6.2 - checksum: 17ceb561e6a82784febd5c8b0219050a9b8aeeb766ffbae8255ab586120063ca9fea1c89df776047e861aba87e43048a8060d5c469bcd42c169830a69416d62f - languageName: node - linkType: hard - -"@polkadot/types-codec@npm:10.11.1": +"@polkadot/types-codec@npm:10.11.1, @polkadot/types-codec@npm:^10.4.0": version: 10.11.1 resolution: "@polkadot/types-codec@npm:10.11.1" dependencies: @@ -877,17 +707,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/types-create@npm:10.10.1": - version: 10.10.1 - resolution: "@polkadot/types-create@npm:10.10.1" - dependencies: - "@polkadot/types-codec": 10.10.1 - "@polkadot/util": ^12.5.1 - tslib: ^2.6.2 - checksum: 1dedef441218a0786774033c2d587b8ccdf184a72da671c7da70ced9f765073bfec4a15d8937b00d5d50cb0eb1b4bd25886ace3f7e024c95b46f58a1c318efd1 - languageName: node - linkType: hard - "@polkadot/types-create@npm:10.11.1": version: 10.11.1 resolution: "@polkadot/types-create@npm:10.11.1" @@ -899,20 +718,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/types-known@npm:10.10.1": - version: 10.10.1 - resolution: "@polkadot/types-known@npm:10.10.1" - dependencies: - "@polkadot/networks": ^12.5.1 - "@polkadot/types": 10.10.1 - "@polkadot/types-codec": 10.10.1 - "@polkadot/types-create": 10.10.1 - "@polkadot/util": ^12.5.1 - tslib: ^2.6.2 - checksum: 25489967fcd6022f11a64c20884dd1ef49494f3b3e514034a08cc07f61267121adf8b96b307edc3381c445de58842d515aa8440ee888bc37120775deffae671a - languageName: node - linkType: hard - "@polkadot/types-known@npm:10.11.1": version: 10.11.1 resolution: "@polkadot/types-known@npm:10.11.1" @@ -927,16 +732,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/types-support@npm:10.10.1": - version: 10.10.1 - resolution: "@polkadot/types-support@npm:10.10.1" - dependencies: - "@polkadot/util": ^12.5.1 - tslib: ^2.6.2 - checksum: 391857f39463fcc9bbc34a6bafd191e12eb3fd28f386d4094cc3cdcbcd0fcc8799c6e99a49b0e634c6a1b78d07188eb6e1e01299f55df2593c3f30fcb241631c - languageName: node - linkType: hard - "@polkadot/types-support@npm:10.11.1": version: 10.11.1 resolution: "@polkadot/types-support@npm:10.11.1" @@ -947,23 +742,7 @@ __metadata: languageName: node linkType: hard -"@polkadot/types@npm:10.10.1, @polkadot/types@npm:^10.4.0": - version: 10.10.1 - resolution: "@polkadot/types@npm:10.10.1" - dependencies: - "@polkadot/keyring": ^12.5.1 - "@polkadot/types-augment": 10.10.1 - "@polkadot/types-codec": 10.10.1 - "@polkadot/types-create": 10.10.1 - "@polkadot/util": ^12.5.1 - "@polkadot/util-crypto": ^12.5.1 - rxjs: ^7.8.1 - tslib: ^2.6.2 - checksum: 58b8b026e25f8156f270bdd240a2e384b64db93a6abe7c15abe9acdc2ce06a724328a8bf4d5b3047f5e398eef3d4961447d8511c52105c082dddd1b9d8fb0cb4 - languageName: node - linkType: hard - -"@polkadot/types@npm:10.11.1": +"@polkadot/types@npm:10.11.1, @polkadot/types@npm:^10.4.0": version: 10.11.1 resolution: "@polkadot/types@npm:10.11.1" dependencies: @@ -979,27 +758,7 @@ __metadata: languageName: node linkType: hard -"@polkadot/util-crypto@npm:12.5.1, @polkadot/util-crypto@npm:^12.0.0, @polkadot/util-crypto@npm:^12.5.1": - version: 12.5.1 - resolution: "@polkadot/util-crypto@npm:12.5.1" - dependencies: - "@noble/curves": ^1.2.0 - "@noble/hashes": ^1.3.2 - "@polkadot/networks": 12.5.1 - "@polkadot/util": 12.5.1 - "@polkadot/wasm-crypto": ^7.2.2 - "@polkadot/wasm-util": ^7.2.2 - "@polkadot/x-bigint": 12.5.1 - "@polkadot/x-randomvalues": 12.5.1 - "@scure/base": ^1.1.3 - tslib: ^2.6.2 - peerDependencies: - "@polkadot/util": 12.5.1 - checksum: 4efb5ca6e48f7457d8dcfa02ac9f581ce23a90ba9e72c8f6fd7649296e92dcb3dfa3d2bdd0b5ed68b81bf15e32aabef34f60d47851249d8859dba7ebeb63501f - languageName: node - linkType: hard - -"@polkadot/util-crypto@npm:12.6.1, @polkadot/util-crypto@npm:^12.6.1": +"@polkadot/util-crypto@npm:12.6.1, @polkadot/util-crypto@npm:^12.0.0, @polkadot/util-crypto@npm:^12.6.1": version: 12.6.1 resolution: "@polkadot/util-crypto@npm:12.6.1" dependencies: @@ -1019,22 +778,7 @@ __metadata: languageName: node linkType: hard -"@polkadot/util@npm:12.5.1, @polkadot/util@npm:^12.0.0, @polkadot/util@npm:^12.5.1": - version: 12.5.1 - resolution: "@polkadot/util@npm:12.5.1" - dependencies: - "@polkadot/x-bigint": 12.5.1 - "@polkadot/x-global": 12.5.1 - "@polkadot/x-textdecoder": 12.5.1 - "@polkadot/x-textencoder": 12.5.1 - "@types/bn.js": ^5.1.1 - bn.js: ^5.2.1 - tslib: ^2.6.2 - checksum: 955d41c01cb3c7da72c4f5f8faed13e1af1fa9603a3a1dd9f282eb69b5ebbffb889e76c595d1252ff5f9665cb3c55f1a96f908b020dc79356f92b2d5ce1aa81e - languageName: node - linkType: hard - -"@polkadot/util@npm:12.6.1, @polkadot/util@npm:^12.6.1": +"@polkadot/util@npm:12.6.1, @polkadot/util@npm:^12.0.0, @polkadot/util@npm:^12.5.1, @polkadot/util@npm:^12.6.1": version: 12.6.1 resolution: "@polkadot/util@npm:12.6.1" dependencies: @@ -1049,19 +793,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/wasm-bridge@npm:7.2.2": - version: 7.2.2 - resolution: "@polkadot/wasm-bridge@npm:7.2.2" - dependencies: - "@polkadot/wasm-util": 7.2.2 - tslib: ^2.6.1 - peerDependencies: - "@polkadot/util": "*" - "@polkadot/x-randomvalues": "*" - checksum: b998b21bca963699c2958de0558bad83d19ca72922b7ca74beb99b8c418bdc4be7af86f7ea231b3224de55eb8ec59e0626642d393fc90192659cccaf346d5d2b - languageName: node - linkType: hard - "@polkadot/wasm-bridge@npm:7.3.1": version: 7.3.1 resolution: "@polkadot/wasm-bridge@npm:7.3.1" @@ -1075,17 +806,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/wasm-crypto-asmjs@npm:7.2.2": - version: 7.2.2 - resolution: "@polkadot/wasm-crypto-asmjs@npm:7.2.2" - dependencies: - tslib: ^2.6.1 - peerDependencies: - "@polkadot/util": "*" - checksum: 2eba52949b51adfa1e8183d406f40b935cdea1a3189994529febd9db4f1abf5f853782e2c15dad7ab0f2dd8641b3dbf40b221c0462b6a29ac11c38e8a70a8a5b - languageName: node - linkType: hard - "@polkadot/wasm-crypto-asmjs@npm:7.3.1": version: 7.3.1 resolution: "@polkadot/wasm-crypto-asmjs@npm:7.3.1" @@ -1097,22 +817,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/wasm-crypto-init@npm:7.2.2": - version: 7.2.2 - resolution: "@polkadot/wasm-crypto-init@npm:7.2.2" - dependencies: - "@polkadot/wasm-bridge": 7.2.2 - "@polkadot/wasm-crypto-asmjs": 7.2.2 - "@polkadot/wasm-crypto-wasm": 7.2.2 - "@polkadot/wasm-util": 7.2.2 - tslib: ^2.6.1 - peerDependencies: - "@polkadot/util": "*" - "@polkadot/x-randomvalues": "*" - checksum: 75e4cc6cfecef13942397c0b0cbcd2ebf8534589b0a22104df6352908efbdc78e6fa42df3ce1660c1b267c8b7c40667a42c0d986a7a3bc4a2b9ea17ba97608af - languageName: node - linkType: hard - "@polkadot/wasm-crypto-init@npm:7.3.1": version: 7.3.1 resolution: "@polkadot/wasm-crypto-init@npm:7.3.1" @@ -1129,18 +833,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/wasm-crypto-wasm@npm:7.2.2": - version: 7.2.2 - resolution: "@polkadot/wasm-crypto-wasm@npm:7.2.2" - dependencies: - "@polkadot/wasm-util": 7.2.2 - tslib: ^2.6.1 - peerDependencies: - "@polkadot/util": "*" - checksum: e3d0aeb59fb7e5d3d25a256ed57c4e05895e9d7e29cb22214d9b59ff6e400f25b0c5758f77a0513befd99ef33051b43bbff3d1def978e87668aa74f3f8799c0b - languageName: node - linkType: hard - "@polkadot/wasm-crypto-wasm@npm:7.3.1": version: 7.3.1 resolution: "@polkadot/wasm-crypto-wasm@npm:7.3.1" @@ -1153,23 +845,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/wasm-crypto@npm:^7.2.2": - version: 7.2.2 - resolution: "@polkadot/wasm-crypto@npm:7.2.2" - dependencies: - "@polkadot/wasm-bridge": 7.2.2 - "@polkadot/wasm-crypto-asmjs": 7.2.2 - "@polkadot/wasm-crypto-init": 7.2.2 - "@polkadot/wasm-crypto-wasm": 7.2.2 - "@polkadot/wasm-util": 7.2.2 - tslib: ^2.6.1 - peerDependencies: - "@polkadot/util": "*" - "@polkadot/x-randomvalues": "*" - checksum: 25710154c1a25aea59a8cdba4cfe051249e83b86cbc0869be7b0680c86f2841131f7df76881d422fb4d179b9037320957e725bc50546e63273bc11b85751b5a6 - languageName: node - linkType: hard - "@polkadot/wasm-crypto@npm:^7.3.1": version: 7.3.1 resolution: "@polkadot/wasm-crypto@npm:7.3.1" @@ -1187,17 +862,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/wasm-util@npm:7.2.2, @polkadot/wasm-util@npm:^7.2.2": - version: 7.2.2 - resolution: "@polkadot/wasm-util@npm:7.2.2" - dependencies: - tslib: ^2.6.1 - peerDependencies: - "@polkadot/util": "*" - checksum: b1ad387e5b2726183e1c141ac59f9e6e722d9c1e896dbe0069fb5ce46d30c3517f07b36c840c1d82d23256e111a3697ba3015e53073858e8e05ab3d0cbdbf05e - languageName: node - linkType: hard - "@polkadot/wasm-util@npm:7.3.1, @polkadot/wasm-util@npm:^7.3.1": version: 7.3.1 resolution: "@polkadot/wasm-util@npm:7.3.1" @@ -1209,16 +873,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/x-bigint@npm:12.5.1, @polkadot/x-bigint@npm:^12.5.1": - version: 12.5.1 - resolution: "@polkadot/x-bigint@npm:12.5.1" - dependencies: - "@polkadot/x-global": 12.5.1 - tslib: ^2.6.2 - checksum: 295d00b17860196c43ac4957ffb052ca68bb4319990876238e3f0925ca6ca9106810204136315491116a11a277d8a1e1fae65cc43a168505ee5a69a27404d2e0 - languageName: node - linkType: hard - "@polkadot/x-bigint@npm:12.6.1, @polkadot/x-bigint@npm:^12.6.1": version: 12.6.1 resolution: "@polkadot/x-bigint@npm:12.6.1" @@ -1229,17 +883,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/x-fetch@npm:^12.5.1": - version: 12.5.1 - resolution: "@polkadot/x-fetch@npm:12.5.1" - dependencies: - "@polkadot/x-global": 12.5.1 - node-fetch: ^3.3.2 - tslib: ^2.6.2 - checksum: 26b24b09f9074c181f53f13ea17a1389e823b262a956a28fddf609ba7d177a1cde3cd4db28e8e38320b207adcc675ac868dadfaeafe9cf3998a3861f02ee43d7 - languageName: node - linkType: hard - "@polkadot/x-fetch@npm:^12.6.1": version: 12.6.1 resolution: "@polkadot/x-fetch@npm:12.6.1" @@ -1251,15 +894,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/x-global@npm:12.5.1, @polkadot/x-global@npm:^12.5.1": - version: 12.5.1 - resolution: "@polkadot/x-global@npm:12.5.1" - dependencies: - tslib: ^2.6.2 - checksum: d45e3d6096674b7495992c6e45cf1a284db545c16107ba9adae241d6aefe13c27adfaf93d58a3079e6a6b63acb221eb3181c7f55dc34124b24b542154724c506 - languageName: node - linkType: hard - "@polkadot/x-global@npm:12.6.1, @polkadot/x-global@npm:^12.6.1": version: 12.6.1 resolution: "@polkadot/x-global@npm:12.6.1" @@ -1269,19 +903,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/x-randomvalues@npm:12.5.1": - version: 12.5.1 - resolution: "@polkadot/x-randomvalues@npm:12.5.1" - dependencies: - "@polkadot/x-global": 12.5.1 - tslib: ^2.6.2 - peerDependencies: - "@polkadot/util": 12.5.1 - "@polkadot/wasm-util": "*" - checksum: 52ee4b4206a98cac9e97e3d194db01fb4a540046672784442926478eaa2b2a74cebae59d10432671f544d72df5d623aedf57c301bcf447a4c72688ec3cb82fd5 - languageName: node - linkType: hard - "@polkadot/x-randomvalues@npm:12.6.1": version: 12.6.1 resolution: "@polkadot/x-randomvalues@npm:12.6.1" @@ -1295,16 +916,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/x-textdecoder@npm:12.5.1": - version: 12.5.1 - resolution: "@polkadot/x-textdecoder@npm:12.5.1" - dependencies: - "@polkadot/x-global": 12.5.1 - tslib: ^2.6.2 - checksum: 202a9e216e9b89cc74012fa3f6c96eeb368dc3e6fa3c943f28c37c20941a6c678506cbc136946e9ff100123aa43846eab7765af074de94dfdd23f4ce2242c794 - languageName: node - linkType: hard - "@polkadot/x-textdecoder@npm:12.6.1": version: 12.6.1 resolution: "@polkadot/x-textdecoder@npm:12.6.1" @@ -1315,16 +926,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/x-textencoder@npm:12.5.1": - version: 12.5.1 - resolution: "@polkadot/x-textencoder@npm:12.5.1" - dependencies: - "@polkadot/x-global": 12.5.1 - tslib: ^2.6.2 - checksum: 7a8d99d203cbd9537e55405d737667ae8cd9ad40a9e3de52f2ef7580a23d27ebf7f7c52da4e0eca6ca34dc97aae33a97bab36afb54aaa7714f54a31931f94113 - languageName: node - linkType: hard - "@polkadot/x-textencoder@npm:12.6.1": version: 12.6.1 resolution: "@polkadot/x-textencoder@npm:12.6.1" @@ -1335,17 +936,6 @@ __metadata: languageName: node linkType: hard -"@polkadot/x-ws@npm:^12.5.1": - version: 12.5.1 - resolution: "@polkadot/x-ws@npm:12.5.1" - dependencies: - "@polkadot/x-global": 12.5.1 - tslib: ^2.6.2 - ws: ^8.14.1 - checksum: 839e82ab4bf013d17a356e2f10a42ba2ecf88f4e432985241e785416aeb6434c0e7c897b09aeeab23f5d27b27ef0dfe65eda85293c7a08f52d0774bb1b23704b - languageName: node - linkType: hard - "@polkadot/x-ws@npm:^12.6.1": version: 12.6.1 resolution: "@polkadot/x-ws@npm:12.6.1" @@ -1451,16 +1041,6 @@ __metadata: languageName: node linkType: hard -"@substrate/connect@npm:0.7.33": - version: 0.7.33 - resolution: "@substrate/connect@npm:0.7.33" - dependencies: - "@substrate/connect-extension-protocol": ^1.0.1 - smoldot: 2.0.1 - checksum: b4cfb86bef46450b6635e7dbf1eb133603c6ad8c955046e72fc67aaf36b1fe5f2aeeb521f4b1ea0a1eea9ac4c49b0f6417c24eb1320e8da13cc0d3efd7ee4cd7 - languageName: node - linkType: hard - "@substrate/connect@npm:0.7.35": version: 0.7.35 resolution: "@substrate/connect@npm:0.7.35" @@ -1471,7 +1051,7 @@ __metadata: languageName: node linkType: hard -"@substrate/ss58-registry@npm:^1.43.0, @substrate/ss58-registry@npm:^1.44.0": +"@substrate/ss58-registry@npm:^1.44.0": version: 1.44.0 resolution: "@substrate/ss58-registry@npm:1.44.0" checksum: 130fafc337a60bf22b1c01b8bd4fdbc2606a00483961bd173224478adb358a17b865d287cf99a2a32cb430d23d3a7969fce0457e8302dc48a98e1f666c7f6e40 @@ -1513,7 +1093,7 @@ __metadata: languageName: node linkType: hard -"@types/bn.js@npm:^5.1.1, @types/bn.js@npm:^5.1.5": +"@types/bn.js@npm:^5.1.5": version: 5.1.5 resolution: "@types/bn.js@npm:5.1.5" dependencies: @@ -1559,16 +1139,7 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*": - version: 20.9.0 - resolution: "@types/node@npm:20.9.0" - dependencies: - undici-types: ~5.26.4 - checksum: bfd927da6bff8a32051fa44bb47ca32a56d2c8bc8ba0170770f181cc1fa3c0b05863c9b930f0ba8604a48d5eb0d319166601709ca53bf2deae0025d8b6c6b8a3 - languageName: node - linkType: hard - -"@types/node@npm:>=13.7.0, @types/node@npm:^20.9.4": +"@types/node@npm:*, @types/node@npm:>=13.7.0, @types/node@npm:^20.9.4": version: 20.9.4 resolution: "@types/node@npm:20.9.4" dependencies: @@ -4451,7 +4022,7 @@ __metadata: languageName: node linkType: hard -"nock@npm:^13.3.4, nock@npm:^13.3.8": +"nock@npm:^13.3.8": version: 13.3.8 resolution: "nock@npm:13.3.8" dependencies: @@ -5252,15 +4823,6 @@ __metadata: languageName: node linkType: hard -"smoldot@npm:2.0.1": - version: 2.0.1 - resolution: "smoldot@npm:2.0.1" - dependencies: - ws: ^8.8.1 - checksum: 77c1f541d039fe740157e9b81e2b13fc72dabe3ffd75644ee9958aee48d5c5458b6cc974d1e9233b1bcf3fde7af42a53a0e48452b6657405c64158a0c8168eee - languageName: node - linkType: hard - "smoldot@npm:2.0.7": version: 2.0.7 resolution: "smoldot@npm:2.0.7" @@ -5679,7 +5241,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.1.0, tslib@npm:^2.6.1, tslib@npm:^2.6.2": +"tslib@npm:^2.1.0, tslib@npm:^2.6.2": version: 2.6.2 resolution: "tslib@npm:2.6.2" checksum: 329ea56123005922f39642318e3d1f0f8265d1e7fcb92c633e0809521da75eeaca28d2cf96d7248229deb40e5c19adf408259f4b9640afd20d13aecc1430f3ad @@ -6162,7 +5724,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^8.13.0, ws@npm:^8.14.1, ws@npm:^8.14.2, ws@npm:^8.8.1": +"ws@npm:^8.13.0, ws@npm:^8.14.2, ws@npm:^8.8.1": version: 8.14.2 resolution: "ws@npm:8.14.2" peerDependencies: From afc7624dfabb216f13ff653fbbdb1562ea3fa092 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Thu, 30 Nov 2023 15:50:20 +0100 Subject: [PATCH 20/22] Address PR comments --- package.json | 2 +- src/index.ts | 1 + src/runtime.ts | 31 +++++++++++++++++++++++++++++++ src/utils.ts | 4 ++-- tests/utils.ts | 25 +++++-------------------- 5 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 src/runtime.ts diff --git a/package.json b/package.json index 22efc7b..eddd555 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "lint": "eslint --ext .ts . && prettier -c .", "lint:fix": "prettier -w . && eslint --fix --ext .ts .", "prepublish": "yarn exec cp -f ../../LICENSE .", - "publish": "yarn npm publish --access=public --tolerate-republish", + "publish": "yarn npm publish --access=public", "test:e2e": "yarn build && vitest run tests", "test:e2e:deploy": "yarn zombienet --spawn-concurrency 3 spawn tests/zombienet/network.toml" }, diff --git a/src/index.ts b/src/index.ts index 5c9216c..d86a3ec 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,5 +9,6 @@ * @module @kiltprotocol/dip-sdk */ +export * from "./runtime.js" export * from "./sibling.js" export * from "./utils.js" diff --git a/src/runtime.ts b/src/runtime.ts new file mode 100644 index 0000000..ce78e70 --- /dev/null +++ b/src/runtime.ts @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2023, BOTLabs GmbH. + * + * This source code is licensed under the BSD 4-Clause "Original" license + * found in the LICENSE file in the root directory of this source tree. + */ + +import type { + DefinitionsCall, +} from "@polkadot/types/types" + +export const dipProviderCalls: DefinitionsCall = { + DipProvider: [ + { + methods: { + generate_proof: { + description: + "Generate a Merkle proof for the DIP protocol for the specified request parameters.", + params: [ + { + name: "request", + type: "DipProofRequest", + }, + ], + type: "Result", + }, + }, + version: 1, + }, + ], +} diff --git a/src/utils.ts b/src/utils.ts index 30ddf58..4b99bfc 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -183,7 +183,7 @@ export async function generateDipIdentityProof({ // TODO: Better way to cast this? const okProof = proof.asOk.toJSON() as any - return { ...okProof } + return okProof } type DipDidSignatureProviderOpts = { @@ -245,7 +245,7 @@ export async function generateDipDidSignature({ }, }: DipDidSignatureOpts): Promise { const blockNumber: number = - blockHeight ?? ((await api.query.system.number()) as any).toNumber() + blockHeight ?? (await api.query.system.number()).toNumber() const genesis = genesisHash ?? (await api.query.system.blockHash(0)) const identityDetails = ( await api.query.dipConsumer.identityEntries>(toChain(didUri)) diff --git a/tests/utils.ts b/tests/utils.ts index 2e57aaf..97f6d3f 100644 --- a/tests/utils.ts +++ b/tests/utils.ts @@ -18,25 +18,10 @@ import type { RegistryTypes, } from "@polkadot/types/types" -const dipProviderCalls: DefinitionsCall = { - DipProvider: [ - { - methods: { - generate_proof: { - description: - "Generate a Merkle proof for the DIP protocol for the specified request parameters.", - params: [ - { - name: "request", - type: "DipProofRequest", - }, - ], - type: "Result", - }, - }, - version: 1, - }, - ], +import { dipProviderCalls } from "../src/runtime.js" + +const dipProviderTemplateRuntimeCalls: DefinitionsCall = { + ...dipProviderCalls, ...didCalls, } const dipTypes: RegistryTypes = { @@ -116,7 +101,7 @@ const dipTypes: RegistryTypes = { export async function createProviderApi(address: string): Promise { return ApiPromise.create({ provider: new WsProvider(address), - runtime: dipProviderCalls, + runtime: dipProviderTemplateRuntimeCalls, types: dipTypes, }) } From a5441f38f59fd81ed45b49d16e271858fb91bd3a Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Thu, 30 Nov 2023 15:52:15 +0100 Subject: [PATCH 21/22] Lints --- src/runtime.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/runtime.ts b/src/runtime.ts index ce78e70..34ecd47 100644 --- a/src/runtime.ts +++ b/src/runtime.ts @@ -5,9 +5,7 @@ * found in the LICENSE file in the root directory of this source tree. */ -import type { - DefinitionsCall, -} from "@polkadot/types/types" +import type { DefinitionsCall } from "@polkadot/types/types" export const dipProviderCalls: DefinitionsCall = { DipProvider: [ From edd45b82bb1c6768b98935beebc6a042db725ecc Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Fri, 1 Dec 2023 17:41:56 +0100 Subject: [PATCH 22/22] Update checkout action to v4 --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ce6a852..5c8a120 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,7 +16,7 @@ jobs: steps: - name: Download source - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Node.js