From 3fdaaf322c8c8e736adab3e6a9556a87432af025 Mon Sep 17 00:00:00 2001 From: Pileks Date: Thu, 27 Jul 2023 18:54:43 +0200 Subject: [PATCH 1/3] Remove ens-related deployers, adjust deploy tests --- .../cli/src/__tests__/e2e/p1/deploy.spec.ts | 90 ++--------- .../ens-recursive-name-register/index.ts | 145 ------------------ .../invokeWithTimeout.ts | 56 ------- .../polywrap.deploy.ext.json | 27 ---- .../lib/defaults/deploy-modules/ens/index.ts | 143 ----------------- .../deploy-modules/ens/invokeWithTimeout.ts | 56 ------- .../ens/polywrap.deploy.ext.json | 23 --- .../deploy/001-sanity/polywrap.deploy.yaml | 36 +---- .../deploy/002-no-ext/polywrap.deploy.yaml | 2 +- .../003-invalid-config/polywrap.deploy.yaml | 9 +- .../004-fail-between/polywrap.deploy.yaml | 31 ++-- .../polywrap.deploy.yaml | 9 +- yarn.lock | 6 +- 13 files changed, 32 insertions(+), 601 deletions(-) delete mode 100644 packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/index.ts delete mode 100644 packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/invokeWithTimeout.ts delete mode 100644 packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/polywrap.deploy.ext.json delete mode 100644 packages/cli/src/lib/defaults/deploy-modules/ens/index.ts delete mode 100644 packages/cli/src/lib/defaults/deploy-modules/ens/invokeWithTimeout.ts delete mode 100644 packages/cli/src/lib/defaults/deploy-modules/ens/polywrap.deploy.ext.json diff --git a/packages/cli/src/__tests__/e2e/p1/deploy.spec.ts b/packages/cli/src/__tests__/e2e/p1/deploy.spec.ts index cf656e185c..98d69ba1c6 100644 --- a/packages/cli/src/__tests__/e2e/p1/deploy.spec.ts +++ b/packages/cli/src/__tests__/e2e/p1/deploy.spec.ts @@ -44,10 +44,6 @@ const setup = async () => { process.env = { ...process.env, IPFS_GATEWAY_URI: ETH_ENS_IPFS_MODULE_CONSTANTS.ipfsProvider, - DOMAIN_NAME: "test1.eth", - ENS_REG_ADDR: ETH_ENS_IPFS_MODULE_CONSTANTS.ensAddresses.ensAddress, - ENS_REGISTRAR_ADDR: ETH_ENS_IPFS_MODULE_CONSTANTS.ensAddresses.registrarAddress, - ENS_RESOLVER_ADDR: ETH_ENS_IPFS_MODULE_CONSTANTS.ensAddresses.resolverAddress, }; } @@ -78,36 +74,20 @@ describe("e2e tests for deploy command", () => { }); it("Should deploy the project successfully", async () => { - const { exitCode: code, stdout: output, stderr } = await Commands.deploy({}, { + const { exitCode: code, stdout: output, stderr: error } = await Commands.deploy({}, { cwd: getTestCaseDir(0), cli: polywrapCli, env: process.env as Record }); const sanitizedOutput = clearStyle(output); - - console.log(output) - console.error(stderr); + const sanitizedError = clearStyle(error); expect(code).toEqual(0); + expect(sanitizedError).toBeFalsy(); expect(sanitizedOutput).toContain( "Successfully executed step 'ipfs_deploy'" ); - expect(sanitizedOutput).toContain( - "Successfully executed step 'from_deploy'" - ); - expect(sanitizedOutput).toContain( - "Successfully executed step 'from_deploy2'" - ); - expect(sanitizedOutput).toContain( - "Successfully executed 'fs_to_ens' deployment job" - ); - expect(sanitizedOutput).toContain( - "Successfully executed step 'from_uri'" - ); - expect(sanitizedOutput).toContain( - "Successfully executed 'ipfs_to_ens' deployment job" - ); }); it("Should output the deployment uri to URI.txt", async () => { @@ -131,7 +111,7 @@ describe("e2e tests for deploy command", () => { const sanitizedOutput = clearStyle(output); expect(sanitizedOutput).toContain( - `The URI result from job fs_to_ens has been written to ${deploymentFilePath}. ` + + `The URI result from job fs_to_ipfs has been written to ${deploymentFilePath}. ` + "It is recommended to store this file at the root of your wrap package and commit it to your repository.", ); }); @@ -207,57 +187,16 @@ describe("e2e tests for deploy command", () => { expect(yamlOutputFileContents).toMatchObject(jsonOutputFileContents); expect(jsonOutputFileContents).toMatchObject([ { - "name": "fs_to_ens", + "name": "fs_to_ipfs", "steps": [ - { - "name": "ens_register", - "id": "fs_to_ens.ens_register", - "input": "wrap://ens/test1.eth", - "result": "wrap://ens/testnet/test1.eth", - }, - { - "name": "ens_register2", - "id": "fs_to_ens.ens_register2", - "input": "wrap://ens/test2.eth", - "result": "wrap://ens/testnet/test2.eth", - }, { "name": "ipfs_deploy", - "id": "fs_to_ens.ipfs_deploy", + "id": "fs_to_ipfs.ipfs_deploy", "input": "wrap://fs/../wrapper", "result": "wrap://ipfs/QmcZJ1NudpTdF96NEJZiKnDDXhydqanTusw7DXGj7PfbxH", }, - { - "name": "from_deploy", - "id": "fs_to_ens.from_deploy", - "input": "wrap://ipfs/QmcZJ1NudpTdF96NEJZiKnDDXhydqanTusw7DXGj7PfbxH", - "result": "wrap://ens/testnet/test1.eth", - }, - { - "name": "from_deploy2", - "id": "fs_to_ens.from_deploy2", - "input": "wrap://ipfs/QmcZJ1NudpTdF96NEJZiKnDDXhydqanTusw7DXGj7PfbxH", - "result": "wrap://ens/testnet/test2.eth", - } ] }, - { - "name": "ipfs_to_ens", - "steps": [ - { - "name": "ens_register", - "id": "ipfs_to_ens.ens_register", - "input": "wrap://ens/test3.eth", - "result": "wrap://ens/testnet/test3.eth", - }, - { - "name": "from_uri", - "id": "ipfs_to_ens.from_uri", - "input": "wrap://ipfs/QmVdDR6QtigTt38Xwpj2Ki73X1AyZn5WRCreBCJq1CEtpF", - "result": "wrap://ens/testnet/test3.eth", - } - ] - } ]) }); @@ -286,7 +225,7 @@ describe("e2e tests for deploy command", () => { const sanitizedErr = clearStyle(stderr); expect(code).toEqual(1); - expect(sanitizedErr).toContain("domainName is not of a type(s) string") + expect(sanitizedErr).toContain("gatewayUri is not of a type(s) string") }); it("Should throw and stop chain if error is found", async () => { @@ -298,18 +237,17 @@ describe("e2e tests for deploy command", () => { const sanitizedOutput = clearStyle(output); const sanitizedErr = clearStyle(stderr); - - expect(code).toEqual(1); + expect(sanitizedOutput).toContain( - "Successfully executed step 'ipfs_deploy'" + "Successfully executed step 'ipfs_deploy_1'" ); expect(sanitizedOutput).not.toContain( - "Successfully executed step 'from_deploy2'" + "Successfully executed step 'from_deploy_3'" ); - - expect(sanitizedErr).toContain( - "Failed to execute step 'from_deploy'" + expect(sanitizedErr.replace("\n", "")).toContain( + "Failed to execute step 'ipfs_deploy_2'" ); + expect(code).toEqual(1); }); it("Should throw if environment variable is not loaded but defined in manifest", async () => { @@ -319,7 +257,7 @@ describe("e2e tests for deploy command", () => { env: process.env as Record }); const sanitizedErr = clearStyle(stderr); - expect(code).toEqual(1); expect(sanitizedErr).toContain("Environment variable not found: `NON_LOADED_VAR`"); + expect(code).toEqual(1); }); }); diff --git a/packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/index.ts b/packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/index.ts deleted file mode 100644 index 41c451aa24..0000000000 --- a/packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/index.ts +++ /dev/null @@ -1,145 +0,0 @@ -/* eslint-disable @typescript-eslint/no-require-imports */ -/* eslint-disable @typescript-eslint/no-var-requires */ -import { DeployModule } from "../../../deploy"; -import { invokeWithTimeout } from "./invokeWithTimeout"; - -import { Wallet } from "@ethersproject/wallet"; -import { JsonRpcProvider } from "@ethersproject/providers"; -import { IWrapPackage, Uri } from "@polywrap/core-js"; -import { - PolywrapClientConfigBuilder, - PolywrapClient, -} from "@polywrap/client-js"; -import * as Web3 from "@polywrap/web3-config-bundle-js"; -import { - Connection, - Connections, - ethereumWalletPlugin, -} from "@polywrap/ethereum-wallet-js"; - -class ENSRecursiveNameRegisterPublisher implements DeployModule { - async execute( - uri: Uri, - config: { - provider: string; - privateKey?: string; - ensRegistryAddress: string; - ensRegistrarAddress: string; - ensResolverAddress: string; - } - ): Promise { - if (uri.authority !== "ens") { - throw new Error( - `ENS Recursive Name Register Deployer: argument URI needs to be an ENS URI. Example: wrap://ens/foo.bar.eth` - ); - } - - let ensDomain = uri.path; - - const connectionProvider = new JsonRpcProvider(config.provider); - const { - chainId: chainIdNum, - name: networkName, - } = await connectionProvider.getNetwork(); - - const network = chainIdNum === 1337 ? "testnet" : networkName; - - if (ensDomain.startsWith(network)) { - ensDomain = ensDomain.split("/")[1]; - } - - const signer = config.privateKey - ? new Wallet(config.privateKey).connect(connectionProvider) - : undefined; - - // Default connections - const connections = new Connections({ - networks: { - [network]: new Connection({ - provider: config.provider, - signer, - }), - }, - defaultNetwork: network, - }); - - const ensUri = "wrap://redirect/ens"; - - const clientConfig = new PolywrapClientConfigBuilder() - .addDefaults() - .setPackage( - Web3.bundle.ethereumWallet.uri, - ethereumWalletPlugin({ - connections: connections, - }) as IWrapPackage - ) - .setRedirect( - ensUri, - "wrap://ipfs/QmQS8cr21euKYW7hWAhiSYXgvdcAtbPbynKqRW2CzAJPYe" - ) - .build(); - - const client = new PolywrapClient(clientConfig); - - const signerAddress = await client.invoke({ - method: "getSignerAddress", - uri: "wrapscan.io/polywrap/ethers@1.0", - args: { - connection: { - networkNameOrChainId: network, - }, - }, - }); - - if (!signerAddress.ok) { - throw new Error("Could not get signer. " + signerAddress.error); - } - - const registerData = await client.invoke< - { tx: { hash: string }; didRegister: boolean }[] - >({ - method: "registerDomainAndSubdomainsRecursively", - uri: ensUri, - args: { - domain: ensDomain, - owner: signerAddress.value, - resolverAddress: config.ensResolverAddress, - ttl: "0", - registrarAddress: config.ensRegistrarAddress, - registryAddress: config.ensRegistryAddress, - connection: { - networkNameOrChainId: network, - }, - }, - }); - - if (!registerData.ok) { - throw new Error( - `Could not register domain '${ensDomain}'` + - (registerData.error ? `\nError: ${registerData.error.message}` : "") - ); - } - - // didRegister can be false if the ens domain is already registered, in which case there is no transaction - if (registerData.value[0].didRegister) { - await invokeWithTimeout( - client, - { - method: "awaitTransaction", - uri: Uri.from("wrapscan.io/polywrap/ethers@1.0"), - args: { - txHash: registerData.value[0].tx.hash, - connection: { - networkNameOrChainId: network, - }, - }, - }, - 15000 - ); - } - - return new Uri(`ens/${network}/${ensDomain}`); - } -} - -export default new ENSRecursiveNameRegisterPublisher(); diff --git a/packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/invokeWithTimeout.ts b/packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/invokeWithTimeout.ts deleted file mode 100644 index bd8523c65b..0000000000 --- a/packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/invokeWithTimeout.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { - Invoker, - InvokeResult, - InvokerOptions, - WrapError, - WrapErrorCode, -} from "@polywrap/core-js"; -import { ResultErr } from "@polywrap/result"; - -/** - * Invoke a wrapper; abort the invocation if a timeout expires. - * - * @param client - a Polywrap Invoker (e.g. CoreClient) - * @param options - invocation options - * @param timeout - a timeout period (in ms) - * */ -export async function invokeWithTimeout( - client: Invoker, - options: InvokerOptions, - timeout: number -): Promise> { - const controller = new AbortController(); - - const timer = setTimeout(() => { - controller.abort(); - }, timeout); - - return await new Promise>((resolve, reject) => { - controller.signal.addEventListener("abort", () => { - const wrapError = new WrapError("Timeout has been reached", { - code: WrapErrorCode.WRAPPER_INVOKE_ABORTED, - uri: options.uri.uri, - method: options.method, - args: JSON.stringify(options.args, null, 2), - }); - reject(wrapError); - }); - client - .invoke(options) - .then((result) => resolve(result)) - .catch((error) => { - // the client threw an error (this should never happen) - const wrapError = new WrapError(error.message, { - code: WrapErrorCode.WRAPPER_INVOKE_FAIL, - uri: options.uri.uri, - method: options.method, - args: JSON.stringify(options.args, null, 2), - }); - resolve(ResultErr(wrapError)); - }); - }) - .catch((error) => { - return ResultErr(error as WrapError); - }) - .finally(() => timer && clearTimeout(timer)); -} diff --git a/packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/polywrap.deploy.ext.json b/packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/polywrap.deploy.ext.json deleted file mode 100644 index 31ef9b84aa..0000000000 --- a/packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/polywrap.deploy.ext.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "id": "DeployManifest_ENSRecursiveNameRegister_WasmAsExt", - "type": "object", - "required": [ - "provider", - "ensRegistryAddress", - "ensRegistrarAddress", - "ensResolverAddress" - ], - "properties": { - "provider": { - "type": "string" - }, - "privateKey": { - "type": "string" - }, - "ensRegistryAddress": { - "type": "string" - }, - "ensRegistrarAddress": { - "type": "string" - }, - "ensResolverAddress": { - "type": "string" - } - } -} \ No newline at end of file diff --git a/packages/cli/src/lib/defaults/deploy-modules/ens/index.ts b/packages/cli/src/lib/defaults/deploy-modules/ens/index.ts deleted file mode 100644 index e7297d81a3..0000000000 --- a/packages/cli/src/lib/defaults/deploy-modules/ens/index.ts +++ /dev/null @@ -1,143 +0,0 @@ -/* eslint-disable @typescript-eslint/no-require-imports */ -/* eslint-disable @typescript-eslint/no-var-requires */ -import { DeployModule } from "../../../deploy"; -import { invokeWithTimeout } from "./invokeWithTimeout"; - -import { Wallet } from "@ethersproject/wallet"; -import { JsonRpcProvider } from "@ethersproject/providers"; -import { IWrapPackage, Uri } from "@polywrap/core-js"; -import { - PolywrapClientConfigBuilder, - PolywrapClient, -} from "@polywrap/client-js"; -import * as Web3 from "@polywrap/web3-config-bundle-js"; -import { - Connection, - Connections, - ethereumWalletPlugin, -} from "@polywrap/ethereum-wallet-js"; - -const contentHash = require("content-hash"); - -class ENSPublisher implements DeployModule { - async execute( - uri: Uri, - config: { - domainName: string; - provider: string; - privateKey?: string; - ensRegistryAddress: string; - } - ): Promise { - if (uri.authority !== "ipfs") { - throw new Error( - `ENS Deployer: resolved URI from ${uri} does not represent an IPFS contentHash` - ); - } - - const cid = uri.path; - - const connectionProvider = new JsonRpcProvider(config.provider); - const { - chainId: chainIdNum, - name: networkName, - } = await connectionProvider.getNetwork(); - - const network = chainIdNum === 1337 ? "testnet" : networkName; - - const signer = config.privateKey - ? new Wallet(config.privateKey).connect(connectionProvider) - : undefined; - - // Default connections - const connections = new Connections({ - networks: { - [network]: new Connection({ - provider: config.provider, - signer, - }), - }, - defaultNetwork: network, - }); - - const ensUri = "wrap://redirect/ens"; - - const clientConfig = new PolywrapClientConfigBuilder() - .addDefaults() - .setPackage( - Web3.bundle.ethereumWallet.uri, - ethereumWalletPlugin({ - connections: connections, - }) as IWrapPackage - ) - .setRedirect( - ensUri, - "wrap://ipfs/QmQS8cr21euKYW7hWAhiSYXgvdcAtbPbynKqRW2CzAJPYe" - ) - .build(); - - const client = new PolywrapClient(clientConfig); - - const resolver = await client.invoke({ - method: "getResolver", - uri: ensUri, - args: { - registryAddress: config.ensRegistryAddress, - domain: config.domainName, - connection: { - networkNameOrChainId: network, - }, - }, - }); - - if (!resolver.ok) { - throw new Error( - `Could not get resolver for '${config.domainName}'. ${resolver.error}` - ); - } - - if (resolver.value === "0x0000000000000000000000000000000000000000") { - throw new Error(`Resolver not set for '${config.domainName}'`); - } - - const hash = "0x" + contentHash.fromIpfs(cid); - - const setContenthashData = await client.invoke<{ hash: string }>({ - method: "setContentHash", - uri: ensUri, - args: { - domain: config.domainName, - cid: hash, - resolverAddress: resolver.value, - connection: { - networkNameOrChainId: network, - }, - }, - }); - - if (!setContenthashData.ok) { - throw new Error( - `Could not set contentHash for '${config.domainName}'. ${setContenthashData.error}` - ); - } - - await invokeWithTimeout( - client, - { - method: "awaitTransaction", - uri: Uri.from("wrapscan.io/polywrap/ethers@1.0"), - args: { - txHash: setContenthashData.value.hash, - connection: { - networkNameOrChainId: network, - }, - }, - }, - 15000 - ); - - return new Uri(`ens/${network}/${config.domainName}`); - } -} - -export default new ENSPublisher(); diff --git a/packages/cli/src/lib/defaults/deploy-modules/ens/invokeWithTimeout.ts b/packages/cli/src/lib/defaults/deploy-modules/ens/invokeWithTimeout.ts deleted file mode 100644 index bd8523c65b..0000000000 --- a/packages/cli/src/lib/defaults/deploy-modules/ens/invokeWithTimeout.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { - Invoker, - InvokeResult, - InvokerOptions, - WrapError, - WrapErrorCode, -} from "@polywrap/core-js"; -import { ResultErr } from "@polywrap/result"; - -/** - * Invoke a wrapper; abort the invocation if a timeout expires. - * - * @param client - a Polywrap Invoker (e.g. CoreClient) - * @param options - invocation options - * @param timeout - a timeout period (in ms) - * */ -export async function invokeWithTimeout( - client: Invoker, - options: InvokerOptions, - timeout: number -): Promise> { - const controller = new AbortController(); - - const timer = setTimeout(() => { - controller.abort(); - }, timeout); - - return await new Promise>((resolve, reject) => { - controller.signal.addEventListener("abort", () => { - const wrapError = new WrapError("Timeout has been reached", { - code: WrapErrorCode.WRAPPER_INVOKE_ABORTED, - uri: options.uri.uri, - method: options.method, - args: JSON.stringify(options.args, null, 2), - }); - reject(wrapError); - }); - client - .invoke(options) - .then((result) => resolve(result)) - .catch((error) => { - // the client threw an error (this should never happen) - const wrapError = new WrapError(error.message, { - code: WrapErrorCode.WRAPPER_INVOKE_FAIL, - uri: options.uri.uri, - method: options.method, - args: JSON.stringify(options.args, null, 2), - }); - resolve(ResultErr(wrapError)); - }); - }) - .catch((error) => { - return ResultErr(error as WrapError); - }) - .finally(() => timer && clearTimeout(timer)); -} diff --git a/packages/cli/src/lib/defaults/deploy-modules/ens/polywrap.deploy.ext.json b/packages/cli/src/lib/defaults/deploy-modules/ens/polywrap.deploy.ext.json deleted file mode 100644 index 180605c257..0000000000 --- a/packages/cli/src/lib/defaults/deploy-modules/ens/polywrap.deploy.ext.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "id": "DeployManifest_ENS_WasmAsExt", - "type": "object", - "required": [ - "domainName", - "provider", - "ensRegistryAddress" - ], - "properties": { - "domainName": { - "type": "string" - }, - "provider": { - "type": "string" - }, - "privateKey": { - "type": "string" - }, - "ensRegistryAddress": { - "type": "string" - } - } -} \ No newline at end of file diff --git a/packages/test-cases/cases/cli/deploy/001-sanity/polywrap.deploy.yaml b/packages/test-cases/cases/cli/deploy/001-sanity/polywrap.deploy.yaml index c065da6950..99f69b156c 100644 --- a/packages/test-cases/cases/cli/deploy/001-sanity/polywrap.deploy.yaml +++ b/packages/test-cases/cases/cli/deploy/001-sanity/polywrap.deploy.yaml @@ -1,44 +1,10 @@ format: 0.4.0 jobs: - fs_to_ens: + fs_to_ipfs: config: provider: http://localhost:8545 - ensRegistryAddress: $ENS_REG_ADDR - ensRegistrarAddress: $ENS_REGISTRAR_ADDR - ensResolverAddress: $ENS_RESOLVER_ADDR gatewayUri: $IPFS_GATEWAY_URI steps: - - name: ens_register - package: ens-recursive-name-register - uri: wrap://ens/test1.eth - - name: ens_register2 - package: ens-recursive-name-register - uri: wrap://ens/test2.eth - name: ipfs_deploy package: ipfs uri: wrap://fs/../wrapper - - name: from_deploy - package: ens - uri: $$ipfs_deploy - config: - domainName: test1.eth - - name: from_deploy2 - package: ens - uri: $$ipfs_deploy - config: - domainName: test2.eth - ipfs_to_ens: - config: - provider: http://localhost:8545 - ensRegistryAddress: $ENS_REG_ADDR - ensRegistrarAddress: $ENS_REGISTRAR_ADDR - ensResolverAddress: $ENS_RESOLVER_ADDR - steps: - - name: ens_register - package: ens-recursive-name-register - uri: wrap://ens/test3.eth - - name: from_uri - package: ens - uri: wrap://ipfs/QmVdDR6QtigTt38Xwpj2Ki73X1AyZn5WRCreBCJq1CEtpF - config: - domainName: test3.eth diff --git a/packages/test-cases/cases/cli/deploy/002-no-ext/polywrap.deploy.yaml b/packages/test-cases/cases/cli/deploy/002-no-ext/polywrap.deploy.yaml index 739aab7812..62af12305a 100644 --- a/packages/test-cases/cases/cli/deploy/002-no-ext/polywrap.deploy.yaml +++ b/packages/test-cases/cases/cli/deploy/002-no-ext/polywrap.deploy.yaml @@ -1,4 +1,4 @@ -format: "0.3.0" +format: 0.4.0 jobs: test: steps: diff --git a/packages/test-cases/cases/cli/deploy/003-invalid-config/polywrap.deploy.yaml b/packages/test-cases/cases/cli/deploy/003-invalid-config/polywrap.deploy.yaml index d7a079a1d4..17b948d8d8 100644 --- a/packages/test-cases/cases/cli/deploy/003-invalid-config/polywrap.deploy.yaml +++ b/packages/test-cases/cases/cli/deploy/003-invalid-config/polywrap.deploy.yaml @@ -1,4 +1,4 @@ -format: "0.3.0" +format: 0.4.0 jobs: test: config: @@ -7,10 +7,5 @@ jobs: - name: ipfs_deploy package: ipfs uri: wrap://fs/../wrapper - - name: from_deploy - package: ens - uri: $$ipfs_deploy config: - domainName: true - ports: - ethereum: 8545 \ No newline at end of file + gatewayUri: false diff --git a/packages/test-cases/cases/cli/deploy/004-fail-between/polywrap.deploy.yaml b/packages/test-cases/cases/cli/deploy/004-fail-between/polywrap.deploy.yaml index 7eb0672b5b..6798f7599f 100644 --- a/packages/test-cases/cases/cli/deploy/004-fail-between/polywrap.deploy.yaml +++ b/packages/test-cases/cases/cli/deploy/004-fail-between/polywrap.deploy.yaml @@ -1,30 +1,17 @@ -format: "0.3.0" +format: 0.4.0 jobs: test: config: - provider: 'http://localhost:8545' gatewayUri: $IPFS_GATEWAY_URI - ensRegistryAddress: $ENS_REG_ADDR - ensRegistrarAddress: $ENS_REGISTRAR_ADDR - ensResolverAddress: $ENS_RESOLVER_ADDR steps: - - name: ipfs_deploy + - name: ipfs_deploy_1 + package: ipfs + uri: fs/../wrapper + - name: ipfs_deploy_2 package: ipfs uri: fs/../wrapper - - name: from_deploy - package: ens - uri: $$ipfs_deploy - config: - domainName: foo - ports: - ethereum: 8545 - - name: ens_register - package: ens-recursive-name-register - uri: wrap://ens/test2.eth - - name: from_deploy2 - package: ens - uri: $$ipfs_deploy config: - domainName: test2.eth - ports: - ethereum: 8545 \ No newline at end of file + gatewayUri: "this_should_throw" + - name: ipfs_deploy_3 + package: ipfs + uri: fs/../wrapper diff --git a/packages/test-cases/cases/cli/deploy/005-non-loaded-env-var/polywrap.deploy.yaml b/packages/test-cases/cases/cli/deploy/005-non-loaded-env-var/polywrap.deploy.yaml index 93d1f271b5..ca75f64d3a 100644 --- a/packages/test-cases/cases/cli/deploy/005-non-loaded-env-var/polywrap.deploy.yaml +++ b/packages/test-cases/cases/cli/deploy/005-non-loaded-env-var/polywrap.deploy.yaml @@ -1,4 +1,4 @@ -format: "0.3.0" +format: 0.4.0 jobs: test: config: @@ -7,10 +7,5 @@ jobs: - name: ipfs_deploy package: ipfs uri: fs/../wrapper - - name: from_deploy - package: ens - uri: $$ipfs_deploy config: - domainName: $NON_LOADED_VAR - provider: 'http://localhost:8545' - ensRegistryAddress: '0x9b1f7F645351AF3631a656421eD2e40f2802E6c0' + gatewayUri: $NON_LOADED_VAR diff --git a/yarn.lock b/yarn.lock index 7031e9235a..f98aed85d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4285,9 +4285,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" electron-to-chromium@^1.4.431: - version "1.4.471" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.471.tgz#14cb056d0ce4bfa99df57946d57fe46c2330dac3" - integrity sha512-GpmGRC1vTl60w/k6YpQ18pSiqnmr0j3un//5TV1idPi6aheNfkT1Ye71tMEabWyNDO6sBMgAR+95Eb0eUUr1tA== + version "1.4.473" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.473.tgz#4853de13a335c70fe1f9df8d4029be54068767d1" + integrity sha512-aVfC8+440vGfl06l8HKKn8/PD5jRfSnLkTTD65EFvU46igbpQRri1gxSzW9/+TeUlwYzrXk1sw867T96zlyECA== elliptic@6.5.4: version "6.5.4" From eb6f0e4734825fd7bb7dc5cd23a91996c5a36a56 Mon Sep 17 00:00:00 2001 From: Pileks Date: Thu, 27 Jul 2023 18:58:05 +0200 Subject: [PATCH 2/3] chore: lint --- packages/cli/src/lib/test-env/client-config.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/cli/src/lib/test-env/client-config.ts b/packages/cli/src/lib/test-env/client-config.ts index a969c05e8c..7b5f67312d 100644 --- a/packages/cli/src/lib/test-env/client-config.ts +++ b/packages/cli/src/lib/test-env/client-config.ts @@ -41,8 +41,7 @@ export function getTestEnvClientConfig(): Partial { }, }) .setRedirects({ - [testnetEnsResolverUri]: - Web3.bundle.ensContenthashResolver.uri + [testnetEnsResolverUri]: Web3.bundle.ensContenthashResolver.uri, }) .setPackages({ [Web3.bundle.ethereumWallet.uri]: ethereumWalletPlugin({ From fa6cad4cfd22de93596315b566aa9519471fe6d6 Mon Sep 17 00:00:00 2001 From: Pileks Date: Fri, 28 Jul 2023 18:34:18 +0200 Subject: [PATCH 3/3] fix help text test for build command --- packages/cli/src/__tests__/e2e/p2/build.wasm.spec.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/cli/src/__tests__/e2e/p2/build.wasm.spec.ts b/packages/cli/src/__tests__/e2e/p2/build.wasm.spec.ts index d794da5702..43d64f6526 100644 --- a/packages/cli/src/__tests__/e2e/p2/build.wasm.spec.ts +++ b/packages/cli/src/__tests__/e2e/p2/build.wasm.spec.ts @@ -17,6 +17,10 @@ Options: (default: polywrap.yaml | polywrap.yml) -o, --output-dir Output directory for build results (default: ./build) + -b, --bindgen Uri for custom bindgen wrap (must + implement wrap-abi-bindgen interface; + see + https://github.com/polywrap/wrap-abi-bindgen) -c, --client-config Add custom configuration to the PolywrapClient -n, --no-codegen Skip code generation before build