From cd6edc0e2f7eefb6ae488a45500b6b830df43abf Mon Sep 17 00:00:00 2001 From: Antonio Date: Tue, 19 Dec 2023 14:43:25 +0100 Subject: [PATCH] chore: add tests for Peregrine (#3) * Update zombienet/cli * Fixes * Last fixes * Last fixes * Lint fixes --- .gitignore | 3 - .yarn/versions/f6e39a6a.yml | 2 + README.md | 24 +- package.json | 14 +- src/sibling.ts | 7 +- src/utils.ts | 17 +- .../.env.develop.test | 6 + .../develop-zombienet.toml | 46 +++ .../develop.test.ts} | 58 +-- .../.env.develop.test | 6 + .../develop-zombienet.toml | 46 +++ .../develop.test.ts | 282 +++++++++++++ tests/zombienet/network.toml | 43 -- yarn.lock | 373 ++++++++---------- 14 files changed, 627 insertions(+), 300 deletions(-) create mode 100644 .yarn/versions/f6e39a6a.yml create mode 100644 tests/dip-provider-template-dip-consumer-template/.env.develop.test create mode 100644 tests/dip-provider-template-dip-consumer-template/develop-zombienet.toml rename tests/{sibling.test.ts => dip-provider-template-dip-consumer-template/develop.test.ts} (89%) create mode 100644 tests/peregrine-dip-consumer-template/.env.develop.test create mode 100644 tests/peregrine-dip-consumer-template/develop-zombienet.toml create mode 100644 tests/peregrine-dip-consumer-template/develop.test.ts delete mode 100644 tests/zombienet/network.toml diff --git a/.gitignore b/.gitignore index 48cc42d..c0bba76 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,3 @@ cjs # VSCode .vscode - -# Tests -.env.* diff --git a/.yarn/versions/f6e39a6a.yml b/.yarn/versions/f6e39a6a.yml new file mode 100644 index 0000000..80749ae --- /dev/null +++ b/.yarn/versions/f6e39a6a.yml @@ -0,0 +1,2 @@ +declined: + - "@kiltprotocol/dip-sdk" diff --git a/README.md b/README.md index ecd0079..bdd4861 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,26 @@ 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). +### Environment configuration + +The Zombienet deployment relies on a number of environment variables, which are: + +- `RELAY_IMAGE`: The Docker image for relaychain nodes. +- `RELAY_ALICE_RPC`: The RPC port for the `relay-alice` relaychain node. +- `PROVIDER_IMAGE`: The Docker image for the DIP provider nodes. +- `PROVIDER_ALICE_RPC`: The RPC port for the `provider-alice` provider node. +- `CONSUMER_IMAGE`: The Docker image for the DIP consumer nodes. +- `CONSUMER_ALICE_RPC`: The RPC port for the `consumer-alice` consumer node. + +A series of default values is sourced from either the `tests/dip-provider-template-dip-consumer-template/.env.develop.test` or `tests/peregrine-dip-consumer-template/.env.develop.test` file to spin up either a DIP Template Provider <-> DIP Template Consumer network or a Peregrine <-> DIP Template Consumer network. + ### 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, 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`. +1. Switch to the expected Node version with `nvm use`. +2. Install the repo dependencies with `yarn install`. +3. Set up the environment variables as explained above. +4. Spin up the Zombienet network with `test:e2e:start-network:peregrine-provider:develop` or `test:e2e:start-network:dip-template-provider:develop`. +5. In a new shell session, run the end-to-end tests with `yarn test:e2e:peregrine-provider` or `yarn test:e2e:dip-template-provider`. +6. [OPTIONAL] Tear down the network by killing the process started at step 4. diff --git a/package.json b/package.json index eddd555..9bc5492 100644 --- a/package.json +++ b/package.json @@ -2,17 +2,17 @@ "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-2", - "@kiltprotocol/types": "0.34.0-dip-2", + "@kiltprotocol/did": "0.34.1-rc.1", + "@kiltprotocol/types": "0.34.1-rc.1", "@polkadot/api": "^10.10.1", "@polkadot/util": "^12.5.1" }, "devDependencies": { - "@kiltprotocol/sdk-js": "0.34.0-dip-2", + "@kiltprotocol/sdk-js": "0.34.1-rc.1", "@types/node": "^20.9.4", "@typescript-eslint/eslint-plugin": "^6.2.0", "@typescript-eslint/parser": "^6.2.0", - "@zombienet/cli": "^1.3.82", + "@zombienet/cli": "^1.3.85", "bn.js": "^5.2.1", "dotenv": "^16.3.1", "eslint": "^8.45.0", @@ -52,8 +52,10 @@ "lint:fix": "prettier -w . && eslint --fix --ext .ts .", "prepublish": "yarn exec cp -f ../../LICENSE .", "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" + "test:e2e:peregrine-provider": "yarn build && vitest run tests/peregrine-dip-consumer-template", + "test:e2e:dip-template-provider": "yarn build && vitest run tests/dip-provider-template-dip-consumer-template", + "test:e2e:start-network:peregrine-provider:develop": "env $(cat tests/peregrine-dip-consumer-template/.env.develop.test | xargs) yarn zombienet spawn tests/peregrine-dip-consumer-template/develop-zombienet.toml", + "test:e2e:start-network:dip-template-provider:develop": "env $(cat tests/dip-provider-template-dip-consumer-template/.env.develop.test | xargs) yarn zombienet spawn tests/dip-provider-template-dip-consumer-template/develop-zombienet.toml" }, "stableVersion": "0.0.0", "type": "module", diff --git a/src/sibling.ts b/src/sibling.ts index 979ace0..77915e5 100644 --- a/src/sibling.ts +++ b/src/sibling.ts @@ -24,6 +24,7 @@ import type { SubmittableExtrinsic, DidKey, SignExtrinsicCallback, + BN, } from "@kiltprotocol/types" import type { KeyringPair } from "@polkadot/keyring/types" import type { Call, Hash } from "@polkadot/types/interfaces" @@ -40,9 +41,9 @@ export type DipSiblingProofInput = { submitterAddress: KeyringPair["address"] keyRelationship: VerificationKeyRelationship // Optional, retrieved from chain otherwise - blockHeight?: number + blockHeight?: BN genesisHash?: Hash - providerBlockHeight?: number + providerBlockHeight?: BN // With defaults accountIdRuntimeType?: string blockNumberRuntimeType?: string @@ -109,7 +110,7 @@ export async function generateDipAuthorizedTxForSibling({ // 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, + providerStateRootProofProviderBlockHeight.subn(1), ) const { diff --git a/src/utils.ts b/src/utils.ts index 4b99bfc..e9dde68 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -14,6 +14,7 @@ import type { DidKey, VerificationKeyRelationship, VerificationKeyType, + BN, } from "@kiltprotocol/types" import type { ApiPromise } from "@polkadot/api" import type { KeyringPair } from "@polkadot/keyring/types" @@ -33,12 +34,12 @@ type ProviderStateRootProofOpts = { providerApi: ApiPromise relayApi: ApiPromise // Optional - providerBlockHeight?: number + providerBlockHeight?: BN } type ProviderStateRootProofRes = { proof: ReadProof - providerBlockHeight: number - relayBlockHeight: number + providerBlockHeight: BN + relayBlockHeight: BN } /** * Generate a state proof that proofs the head of the specified parachain. @@ -66,7 +67,7 @@ export async function generateProviderStateRootProof({ await providerApi.rpc.chain.getFinalizedHead() const providerLastFinalizedBlockHeight = await providerApi.rpc.chain .getHeader(providerLastFinalizedBlockHash) - .then((h) => h.number.toNumber()) + .then((h) => h.number.toBn()) return [providerLastFinalizedBlockHeight, providerLastFinalizedBlockHash] })() const providerApiAtBlock = await providerApi.at(providerBlockHash) @@ -199,7 +200,7 @@ type DipDidSignatureConsumerOpts = { identityDetailsRuntimeType: string submitterAddress: KeyringPair["address"] // Optional - blockHeight?: number + blockHeight?: BN genesisHash?: Hash } type DipDidSignatureOpts = { @@ -207,7 +208,7 @@ type DipDidSignatureOpts = { provider: DipDidSignatureProviderOpts } type DipDidSignatureRes = { - blockNumber: number + blockNumber: BN signature: Uint8Array type: VerificationKeyType } @@ -244,8 +245,8 @@ export async function generateDipDidSignature({ genesisHash, }, }: DipDidSignatureOpts): Promise { - const blockNumber: number = - blockHeight ?? (await api.query.system.number()).toNumber() + const blockNumber: BN = + blockHeight ?? (await api.query.system.number()).toBn() const genesis = genesisHash ?? (await api.query.system.blockHash(0)) const identityDetails = ( await api.query.dipConsumer.identityEntries>(toChain(didUri)) diff --git a/tests/dip-provider-template-dip-consumer-template/.env.develop.test b/tests/dip-provider-template-dip-consumer-template/.env.develop.test new file mode 100644 index 0000000..1fd81e4 --- /dev/null +++ b/tests/dip-provider-template-dip-consumer-template/.env.develop.test @@ -0,0 +1,6 @@ +RELAY_IMAGE=parity/polkadot:v1.0.0 +RELAY_ALICE_RPC=20001 +PROVIDER_IMAGE=kiltprotocol/dip-provider-node-template:latest-develop +PROVIDER_ALICE_RPC=20011 +CONSUMER_IMAGE=kiltprotocol/dip-consumer-node-template:latest-develop +CONSUMER_ALICE_RPC=20021 diff --git a/tests/dip-provider-template-dip-consumer-template/develop-zombienet.toml b/tests/dip-provider-template-dip-consumer-template/develop-zombienet.toml new file mode 100644 index 0000000..ea4c8fc --- /dev/null +++ b/tests/dip-provider-template-dip-consumer-template/develop-zombienet.toml @@ -0,0 +1,46 @@ +[settings] +enable_tracing = false +provider = "kubernetes" +# 18000 seconds -> 300 minutes -> 5 hours +timeout = 18000 + +# Env variables: +# * RELAY_IMAGE: Docker image for relaychain nodes +# * RELAY_ALICE_RPC: RPC port for the `relay-alice` relaychain node +# * PROVIDER_IMAGE: Docker image for the DIP provider nodes +# * PROVIDER_ALICE_RPC: RPC port for the `provider-alice` provider node +# * CONSUMER_IMAGE: Docker image for the DIP consumer nodes +# * CONSUMER_ALICE_RPC: RPC port for the `consumer-alice` consumer node + +[relaychain] +chain = "rococo-local" +default_image = "{{RELAY_IMAGE}}" +default_substrate_cli_args_version = 1 + +[[relaychain.nodes]] +name = "relay-alice" +rpc_port = "{{RELAY_ALICE_RPC}}" + +[[relaychain.nodes]] +name = "relay-bob" + +[[relaychain.nodes]] +name = "relay-charlie" + +[[parachains]] +id = 2000 + +[parachains.collator] +command = "node-executable" +name = "provider-alice" +image = "{{PROVIDER_IMAGE}}" +rpc_port = "{{PROVIDER_ALICE_RPC}}" + +[[parachains]] +id = 2001 + +[parachains.collator] +command = "node-executable" +name = "consumer-alice" +image = "{{CONSUMER_IMAGE}}" +rpc_port = "{{CONSUMER_ALICE_RPC}}" diff --git a/tests/sibling.test.ts b/tests/dip-provider-template-dip-consumer-template/develop.test.ts similarity index 89% rename from tests/sibling.test.ts rename to tests/dip-provider-template-dip-consumer-template/develop.test.ts index 3f32755..60b5031 100644 --- a/tests/sibling.test.ts +++ b/tests/dip-provider-template-dip-consumer-template/develop.test.ts @@ -9,17 +9,11 @@ import { setTimeout } from "timers/promises" import * as Kilt from "@kiltprotocol/sdk-js" import { ApiPromise, WsProvider } from "@polkadot/api" +import { BN } from "@polkadot/util" import { blake2AsHex } from "@polkadot/util-crypto" -import { BN } from "bn.js" import dotenv from "dotenv" import { beforeAll, describe, it, expect } from "vitest" -import { - createProviderApi, - signAndSubmitTx, - withCrossModuleSystemImport, -} from "./utils.js" - import type { GetStoreTxSignCallback, Web3Name } from "@kiltprotocol/did" import type { DipSiblingProofInput } from "@kiltprotocol/dip-sdk" import type { @@ -31,7 +25,15 @@ import type { Option } from "@polkadot/types/codec" import type { Call } from "@polkadot/types/interfaces" import type { Codec } from "@polkadot/types/types" -dotenv.config({ path: ".env.test" }) +import { + createProviderApi, + signAndSubmitTx, + withCrossModuleSystemImport, +} from "../utils.js" + +dotenv.config({ + path: "tests/dip-provider-template-dip-consumer-template/.env.develop.test", +}) const baseConfig: Pick< DipSiblingProofInput, @@ -40,7 +42,7 @@ const baseConfig: Pick< | "identityDetailsRuntimeType" > = { accountIdRuntimeType: "AccountId32", - blockNumberRuntimeType: "u32", + blockNumberRuntimeType: "u64", identityDetailsRuntimeType: "Option", } const web3NameRuntimeType = "Text" @@ -52,9 +54,9 @@ const providerAndConsumerSudoKeypair = keyring.addFromUri("//Alice") Kilt.ConfigService.set({ submitTxResolveOn: Kilt.Blockchain.IS_IN_BLOCK }) -const relayAddress = process.env["RELAY_ADDRESS"] as string -const providerAddress = process.env["PROVIDER_ADDRESS"] as string -const consumerAddress = process.env["CONSUMER_ADDRESS"] as string +const relayAddress = `ws://127.0.0.1:${process.env["RELAY_ALICE_RPC"]}` +const providerAddress = `ws://127.0.0.1:${process.env["PROVIDER_ALICE_RPC"]}` +const consumerAddress = `ws://127.0.0.1:${process.env["CONSUMER_ALICE_RPC"]}` describe("V0", () => { // beforeAll @@ -87,7 +89,7 @@ describe("V0", () => { let did: DidDocument let web3Name: Web3Name let didKeypair: Kilt.KeyringPair - let lastTestSetupProviderBlockNumber: number + let lastTestSetupProviderBlockNumber: BN let testConfig: typeof v0Config & Pick< DipSiblingProofInput, @@ -104,13 +106,15 @@ describe("V0", () => { const newSubmitterKeypair = keyring.addFromMnemonic( Kilt.Utils.Crypto.mnemonicGenerate(), ) + const providerUnit = "0".repeat(13) + const consumerUnit = "0".repeat(13) const balanceTransferTxOnProviderChain = providerApi.tx.balances.transfer( newSubmitterKeypair.address, - 10 ** 15, + `1${providerUnit}`, ) const balanceTransferTxOnConsumerChain = consumerApi.tx.balances.transfer( newSubmitterKeypair.address, - 10 ** 15, + `1${consumerUnit}`, ) await Promise.all([ Kilt.Blockchain.signAndSubmitTx( @@ -168,7 +172,7 @@ describe("V0", () => { await setTimeout(12_000) lastTestSetupProviderBlockNumber = ( await providerApi.query.system.number() - ).toNumber() + ).toBn() const newFullDid = (await Kilt.Did.resolve(newFullDidUri)) ?.document as DidDocument submitterKeypair = newSubmitterKeypair @@ -218,11 +222,12 @@ describe("V0", () => { // 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, - ]) + .createType( + `(${ + config.blockNumberRuntimeType as string + }, ${web3NameRuntimeType}, Bytes)`, + [blockNumber, web3Name, postText], + ) .toHex(), ) const postEntry = @@ -260,11 +265,12 @@ describe("V0", () => { // 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, - ]) + .createType( + `(${ + config.blockNumberRuntimeType as string + }, ${web3NameRuntimeType}, Bytes)`, + [blockNumber, web3Name, postText], + ) .toHex(), ) const postEntry = diff --git a/tests/peregrine-dip-consumer-template/.env.develop.test b/tests/peregrine-dip-consumer-template/.env.develop.test new file mode 100644 index 0000000..c44b682 --- /dev/null +++ b/tests/peregrine-dip-consumer-template/.env.develop.test @@ -0,0 +1,6 @@ +RELAY_IMAGE=parity/polkadot:v1.0.0 +RELAY_ALICE_RPC=10001 +PROVIDER_IMAGE=kiltprotocol/kilt-node:latest-develop +PROVIDER_ALICE_RPC=10011 +CONSUMER_IMAGE=kiltprotocol/dip-consumer-node-template:latest-develop +CONSUMER_ALICE_RPC=10021 diff --git a/tests/peregrine-dip-consumer-template/develop-zombienet.toml b/tests/peregrine-dip-consumer-template/develop-zombienet.toml new file mode 100644 index 0000000..d470bb6 --- /dev/null +++ b/tests/peregrine-dip-consumer-template/develop-zombienet.toml @@ -0,0 +1,46 @@ +[settings] +enable_tracing = false +provider = "kubernetes" +# 18000 seconds -> 300 minutes -> 5 hours +timeout = 18000 + +# Env variables: +# * RELAY_IMAGE: Docker image for relaychain nodes +# * RELAY_ALICE_RPC: RPC port for the `relay-alice` relaychain node +# * PROVIDER_IMAGE: Docker image for the DIP provider nodes +# * PROVIDER_ALICE_RPC: RPC port for the `peregrine-alice` provider node +# * CONSUMER_IMAGE: Docker image for the DIP consumer nodes +# * CONSUMER_ALICE_RPC: RPC port for the `consumer-alice` consumer node + +[relaychain] +chain = "rococo-local" +default_image = "{{RELAY_IMAGE}}" +default_substrate_cli_args_version = 1 + +[[relaychain.nodes]] +name = "relay-alice" +rpc_port = "{{RELAY_ALICE_RPC}}" + +[[relaychain.nodes]] +name = "relay-bob" + +[[relaychain.nodes]] +name = "relay-charlie" + +[[parachains]] +id = 2000 + +[parachains.collator] +command = "node-executable" +name = "peregrine-alice" +image = "{{PROVIDER_IMAGE}}" +rpc_port = "{{PROVIDER_ALICE_RPC}}" + +[[parachains]] +id = 2001 + +[parachains.collator] +command = "node-executable" +name = "consumer-alice" +image = "{{CONSUMER_IMAGE}}" +rpc_port = "{{CONSUMER_ALICE_RPC}}" diff --git a/tests/peregrine-dip-consumer-template/develop.test.ts b/tests/peregrine-dip-consumer-template/develop.test.ts new file mode 100644 index 0000000..7cfd183 --- /dev/null +++ b/tests/peregrine-dip-consumer-template/develop.test.ts @@ -0,0 +1,282 @@ +/** + * 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 { setTimeout } from "timers/promises" + +import * as Kilt from "@kiltprotocol/sdk-js" +import { ApiPromise, WsProvider } from "@polkadot/api" +import { BN } from "@polkadot/util" +import { blake2AsHex } from "@polkadot/util-crypto" +import dotenv from "dotenv" +import { beforeAll, describe, it, expect } from "vitest" + +import type { GetStoreTxSignCallback, Web3Name } from "@kiltprotocol/did" +import type { DipSiblingProofInput } from "@kiltprotocol/dip-sdk" +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" + +import { signAndSubmitTx, withCrossModuleSystemImport } from "../utils.js" + +dotenv.config({ + path: "tests/peregrine-dip-consumer-template/.env.develop.test", +}) + +const baseConfig: Pick< + DipSiblingProofInput, + | "accountIdRuntimeType" + | "blockNumberRuntimeType" + | "identityDetailsRuntimeType" +> = { + accountIdRuntimeType: "AccountId32", + blockNumberRuntimeType: "u64", + identityDetailsRuntimeType: "Option", +} +const web3NameRuntimeType = "Text" +const keyring = new Kilt.Utils.Keyring({ + type: "sr25519", + ss58Format: Kilt.Utils.ss58Format, +}) +const providerAndConsumerSudoKeypair = keyring.addFromUri("//Alice") + +Kilt.ConfigService.set({ submitTxResolveOn: Kilt.Blockchain.IS_IN_BLOCK }) + +const relayAddress = `ws://127.0.0.1:${process.env["RELAY_ALICE_RPC"]}` +const providerAddress = `ws://127.0.0.1:${process.env["PROVIDER_ALICE_RPC"]}` +const consumerAddress = `ws://127.0.0.1:${process.env["CONSUMER_ALICE_RPC"]}` + +describe("V0", () => { + // beforeAll + let v0Config: typeof baseConfig & + Pick< + DipSiblingProofInput, + "consumerApi" | "proofVersion" | "providerApi" | "relayApi" + > + + beforeAll(async () => { + const [relayApi, providerApi, consumerApi] = await Promise.all([ + ApiPromise.create({ provider: new WsProvider(relayAddress) }), + Kilt.connect(providerAddress), + ApiPromise.create({ provider: new WsProvider(consumerAddress) }), + ]) + Kilt.ConfigService.set({ api: providerApi }) + + v0Config = { + ...baseConfig, + consumerApi, + proofVersion: 0, + providerApi, + relayApi, + } + }) + + describe("CJS + ESM", () => { + // beforeAll + let submitterKeypair: Kilt.KeyringPair + let did: DidDocument + let web3Name: Web3Name + let didKeypair: Kilt.KeyringPair + let lastTestSetupProviderBlockNumber: BN + let testConfig: typeof v0Config & + Pick< + DipSiblingProofInput, + | "didUri" + | "signer" + | "keyIds" + | "keyRelationship" + | "includeWeb3Name" + | "submitterAddress" + > + + beforeAll(async () => { + const { providerApi, consumerApi } = v0Config + const newSubmitterKeypair = keyring.addFromMnemonic( + Kilt.Utils.Crypto.mnemonicGenerate(), + ) + const providerUnit = "0".repeat(16) + const consumerUnit = "0".repeat(13) + const balanceTransferTxOnProviderChain = providerApi.tx.balances.transfer( + newSubmitterKeypair.address, + `1${providerUnit}`, + ) + const balanceTransferTxOnConsumerChain = consumerApi.tx.balances.transfer( + newSubmitterKeypair.address, + `1${consumerUnit}`, + ) + 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() + ).toBn() + const newFullDid = (await Kilt.Did.resolve(newFullDidUri)) + ?.document as DidDocument + submitterKeypair = newSubmitterKeypair + did = newFullDid + web3Name = newWeb3Name + didKeypair = newDidKeypair + + 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) + + withCrossModuleSystemImport( + "..", + async (DipSdk) => { + 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 = { + ...testConfig, + call: consumerApi.tx.postIt.post(postText).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( + `(${ + config.blockNumberRuntimeType as string + }, ${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 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 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( + `(${ + config.blockNumberRuntimeType as string + }, ${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/zombienet/network.toml b/tests/zombienet/network.toml deleted file mode 100644 index ef6ef51..0000000 --- a/tests/zombienet/network.toml +++ /dev/null @@ -1,43 +0,0 @@ -[settings] -enable_tracing = false -provider = "kubernetes" - -[relaychain] -chain = "rococo-local" -default_image = "parity/polkadot:v1.0.0" -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]] -id = 2000 - -[parachains.collator] -command = "node-executable" -name = "provider-alice" -image = "kiltprotocol/dip-provider-node-template:dev-release-f4e8bbfe2a0fb6d5be8fe2172ee8eb868e72716a" -rpc_port = 10011 -ws_port = 10011 - -[[parachains]] -id = 2001 - -[parachains.collator] -command = "node-executable" -name = "consumer-alice" -image = "kiltprotocol/dip-consumer-node-template:dev-release-f4e8bbfe2a0fb6d5be8fe2172ee8eb868e72716a" -rpc_port = 10012 -ws_port = 10012 diff --git a/yarn.lock b/yarn.lock index 8e3a9b9..da92200 100644 --- a/yarn.lock +++ b/yarn.lock @@ -28,13 +28,6 @@ __metadata: languageName: node linkType: hard -"@digitalbazaar/security-context@npm:^1.0.0": - version: 1.0.1 - resolution: "@digitalbazaar/security-context@npm:1.0.1" - checksum: acba0adbee983d5c3fac7e0f4d710888493edbf88d76adf94831e947becfd25640df74195616ba9c1607c396b20b91166e0a065a8cf04a08d3d2f2f068425d2f - languageName: node - linkType: hard - "@esbuild/android-arm64@npm:0.18.20": version: 0.18.20 resolution: "@esbuild/android-arm64@npm:0.18.20" @@ -303,75 +296,85 @@ __metadata: languageName: node linkType: hard -"@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" +"@kiltprotocol/asset-did@npm:0.34.1-rc.1": + version: 0.34.1-rc.1 + resolution: "@kiltprotocol/asset-did@npm:0.34.1-rc.1" + dependencies: + "@kiltprotocol/types": 0.34.1-rc.1 + "@kiltprotocol/utils": 0.34.1-rc.1 + checksum: 07c59ed7f0cf18b6379ffa0eb4e5841f145a3f45efe6f3161b7a0178c6615c08d098f4e61105c2762ccfbd27607e64959919940281002898eb7c1988f40f16cf + languageName: node + linkType: hard + +"@kiltprotocol/augment-api@npm:0.34.1-rc.1": + version: 0.34.1-rc.1 + resolution: "@kiltprotocol/augment-api@npm:0.34.1-rc.1" dependencies: - "@kiltprotocol/type-definitions": 0.34.0-dip-2 - checksum: 60b1a0bd40a9ecdb6b62f22c8d542670e4d62c7861ffc628e0784d04ab2c99ddf98f3bd8694546c5ed1f62c2265ffef517111e50d2589b7b8ea9bb0d2859f72d + "@kiltprotocol/type-definitions": 0.34.1-rc.1 + checksum: 1bb9f67f84ab3d1f83668372834836a23102fd5d7ec0e5a0c9fbe6505b48f21144a7dc95e7fdee47e8335bc267dbd5f31f2d41212b8d5166c22ac3ca21bcc6b0 languageName: node linkType: hard -"@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" +"@kiltprotocol/chain-helpers@npm:0.34.1-rc.1": + version: 0.34.1-rc.1 + resolution: "@kiltprotocol/chain-helpers@npm:0.34.1-rc.1" dependencies: - "@kiltprotocol/config": 0.34.0-dip-2 - "@kiltprotocol/types": 0.34.0-dip-2 - "@kiltprotocol/utils": 0.34.0-dip-2 + "@kiltprotocol/config": 0.34.1-rc.1 + "@kiltprotocol/types": 0.34.1-rc.1 + "@kiltprotocol/utils": 0.34.1-rc.1 "@polkadot/api": ^10.4.0 "@polkadot/types": ^10.4.0 - checksum: f974f84a22f4317115a596cdc75f477ae7cc4bd424a54ae45b27019f9f68c0ad72fe1364e3c7228c4b0060338382c358f0997071f4235d0c88a4e8d5f6df60e3 + checksum: 36b46f72df5a91eab73951a6f709639ac3ea256272289f979e2898eae3ba0a27e7e7e44717cbbdd46a4909a69cd40f0f7df0a7bcdfa9ccc38fd85f81b9f9a76c languageName: node linkType: hard -"@kiltprotocol/config@npm:0.34.0-dip-2": - version: 0.34.0-dip-2 - resolution: "@kiltprotocol/config@npm:0.34.0-dip-2" +"@kiltprotocol/config@npm:0.34.1-rc.1": + version: 0.34.1-rc.1 + resolution: "@kiltprotocol/config@npm:0.34.1-rc.1" dependencies: - "@kiltprotocol/types": 0.34.0-dip-2 + "@kiltprotocol/types": 0.34.1-rc.1 "@polkadot/api": ^10.4.0 typescript-logging: ^1.0.0 - checksum: 99f7280503d721cb691aad723a9e8d1b25fd673c3ebeae71acfe6a0468a22a23672750041959606a52963e2de58642e38b8aa13dc60eefff22ead156c9ff8d3d + checksum: 760889c7e8b70d0f4171ab9dfaf4694d3299675066f381a4ba5e5bdfe07be8bd9e7bd9598126056a09d89e9e4a487a6bb4d7901138cbd2f09eca8670c550d971 languageName: node linkType: hard -"@kiltprotocol/core@npm:0.34.0-dip-2": - version: 0.34.0-dip-2 - resolution: "@kiltprotocol/core@npm:0.34.0-dip-2" +"@kiltprotocol/core@npm:0.34.1-rc.1": + version: 0.34.1-rc.1 + resolution: "@kiltprotocol/core@npm:0.34.1-rc.1" dependencies: - "@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 + "@kiltprotocol/asset-did": 0.34.1-rc.1 + "@kiltprotocol/augment-api": 0.34.1-rc.1 + "@kiltprotocol/chain-helpers": 0.34.1-rc.1 + "@kiltprotocol/config": 0.34.1-rc.1 + "@kiltprotocol/did": 0.34.1-rc.1 + "@kiltprotocol/type-definitions": 0.34.1-rc.1 + "@kiltprotocol/types": 0.34.1-rc.1 + "@kiltprotocol/utils": 0.34.1-rc.1 "@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: 93df85736526490f261765524f8b94b006db1c370d43e1546aea6bb496d170429e72784e4b6092e0a5b4b684aa4a7da7fe8497e79a5b1b2b8e2fb59f5fe8d603 + checksum: 40886e932592bc8497bd1386f1fd17d0bfd2a3bedaa72f11986a221a689f013db95efc46a0e287bc400f0d684d1e64cdacd5703d23dfc926dd7f05cb77b5bd70 languageName: node linkType: hard -"@kiltprotocol/did@npm:0.34.0-dip-2": - version: 0.34.0-dip-2 - resolution: "@kiltprotocol/did@npm:0.34.0-dip-2" +"@kiltprotocol/did@npm:0.34.1-rc.1": + version: 0.34.1-rc.1 + resolution: "@kiltprotocol/did@npm:0.34.1-rc.1" dependencies: - "@digitalbazaar/security-context": ^1.0.0 - "@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 + "@kiltprotocol/augment-api": 0.34.1-rc.1 + "@kiltprotocol/config": 0.34.1-rc.1 + "@kiltprotocol/types": 0.34.1-rc.1 + "@kiltprotocol/utils": 0.34.1-rc.1 "@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: be4a91e31da0d25f49ab6156907f851ebc1aa032a0ebdea98955158ac74502488e46f45ff537bd738f1752320bece5d1f4f97a64ffdfbba48cad91ceeda33b2f + checksum: c770ac5e106ed3af9442d310639b6e155114c2ecfad0785b599877c66a5978586346602c15a8c404357e9f848aedfec6f3f47f5b8e74e22bf8e635c1a70589e1 languageName: node linkType: hard @@ -379,15 +382,15 @@ __metadata: version: 0.0.0-use.local resolution: "@kiltprotocol/dip-sdk@workspace:." dependencies: - "@kiltprotocol/did": 0.34.0-dip-2 - "@kiltprotocol/sdk-js": 0.34.0-dip-2 - "@kiltprotocol/types": 0.34.0-dip-2 + "@kiltprotocol/did": 0.34.1-rc.1 + "@kiltprotocol/sdk-js": 0.34.1-rc.1 + "@kiltprotocol/types": 0.34.1-rc.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 + "@zombienet/cli": ^1.3.85 bn.js: ^5.2.1 dotenv: ^16.3.1 eslint: ^8.45.0 @@ -401,45 +404,59 @@ __metadata: languageName: unknown linkType: soft -"@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" +"@kiltprotocol/messaging@npm:0.34.1-rc.1": + version: 0.34.1-rc.1 + resolution: "@kiltprotocol/messaging@npm:0.34.1-rc.1" dependencies: - "@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 + "@kiltprotocol/core": 0.34.1-rc.1 + "@kiltprotocol/did": 0.34.1-rc.1 + "@kiltprotocol/types": 0.34.1-rc.1 + "@kiltprotocol/utils": 0.34.1-rc.1 + "@polkadot/util": ^12.0.0 + checksum: a55c71f79c96ae42064030f4a18daaefbcf241f5daae3a3cf42bd6925efd7ccac3e6071c5b8acfe123d4cde09f913fc7d3c1839be47e122432655ae112661edf + languageName: node + linkType: hard + +"@kiltprotocol/sdk-js@npm:0.34.1-rc.1": + version: 0.34.1-rc.1 + resolution: "@kiltprotocol/sdk-js@npm:0.34.1-rc.1" + dependencies: + "@kiltprotocol/chain-helpers": 0.34.1-rc.1 + "@kiltprotocol/config": 0.34.1-rc.1 + "@kiltprotocol/core": 0.34.1-rc.1 + "@kiltprotocol/did": 0.34.1-rc.1 + "@kiltprotocol/messaging": 0.34.1-rc.1 + "@kiltprotocol/types": 0.34.1-rc.1 + "@kiltprotocol/utils": 0.34.1-rc.1 + checksum: 3e80861cfdb07d531e416d0fe3fe7f3ed3f9374ffd6a10375e1934eccab2b5a2755bf22da921a0bc72574100afd0e815a3548334cbaf7dd9ed3031e5b2d0fa7c languageName: node linkType: hard -"@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 +"@kiltprotocol/type-definitions@npm:0.34.1-rc.1": + version: 0.34.1-rc.1 + resolution: "@kiltprotocol/type-definitions@npm:0.34.1-rc.1" + checksum: c3f62e67bf9bcb927c2f81b9e7d97cfcaf57378fa373b88e540d2b5cffa3770f406f52c4a3549018c184a93ef8dd9bf5d02d9259936400b098d1accebe15801b languageName: node linkType: hard -"@kiltprotocol/types@npm:0.34.0-dip-2": - version: 0.34.0-dip-2 - resolution: "@kiltprotocol/types@npm:0.34.0-dip-2" +"@kiltprotocol/types@npm:0.34.1-rc.1": + version: 0.34.1-rc.1 + resolution: "@kiltprotocol/types@npm:0.34.1-rc.1" 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: 92ade4df9aa82db73a14d50fb691936ee8b6f75b4bc06718265342649f66cd70a1873b3aee9be15457d2a77a69b926599de369b417a8ddefd93bedd88093bf9a + checksum: bdf75f757824a7b60dfd181a0eded693f5e8c88aa73f686b5ca433c29cc5cfe1dc4dcf856af47e31d0f7a89efe4d43e0a4b94e9769a107cb107ae76adfecff7e languageName: node linkType: hard -"@kiltprotocol/utils@npm:0.34.0-dip-2": - version: 0.34.0-dip-2 - resolution: "@kiltprotocol/utils@npm:0.34.0-dip-2" +"@kiltprotocol/utils@npm:0.34.1-rc.1": + version: 0.34.1-rc.1 + resolution: "@kiltprotocol/utils@npm:0.34.1-rc.1" dependencies: - "@kiltprotocol/types": 0.34.0-dip-2 + "@kiltprotocol/types": 0.34.1-rc.1 "@polkadot/api": ^10.4.0 "@polkadot/keyring": ^12.0.0 "@polkadot/util": ^12.0.0 @@ -447,7 +464,7 @@ __metadata: cbor-web: ^9.0.0 tweetnacl: ^1.0.3 uuid: ^9.0.0 - checksum: b56d5863e267e932db584c7edd312d6385e17ff66bf6ac9ca3ff97ad59631f2223385ee3154fcc993792cb2b07c10914ad4ce7b694766cb353c2f68aed72d79b + checksum: 86743f726be09c775083bee1d8e83f42920971b4d41e09a4cd61e15aaf5712f471f588259a3bac51e593cbd5f6861052454fcb94539d40fc6d00c48e9e008fd7 languageName: node linkType: hard @@ -1058,13 +1075,6 @@ __metadata: languageName: node linkType: hard -"@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" @@ -1337,21 +1347,21 @@ __metadata: languageName: node linkType: hard -"@zombienet/cli@npm:^1.3.82": - version: 1.3.82 - resolution: "@zombienet/cli@npm:1.3.82" +"@zombienet/cli@npm:^1.3.85": + version: 1.3.85 + resolution: "@zombienet/cli@npm:1.3.85" dependencies: "@zombienet/dsl-parser-wrapper": ^0.1.10 - "@zombienet/orchestrator": ^0.0.65 + "@zombienet/orchestrator": ^0.0.68 "@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 + typescript: ^5.3.2 bin: zombienet: dist/cli.js - checksum: aef870236e344f9c84bd1a986e0f585705ff444dc1311a0809a9602c2659239bd32c423f868400433ac8c2efb775efe0e74b536c75ffb670598be0ff2b8d1215 + checksum: b0505e555883e21c650792056ba0cade10e794a24e89a09dc4e6256000b6f4422e650100093315dcbae1ac271317c4bb33b609fd0f896d4fee11181d3f7d5a54 languageName: node linkType: hard @@ -1362,9 +1372,9 @@ __metadata: languageName: node linkType: hard -"@zombienet/orchestrator@npm:^0.0.65": - version: 0.0.65 - resolution: "@zombienet/orchestrator@npm:0.0.65" +"@zombienet/orchestrator@npm:^0.0.68": + version: 0.0.68 + resolution: "@zombienet/orchestrator@npm:0.0.68" dependencies: "@polkadot/api": ^10.11.1 "@polkadot/keyring": ^12.6.1 @@ -1374,8 +1384,8 @@ __metadata: chai: ^4.3.10 debug: ^4.3.4 execa: ^5.1.1 - fs-extra: ^11.1.1 - jsdom: ^22.1.0 + fs-extra: ^11.2.0 + jsdom: ^23.0.1 json-bigint: ^1.0.0 libp2p-crypto: ^0.21.2 minimatch: ^9.0.3 @@ -1383,9 +1393,9 @@ __metadata: napi-maybe-compressed-blob: ^0.0.11 peer-id: ^0.16.0 tmp-promise: ^3.0.3 - typescript: ^5.2.2 + typescript: ^5.3.2 yaml: ^2.3.4 - checksum: 56c37af6209396f33a9f110687a2ebd37f160c17bb66c59e95365d5e64ad87eceb86798d24615e536bac12ca477b6f3886b7a7d0148ba8c94c1e73000d2f20f1 + checksum: 2706ba383dc82a29e51a8dd77e536884c248097ea7d131efc6871f4e671df1ee3b6a9a4f4206af39a42b944673a2ac5180a68f0753d0c902345e2266142cf0a4 languageName: node linkType: hard @@ -1422,13 +1432,6 @@ __metadata: 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" @@ -1461,15 +1464,6 @@ __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" @@ -1988,14 +1982,13 @@ __metadata: languageName: node linkType: hard -"data-urls@npm:^4.0.0": - version: 4.0.0 - resolution: "data-urls@npm:4.0.0" +"data-urls@npm:^5.0.0": + version: 5.0.0 + resolution: "data-urls@npm:5.0.0" dependencies: - abab: ^2.0.6 - whatwg-mimetype: ^3.0.0 - whatwg-url: ^12.0.0 - checksum: 006e869b5bf079647949a3e9b1dd69d84b2d5d26e6b01c265485699bc96e83817d4b5aae758b2910a4c58c0601913f3a0034121c1ca2da268e9a244c57515b15 + whatwg-mimetype: ^4.0.0 + whatwg-url: ^14.0.0 + checksum: 5c40568c31b02641a70204ff233bc4e42d33717485d074244a98661e5f2a1e80e38fe05a5755dfaf2ee549f2ab509d6a3af2a85f4b2ad2c984e5d176695eaf46 languageName: node linkType: hard @@ -2127,15 +2120,6 @@ __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 - "dotenv@npm:^16.3.1": version: 16.3.1 resolution: "dotenv@npm:16.3.1" @@ -2742,14 +2726,14 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^11.1.1": - version: 11.1.1 - resolution: "fs-extra@npm:11.1.1" +"fs-extra@npm:^11.2.0": + version: 11.2.0 + resolution: "fs-extra@npm:11.2.0" dependencies: graceful-fs: ^4.2.0 jsonfile: ^6.0.1 universalify: ^2.0.0 - checksum: fb883c68245b2d777fbc1f2082c9efb084eaa2bbf9fddaa366130d196c03608eebef7fb490541276429ee1ca99f317e2d73e96f5ca0999eefedf5a624ae1edfd + checksum: b12e42fa40ba47104202f57b8480dd098aa931c2724565e5e70779ab87605665594e76ee5fb00545f772ab9ace167fe06d2ab009c416dc8c842c5ae6df7aa7e8 languageName: node linkType: hard @@ -3046,12 +3030,12 @@ __metadata: languageName: node linkType: hard -"html-encoding-sniffer@npm:^3.0.0": - version: 3.0.0 - resolution: "html-encoding-sniffer@npm:3.0.0" +"html-encoding-sniffer@npm:^4.0.0": + version: 4.0.0 + resolution: "html-encoding-sniffer@npm:4.0.0" dependencies: - whatwg-encoding: ^2.0.0 - checksum: 8d806aa00487e279e5ccb573366a951a9f68f65c90298eac9c3a2b440a7ffe46615aff2995a2f61c6746c639234e6179a97e18ca5ccbbf93d3725ef2099a4502 + whatwg-encoding: ^3.1.1 + checksum: 3339b71dab2723f3159a56acf541ae90a408ce2d11169f00fe7e0c4663d31d6398c8a4408b504b4eec157444e47b084df09b3cb039c816660f0dd04846b8957d languageName: node linkType: hard @@ -3062,17 +3046,6 @@ __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" @@ -3083,17 +3056,7 @@ __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": +"https-proxy-agent@npm:^7.0.1, https-proxy-agent@npm:^7.0.2": version: 7.0.2 resolution: "https-proxy-agent@npm:7.0.2" dependencies: @@ -3447,39 +3410,37 @@ __metadata: languageName: node linkType: hard -"jsdom@npm:^22.1.0": - version: 22.1.0 - resolution: "jsdom@npm:22.1.0" +"jsdom@npm:^23.0.1": + version: 23.0.1 + resolution: "jsdom@npm:23.0.1" dependencies: - abab: ^2.0.6 cssstyle: ^3.0.0 - data-urls: ^4.0.0 + data-urls: ^5.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 + html-encoding-sniffer: ^4.0.0 + http-proxy-agent: ^7.0.0 + https-proxy-agent: ^7.0.2 is-potential-custom-element-name: ^1.0.1 - nwsapi: ^2.2.4 + nwsapi: ^2.2.7 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 + tough-cookie: ^4.1.3 + w3c-xmlserializer: ^5.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 + whatwg-encoding: ^3.1.1 + whatwg-mimetype: ^4.0.0 + whatwg-url: ^14.0.0 + ws: ^8.14.2 + xml-name-validator: ^5.0.0 peerDependencies: - canvas: ^2.5.0 + canvas: ^2.11.2 peerDependenciesMeta: canvas: optional: true - checksum: d955ab83a6dad3e6af444098d30647c719bbb4cf97de053aa5751c03c8d6f3283d8c4d7fc2774c181f1d432fb0250e7332bc159e6b466424f4e337d73adcbf30 + checksum: 1f4f21549bf3cb787521adb466dcba269187109a84ea5ad42446b5fc11336c4a303670dc51b742b1692e75ca76f41a9d8fc72e8fc2f7cb53e372441e6e3ce1dd languageName: node linkType: hard @@ -4123,7 +4084,7 @@ __metadata: languageName: node linkType: hard -"nwsapi@npm:^2.2.4": +"nwsapi@npm:^2.2.7": version: 2.2.7 resolution: "nwsapi@npm:2.2.7" checksum: cab25f7983acec7e23490fec3ef7be608041b460504229770e3bfcf9977c41d6fe58f518994d3bd9aa3a101f501089a3d4a63536f4ff8ae4b8c4ca23bdbfda4e @@ -4466,7 +4427,7 @@ __metadata: languageName: node linkType: hard -"punycode@npm:^2.1.0, punycode@npm:^2.1.1, punycode@npm:^2.3.0": +"punycode@npm:^2.1.0, punycode@npm:^2.1.1, punycode@npm:^2.3.1": version: 2.3.1 resolution: "punycode@npm:2.3.1" checksum: bb0a0ceedca4c3c57a9b981b90601579058903c62be23c5e8e843d2c2d4148a3ecf029d5133486fb0e1822b098ba8bba09e89d6b21742d02fa26bda6441a6fb2 @@ -5161,7 +5122,7 @@ __metadata: languageName: node linkType: hard -"tough-cookie@npm:^4.1.2": +"tough-cookie@npm:^4.1.3": version: 4.1.3 resolution: "tough-cookie@npm:4.1.3" dependencies: @@ -5173,12 +5134,12 @@ __metadata: languageName: node linkType: hard -"tr46@npm:^4.1.1": - version: 4.1.1 - resolution: "tr46@npm:4.1.1" +"tr46@npm:^5.0.0": + version: 5.0.0 + resolution: "tr46@npm:5.0.0" dependencies: - punycode: ^2.3.0 - checksum: aeeb821ac2cd792e63ec84888b4fd6598ac6ed75d861579e21a5cf9d4ee78b2c6b94e7d45036f2ca2088bc85b9b46560ad23c4482979421063b24137349dbd96 + punycode: ^2.3.1 + checksum: 8d8b021f8e17675ebf9e672c224b6b6cfdb0d5b92141349e9665c14a2501c54a298d11264bbb0b17b447581e1e83d4fc3c038c929f3d210e3964d4be47460288 languageName: node linkType: hard @@ -5334,7 +5295,7 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^5.2.2, typescript@npm:^5.3.2": +"typescript@npm:^5.3.2": version: 5.3.2 resolution: "typescript@npm:5.3.2" bin: @@ -5344,7 +5305,7 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@^5.2.2#~builtin, typescript@patch:typescript@^5.3.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=14eedb" bin: @@ -5579,12 +5540,12 @@ __metadata: languageName: node linkType: hard -"w3c-xmlserializer@npm:^4.0.0": - version: 4.0.0 - resolution: "w3c-xmlserializer@npm:4.0.0" +"w3c-xmlserializer@npm:^5.0.0": + version: 5.0.0 + resolution: "w3c-xmlserializer@npm:5.0.0" dependencies: - xml-name-validator: ^4.0.0 - checksum: eba070e78deb408ae8defa4d36b429f084b2b47a4741c4a9be3f27a0a3d1845e277e3072b04391a138f7e43776842627d1334e448ff13ff90ad9fb1214ee7091 + xml-name-validator: ^5.0.0 + checksum: 593acc1fdab3f3207ec39d851e6df0f3fa41a36b5809b0ace364c7a6d92e351938c53424a7618ce8e0fbaffee8be2e8e070a5734d05ee54666a8bdf1a376cc40 languageName: node linkType: hard @@ -5602,29 +5563,29 @@ __metadata: languageName: node linkType: hard -"whatwg-encoding@npm:^2.0.0": - version: 2.0.0 - resolution: "whatwg-encoding@npm:2.0.0" +"whatwg-encoding@npm:^3.1.1": + version: 3.1.1 + resolution: "whatwg-encoding@npm:3.1.1" dependencies: iconv-lite: 0.6.3 - checksum: 7087810c410aa9b689cbd6af8773341a53cdc1f3aae2a882c163bd5522ec8ca4cdfc269aef417a5792f411807d5d77d50df4c24e3abb00bb60192858a40cc675 + checksum: f75a61422421d991e4aec775645705beaf99a16a88294d68404866f65e92441698a4f5b9fa11dd609017b132d7b286c3c1534e2de5b3e800333856325b549e3c languageName: node linkType: hard -"whatwg-mimetype@npm:^3.0.0": - version: 3.0.0 - resolution: "whatwg-mimetype@npm:3.0.0" - checksum: ce08bbb36b6aaf64f3a84da89707e3e6a31e5ab1c1a2379fd68df79ba712a4ab090904f0b50e6693b0dafc8e6343a6157e40bf18fdffd26e513cf95ee2a59824 +"whatwg-mimetype@npm:^4.0.0": + version: 4.0.0 + resolution: "whatwg-mimetype@npm:4.0.0" + checksum: f97edd4b4ee7e46a379f3fb0e745de29fe8b839307cc774300fd49059fcdd560d38cb8fe21eae5575b8f39b022f23477cc66e40b0355c2851ce84760339cef30 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" +"whatwg-url@npm:^14.0.0": + version: 14.0.0 + resolution: "whatwg-url@npm:14.0.0" dependencies: - tr46: ^4.1.1 + tr46: ^5.0.0 webidl-conversions: ^7.0.0 - checksum: 8698993b763c1e7eda5ed16c31dab24bca6489626aca7caf8b5a2b64684dda6578194786f10ec42ceb1c175feea16d0a915096e6419e08d154ce551c43176972 + checksum: 4b5887e50f786583bead70916413e67a381d2126899b9eb5c67ce664bba1e7ec07cdff791404581ce73c6190d83c359c9ca1d50711631217905db3877dec075c languageName: node linkType: hard @@ -5724,7 +5685,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^8.13.0, ws@npm:^8.14.2, ws@npm:^8.8.1": +"ws@npm:^8.14.2, ws@npm:^8.8.1": version: 8.14.2 resolution: "ws@npm:8.14.2" peerDependencies: @@ -5739,10 +5700,10 @@ __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 +"xml-name-validator@npm:^5.0.0": + version: 5.0.0 + resolution: "xml-name-validator@npm:5.0.0" + checksum: 86effcc7026f437701252fcc308b877b4bc045989049cfc79b0cc112cb365cf7b009f4041fab9fb7cd1795498722c3e9fe9651afc66dfa794c16628a639a4c45 languageName: node linkType: hard