From f0b5bca0065dbaf0b7f4ec5559091de6b524be4d Mon Sep 17 00:00:00 2001 From: Jure Bogunovic Date: Tue, 5 Jul 2022 14:02:17 +0200 Subject: [PATCH 1/3] using local plugin package to test schema --- .../src/__tests__/core/plugin-wrapper.spec.ts | 107 ++++-------------- 1 file changed, 22 insertions(+), 85 deletions(-) diff --git a/packages/js/client/src/__tests__/core/plugin-wrapper.spec.ts b/packages/js/client/src/__tests__/core/plugin-wrapper.spec.ts index b87ef610a5..77fbfe6997 100644 --- a/packages/js/client/src/__tests__/core/plugin-wrapper.spec.ts +++ b/packages/js/client/src/__tests__/core/plugin-wrapper.spec.ts @@ -85,92 +85,29 @@ describe("plugin-wrapper", () => { }); test("getSchema -- plugin schema", async () => { - const client = await getClient(); - const schema: string = await client.getSchema( - "wrap://ens/js-logger.polywrap.eth" - ); + const testPluginUri = "ens/test-plugin.eth"; + const pluginSchema = "type Module { someMethod(arg: String): String }"; - expect(schema).toStrictEqual( - `### Polywrap Header START ### -scalar UInt -scalar UInt8 -scalar UInt16 -scalar UInt32 -scalar Int -scalar Int8 -scalar Int16 -scalar Int32 -scalar Bytes -scalar BigInt -scalar BigNumber -scalar JSON -scalar Map - -directive @imported( - uri: String! - namespace: String! - nativeType: String! -) on OBJECT | ENUM - -directive @imports( - types: [String!]! -) on OBJECT - -directive @capability( - type: String! - uri: String! - namespace: String! -) repeatable on OBJECT - -directive @enabled_interface on OBJECT - -directive @annotate(type: String!) on FIELD - -### Polywrap Header END ### - -type Module implements Logger_Module @imports( - types: [ - "Logger_Module", - "Logger_LogLevel" - ] -) { - log( - level: Logger_LogLevel! - message: String! - ): Boolean! -} - -### Imported Modules START ### - -type Logger_Module @imported( - uri: "ens/logger.core.polywrap.eth", - namespace: "Logger", - nativeType: "Module" -) { - log( - level: Logger_LogLevel! - message: String! - ): Boolean! -} - -### Imported Modules END ### - -### Imported Objects START ### - -enum Logger_LogLevel @imported( - uri: "ens/logger.core.polywrap.eth", - namespace: "Logger", - nativeType: "LogLevel" -) { - DEBUG - INFO - WARN - ERROR -} - -### Imported Objects END ### -` - ); + const pluginPackage = { + factory: () => ({} as PluginModule<{}>), + manifest: { + schema: pluginSchema, + implements: [], + }, + }; + + const client = new PolywrapClient({ + plugins: [ + { + uri: testPluginUri, + plugin: pluginPackage, + }, + ], + }); + + const schema: string = await client.getSchema(testPluginUri); + + expect(schema).toStrictEqual(pluginSchema); }); it("plugin map types", async () => { From 9cd3d7136b36e7e76c016c9115719959062cd38c Mon Sep 17 00:00:00 2001 From: cbrzn Date: Tue, 5 Jul 2022 14:09:24 +0200 Subject: [PATCH 2/3] chore: uses same ens of integrations repository --- .../test-env/src/wrappers/ens/schema.graphql | 10 +++++----- .../js/test-env/src/wrappers/ens/wrap.info | Bin 74067 -> 74059 bytes 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/js/test-env/src/wrappers/ens/schema.graphql b/packages/js/test-env/src/wrappers/ens/schema.graphql index b7cae7ce0a..1b939e94f5 100644 --- a/packages/js/test-env/src/wrappers/ens/schema.graphql +++ b/packages/js/test-env/src/wrappers/ens/schema.graphql @@ -308,11 +308,6 @@ type Module @imports( ): CreateSubdomainInOpenDomainAndSetContentHashResponse } -type TxOverrides { - gasPrice: BigInt - gasLimit: BigInt -} - type ConfigureOpenDomainResponse { fifsRegistrarAddress: String! registerOpenDomainTxReceipt: Ethereum_TxResponse! @@ -336,6 +331,11 @@ type RegistrationResult { tx: Ethereum_TxResponse } +type TxOverrides { + gasPrice: BigInt + gasLimit: BigInt +} + ### Imported Modules START ### type Ethereum_Module @imported( diff --git a/packages/js/test-env/src/wrappers/ens/wrap.info b/packages/js/test-env/src/wrappers/ens/wrap.info index 4f2aa7e5bb3618052beedbda7ba56e2bf5cd7cd5..d71d19b91b2408f4c003f465281acee9995d8440 100644 GIT binary patch delta 61 zcmV-D0K)&%!UW601dtiCcLBr+0fv)-$QH3GM*)L73%5H90rV9dqh)S$q;z?3Wu$ju Tb8V+~WpZ;ei+!_I! zlW;-`livXlvmODz2!lHdw>t{~^c5tlWo~mVcXDBHaAk6&ba`-Pq<3L+ZKrl+a&u{K KZly3TFfK6-`6oL7 From 12836835b82431d246a2bc287199e8fb6bcf232c Mon Sep 17 00:00:00 2001 From: cbrzn Date: Tue, 5 Jul 2022 14:15:19 +0200 Subject: [PATCH 3/3] chore: removing unsued file --- .../cases/cli/wasm/run/workflows/output.json | 14 -------------- .../wasm-as/simple-storage/polywrap-temp.yaml | 8 -------- .../simple-storage/polywrap.deploy-temp.yaml | 15 --------------- 3 files changed, 37 deletions(-) delete mode 100644 packages/test-cases/cases/cli/wasm/run/workflows/output.json delete mode 100644 packages/test-cases/cases/wrappers/wasm-as/simple-storage/polywrap-temp.yaml delete mode 100644 packages/test-cases/cases/wrappers/wasm-as/simple-storage/polywrap.deploy-temp.yaml diff --git a/packages/test-cases/cases/cli/wasm/run/workflows/output.json b/packages/test-cases/cases/cli/wasm/run/workflows/output.json deleted file mode 100644 index 513054b1da..0000000000 --- a/packages/test-cases/cases/cli/wasm/run/workflows/output.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "id": "cases.0", - "error": {} - }, - { - "id": "cases.case1.0", - "error": {} - }, - { - "id": "cases.case1.1", - "error": {} - } -] \ No newline at end of file diff --git a/packages/test-cases/cases/wrappers/wasm-as/simple-storage/polywrap-temp.yaml b/packages/test-cases/cases/wrappers/wasm-as/simple-storage/polywrap-temp.yaml deleted file mode 100644 index 41f4623e9f..0000000000 --- a/packages/test-cases/cases/wrappers/wasm-as/simple-storage/polywrap-temp.yaml +++ /dev/null @@ -1,8 +0,0 @@ -format: 0.0.1-prealpha.9 -name: SimpleStorage -language: wasm/assemblyscript -build: ./polywrap.build.yaml -meta: ./polywrap.meta.yaml -schema: ./schema.graphql -module: ./src/index.ts -deploy: ./polywrap.deploy-temp.yaml diff --git a/packages/test-cases/cases/wrappers/wasm-as/simple-storage/polywrap.deploy-temp.yaml b/packages/test-cases/cases/wrappers/wasm-as/simple-storage/polywrap.deploy-temp.yaml deleted file mode 100644 index 541b321ea8..0000000000 --- a/packages/test-cases/cases/wrappers/wasm-as/simple-storage/polywrap.deploy-temp.yaml +++ /dev/null @@ -1,15 +0,0 @@ -format: 0.0.1-prealpha.1 -stages: - ipfsDeploy: - package: ipfs - uri: >- - fs//home/cesar/dev/polywrap/monorepo/packages/test-cases/cases/wrappers/wasm-as/simple-storage/build - config: - gatewayUri: http://localhost:5001 - ensPublish: - package: ens - depends_on: ipfsDeploy - config: - domainName: simple-storage.eth - provider: http://localhost:8545 - ensRegistryAddress: '0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab'