From 86b0b72841bdc9d5040cd7c54f76bfcfc5ee7fe9 Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Sun, 16 Jul 2023 12:56:33 +0200 Subject: [PATCH 01/19] chore: fix templates test --- packages/templates/tests.spec.ts | 7 +++---- .../wasm/golang/module/__tests__/types/polywrap.app.yaml | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/templates/tests.spec.ts b/packages/templates/tests.spec.ts index 665d2b20fa..395fb12314 100644 --- a/packages/templates/tests.spec.ts +++ b/packages/templates/tests.spec.ts @@ -36,9 +36,8 @@ describe("Templates", () => { }, "plugin/rust": { codegen: "npx polywrap codegen", - // Uncomment after release of 0.10.3 - /*build: "cargo build", - test: "cargo test",*/ + build: "cargo build", + test: "cargo test", }, interface: { build: "npx polywrap build" }, }; @@ -92,7 +91,7 @@ describe("Templates", () => { beforeAll(() => { // Copy test configs - if (projectType === "wasm" && language !== "interface") { + if (projectType === "wasm" && language !== "interface" && language !== "golang") { execSync( `cp ${rootDir}/polywrap.${projectType}-${language}-linked* ${rootDir}/${projectType}/${language}/` ); diff --git a/packages/templates/wasm/golang/module/__tests__/types/polywrap.app.yaml b/packages/templates/wasm/golang/module/__tests__/types/polywrap.app.yaml index c084aed0f0..4259744c31 100644 --- a/packages/templates/wasm/golang/module/__tests__/types/polywrap.app.yaml +++ b/packages/templates/wasm/golang/module/__tests__/types/polywrap.app.yaml @@ -1,4 +1,4 @@ -format: 0.3.0 +format: 0.4.0 project: name: sample-typescript-type-generation type: app/typescript From c79121c48b0bd3abe667785787b1c23d765c7d69 Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Sun, 16 Jul 2023 10:24:20 -0400 Subject: [PATCH 02/19] fix: go codegen properly formats serialized properties --- .../Env%type%Serialization-go.mustache | 4 +- .../Env%type%Serialization-go.mustache | 4 +- .../Object%type%Serialization-go.mustache | 4 +- .../Object%type%Serialization-go.mustache | 4 +- .../module/__tests__/e2e/integration.spec.ts | 2 + .../env_test_import__env_serialization.go | 32 ++-- ...st_import__another_object_serialization.go | 4 +- ...bject_test_import__object_serialization.go | 32 ++-- .../object_another_type_serialization.go | 12 +- .../object_custom_map_value_serialization.go | 4 +- .../types/object_custom_type_serialization.go | 164 +++++++++--------- .../wrap-go/types/object_env_serialization.go | 12 +- .../wrap-go/types/objectelse_serialization.go | 4 +- 13 files changed, 142 insertions(+), 140 deletions(-) diff --git a/packages/schema/bind/src/bindings/golang/wasm/templates/env-type/Env%type%Serialization-go.mustache b/packages/schema/bind/src/bindings/golang/wasm/templates/env-type/Env%type%Serialization-go.mustache index 03f0b548fa..903b26da04 100644 --- a/packages/schema/bind/src/bindings/golang/wasm/templates/env-type/Env%type%Serialization-go.mustache +++ b/packages/schema/bind/src/bindings/golang/wasm/templates/env-type/Env%type%Serialization-go.mustache @@ -12,8 +12,8 @@ func serialize{{#toUpper}}{{type}}{{/toUpper}}(value *{{#toUpper}}{{type}}{{/toU func write{{#toUpper}}{{type}}{{/toUpper}}(writer msgpack.Write, value *{{#toUpper}}{{type}}{{/toUpper}}) { writer.WriteMapLength({{properties.length}}) {{#properties}} - writer.Context().Push("{{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property") - writer.WriteString("{{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}}") + writer.Context().Push("{{name}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property") + writer.WriteString("{{name}}") {{#scalar}} {{> serialize_scalar}} {{/scalar}} diff --git a/packages/schema/bind/src/bindings/golang/wasm/templates/imported/env-type/Env%type%Serialization-go.mustache b/packages/schema/bind/src/bindings/golang/wasm/templates/imported/env-type/Env%type%Serialization-go.mustache index 0b03fc04e1..d84030967a 100644 --- a/packages/schema/bind/src/bindings/golang/wasm/templates/imported/env-type/Env%type%Serialization-go.mustache +++ b/packages/schema/bind/src/bindings/golang/wasm/templates/imported/env-type/Env%type%Serialization-go.mustache @@ -15,8 +15,8 @@ func serialize{{#toUpper}}{{type}}{{/toUpper}}(value *{{#toUpper}}{{type}}{{/toU func write{{#toUpper}}{{type}}{{/toUpper}}(writer msgpack.Write, value *{{#toUpper}}{{type}}{{/toUpper}}) { writer.WriteMapLength({{properties.length}}) {{#properties}} - writer.Context().Push("{{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property") - writer.WriteString("{{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}}") + writer.Context().Push("{{name}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property") + writer.WriteString("{{name}}") {{#scalar}} {{> serialize_scalar}} {{/scalar}} diff --git a/packages/schema/bind/src/bindings/golang/wasm/templates/imported/object-type/Object%type%Serialization-go.mustache b/packages/schema/bind/src/bindings/golang/wasm/templates/imported/object-type/Object%type%Serialization-go.mustache index 4620a8e956..d584c641cc 100644 --- a/packages/schema/bind/src/bindings/golang/wasm/templates/imported/object-type/Object%type%Serialization-go.mustache +++ b/packages/schema/bind/src/bindings/golang/wasm/templates/imported/object-type/Object%type%Serialization-go.mustache @@ -15,8 +15,8 @@ func serialize{{#toUpper}}{{type}}{{/toUpper}}(value *{{#toUpper}}{{type}}{{/toU func write{{#toUpper}}{{type}}{{/toUpper}}(writer msgpack.Write, value *{{#toUpper}}{{type}}{{/toUpper}}) { writer.WriteMapLength({{properties.length}}) {{#properties}} - writer.Context().Push("{{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property") - writer.WriteString("{{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}}") + writer.Context().Push("{{name}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property") + writer.WriteString("{{name}}") {{#scalar}} {{> serialize_scalar}} {{/scalar}} diff --git a/packages/schema/bind/src/bindings/golang/wasm/templates/object-type/Object%type%Serialization-go.mustache b/packages/schema/bind/src/bindings/golang/wasm/templates/object-type/Object%type%Serialization-go.mustache index b858842c79..de60363f36 100644 --- a/packages/schema/bind/src/bindings/golang/wasm/templates/object-type/Object%type%Serialization-go.mustache +++ b/packages/schema/bind/src/bindings/golang/wasm/templates/object-type/Object%type%Serialization-go.mustache @@ -15,8 +15,8 @@ func serialize{{#toUpper}}{{type}}{{/toUpper}}(value *{{#toUpper}}{{type}}{{/toU func write{{#toUpper}}{{type}}{{/toUpper}}(writer msgpack.Write, value *{{#toUpper}}{{type}}{{/toUpper}}) { writer.WriteMapLength({{properties.length}}) {{#properties}} - writer.Context().Push("{{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property") - writer.WriteString("{{#toUpper}}{{#handleKeywords}}{{name}}{{/handleKeywords}}{{/toUpper}}") + writer.Context().Push("{{name}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property") + writer.WriteString("{{name}}") {{#scalar}} {{> serialize_scalar}} {{/scalar}} diff --git a/packages/templates/wasm/golang/module/__tests__/e2e/integration.spec.ts b/packages/templates/wasm/golang/module/__tests__/e2e/integration.spec.ts index 55913c174a..48be5b64d8 100644 --- a/packages/templates/wasm/golang/module/__tests__/e2e/integration.spec.ts +++ b/packages/templates/wasm/golang/module/__tests__/e2e/integration.spec.ts @@ -24,6 +24,8 @@ describe("Template Wrapper End to End Tests", () => { args: { arg: expected } }); + console.log(result); + expect(result.ok).toBeTruthy(); if (!result.ok) return; expect(result.value.result).toEqual(expected); diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/env_test_import__env_serialization.go b/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/env_test_import__env_serialization.go index 4d9e11029c..1020a49736 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/env_test_import__env_serialization.go +++ b/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/env_test_import__env_serialization.go @@ -13,22 +13,22 @@ func serializeTestImport_Env(value *TestImport_Env) []byte { func writeTestImport_Env(writer msgpack.Write, value *TestImport_Env) { writer.WriteMapLength(8) - writer.Context().Push("Object", "TestImport_AnotherObject", "writing property") - writer.WriteString("Object") + writer.Context().Push("object", "TestImport_AnotherObject", "writing property") + writer.WriteString("object") { v := value.Object TestImport_AnotherObjectWrite(writer, &v) } writer.Context().Pop() - writer.Context().Push("OptObject", "*TestImport_AnotherObject", "writing property") - writer.WriteString("OptObject") + writer.Context().Push("optObject", "*TestImport_AnotherObject", "writing property") + writer.WriteString("optObject") { v := value.OptObject TestImport_AnotherObjectWrite(writer, v) } writer.Context().Pop() - writer.Context().Push("ObjectArray", "[]TestImport_AnotherObject", "writing property") - writer.WriteString("ObjectArray") + writer.Context().Push("objectArray", "[]TestImport_AnotherObject", "writing property") + writer.WriteString("objectArray") if value.ObjectArray == nil { writer.WriteNil() } else if len(value.ObjectArray) == 0 { @@ -43,8 +43,8 @@ func writeTestImport_Env(writer msgpack.Write, value *TestImport_Env) { } } writer.Context().Pop() - writer.Context().Push("OptObjectArray", "[]*TestImport_AnotherObject", "writing property") - writer.WriteString("OptObjectArray") + writer.Context().Push("optObjectArray", "[]*TestImport_AnotherObject", "writing property") + writer.WriteString("optObjectArray") if value.OptObjectArray == nil { writer.WriteNil() } else if len(value.OptObjectArray) == 0 { @@ -59,15 +59,15 @@ func writeTestImport_Env(writer msgpack.Write, value *TestImport_Env) { } } writer.Context().Pop() - writer.Context().Push("En", "TestImport_Enum", "writing property") - writer.WriteString("En") + writer.Context().Push("en", "TestImport_Enum", "writing property") + writer.WriteString("en") { v := value.En writer.WriteI32(int32(v)) } writer.Context().Pop() - writer.Context().Push("OptEnum", "*TestImport_Enum", "writing property") - writer.WriteString("OptEnum") + writer.Context().Push("optEnum", "*TestImport_Enum", "writing property") + writer.WriteString("optEnum") { v := value.OptEnum if v == nil { @@ -77,8 +77,8 @@ func writeTestImport_Env(writer msgpack.Write, value *TestImport_Env) { } } writer.Context().Pop() - writer.Context().Push("EnumArray", "[]TestImport_Enum", "writing property") - writer.WriteString("EnumArray") + writer.Context().Push("enumArray", "[]TestImport_Enum", "writing property") + writer.WriteString("enumArray") if value.EnumArray == nil { writer.WriteNil() } else if len(value.EnumArray) == 0 { @@ -93,8 +93,8 @@ func writeTestImport_Env(writer msgpack.Write, value *TestImport_Env) { } } writer.Context().Pop() - writer.Context().Push("OptEnumArray", "[]*TestImport_Enum", "writing property") - writer.WriteString("OptEnumArray") + writer.Context().Push("optEnumArray", "[]*TestImport_Enum", "writing property") + writer.WriteString("optEnumArray") if value.OptEnumArray == nil { writer.WriteNil() } else if len(value.OptEnumArray) == 0 { diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/object_test_import__another_object_serialization.go b/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/object_test_import__another_object_serialization.go index a92be912ea..019cc8ad67 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/object_test_import__another_object_serialization.go +++ b/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/object_test_import__another_object_serialization.go @@ -13,8 +13,8 @@ func serializeTestImport_AnotherObject(value *TestImport_AnotherObject) []byte { func writeTestImport_AnotherObject(writer msgpack.Write, value *TestImport_AnotherObject) { writer.WriteMapLength(1) - writer.Context().Push("Prop", "string", "writing property") - writer.WriteString("Prop") + writer.Context().Push("prop", "string", "writing property") + writer.WriteString("prop") { v := value.Prop writer.WriteString(v) diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/object_test_import__object_serialization.go b/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/object_test_import__object_serialization.go index 14a99ed24e..ef21ee4bfc 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/object_test_import__object_serialization.go +++ b/packages/test-cases/cases/bind/sanity/output/wrap-go/imported/test_import/object_test_import__object_serialization.go @@ -13,22 +13,22 @@ func serializeTestImport_Object(value *TestImport_Object) []byte { func writeTestImport_Object(writer msgpack.Write, value *TestImport_Object) { writer.WriteMapLength(8) - writer.Context().Push("Object", "TestImport_AnotherObject", "writing property") - writer.WriteString("Object") + writer.Context().Push("object", "TestImport_AnotherObject", "writing property") + writer.WriteString("object") { v := value.Object TestImport_AnotherObjectWrite(writer, &v) } writer.Context().Pop() - writer.Context().Push("OptObject", "*TestImport_AnotherObject", "writing property") - writer.WriteString("OptObject") + writer.Context().Push("optObject", "*TestImport_AnotherObject", "writing property") + writer.WriteString("optObject") { v := value.OptObject TestImport_AnotherObjectWrite(writer, v) } writer.Context().Pop() - writer.Context().Push("ObjectArray", "[]TestImport_AnotherObject", "writing property") - writer.WriteString("ObjectArray") + writer.Context().Push("objectArray", "[]TestImport_AnotherObject", "writing property") + writer.WriteString("objectArray") if value.ObjectArray == nil { writer.WriteNil() } else if len(value.ObjectArray) == 0 { @@ -43,8 +43,8 @@ func writeTestImport_Object(writer msgpack.Write, value *TestImport_Object) { } } writer.Context().Pop() - writer.Context().Push("OptObjectArray", "[]*TestImport_AnotherObject", "writing property") - writer.WriteString("OptObjectArray") + writer.Context().Push("optObjectArray", "[]*TestImport_AnotherObject", "writing property") + writer.WriteString("optObjectArray") if value.OptObjectArray == nil { writer.WriteNil() } else if len(value.OptObjectArray) == 0 { @@ -59,15 +59,15 @@ func writeTestImport_Object(writer msgpack.Write, value *TestImport_Object) { } } writer.Context().Pop() - writer.Context().Push("En", "TestImport_Enum", "writing property") - writer.WriteString("En") + writer.Context().Push("en", "TestImport_Enum", "writing property") + writer.WriteString("en") { v := value.En writer.WriteI32(int32(v)) } writer.Context().Pop() - writer.Context().Push("OptEnum", "*TestImport_Enum", "writing property") - writer.WriteString("OptEnum") + writer.Context().Push("optEnum", "*TestImport_Enum", "writing property") + writer.WriteString("optEnum") { v := value.OptEnum if v == nil { @@ -77,8 +77,8 @@ func writeTestImport_Object(writer msgpack.Write, value *TestImport_Object) { } } writer.Context().Pop() - writer.Context().Push("EnumArray", "[]TestImport_Enum", "writing property") - writer.WriteString("EnumArray") + writer.Context().Push("enumArray", "[]TestImport_Enum", "writing property") + writer.WriteString("enumArray") if value.EnumArray == nil { writer.WriteNil() } else if len(value.EnumArray) == 0 { @@ -93,8 +93,8 @@ func writeTestImport_Object(writer msgpack.Write, value *TestImport_Object) { } } writer.Context().Pop() - writer.Context().Push("OptEnumArray", "[]*TestImport_Enum", "writing property") - writer.WriteString("OptEnumArray") + writer.Context().Push("optEnumArray", "[]*TestImport_Enum", "writing property") + writer.WriteString("optEnumArray") if value.OptEnumArray == nil { writer.WriteNil() } else if len(value.OptEnumArray) == 0 { diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-go/types/object_another_type_serialization.go b/packages/test-cases/cases/bind/sanity/output/wrap-go/types/object_another_type_serialization.go index 9379d11e42..32c1a99aad 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-go/types/object_another_type_serialization.go +++ b/packages/test-cases/cases/bind/sanity/output/wrap-go/types/object_another_type_serialization.go @@ -13,8 +13,8 @@ func serializeAnotherType(value *AnotherType) []byte { func writeAnotherType(writer msgpack.Write, value *AnotherType) { writer.WriteMapLength(3) - writer.Context().Push("Prop", "*string", "writing property") - writer.WriteString("Prop") + writer.Context().Push("prop", "*string", "writing property") + writer.WriteString("prop") { v := value.Prop if v == nil { @@ -24,15 +24,15 @@ func writeAnotherType(writer msgpack.Write, value *AnotherType) { } } writer.Context().Pop() - writer.Context().Push("Circular", "*CustomType", "writing property") - writer.WriteString("Circular") + writer.Context().Push("circular", "*CustomType", "writing property") + writer.WriteString("circular") { v := value.Circular CustomTypeWrite(writer, v) } writer.Context().Pop() - writer.Context().Push("M_const", "*string", "writing property") - writer.WriteString("M_const") + writer.Context().Push("const", "*string", "writing property") + writer.WriteString("const") { v := value.M_const if v == nil { diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-go/types/object_custom_map_value_serialization.go b/packages/test-cases/cases/bind/sanity/output/wrap-go/types/object_custom_map_value_serialization.go index 056eb66e5d..66e8cd2346 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-go/types/object_custom_map_value_serialization.go +++ b/packages/test-cases/cases/bind/sanity/output/wrap-go/types/object_custom_map_value_serialization.go @@ -13,8 +13,8 @@ func serializeCustomMapValue(value *CustomMapValue) []byte { func writeCustomMapValue(writer msgpack.Write, value *CustomMapValue) { writer.WriteMapLength(1) - writer.Context().Push("Foo", "string", "writing property") - writer.WriteString("Foo") + writer.Context().Push("foo", "string", "writing property") + writer.WriteString("foo") { v := value.Foo writer.WriteString(v) diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-go/types/object_custom_type_serialization.go b/packages/test-cases/cases/bind/sanity/output/wrap-go/types/object_custom_type_serialization.go index 78d4df2834..87941c77a2 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-go/types/object_custom_type_serialization.go +++ b/packages/test-cases/cases/bind/sanity/output/wrap-go/types/object_custom_type_serialization.go @@ -15,15 +15,15 @@ func serializeCustomType(value *CustomType) []byte { func writeCustomType(writer msgpack.Write, value *CustomType) { writer.WriteMapLength(42) - writer.Context().Push("Str", "string", "writing property") - writer.WriteString("Str") + writer.Context().Push("str", "string", "writing property") + writer.WriteString("str") { v := value.Str writer.WriteString(v) } writer.Context().Pop() - writer.Context().Push("OptStr", "*string", "writing property") - writer.WriteString("OptStr") + writer.Context().Push("optStr", "*string", "writing property") + writer.WriteString("optStr") { v := value.OptStr if v == nil { @@ -33,15 +33,15 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("U", "uint32", "writing property") - writer.WriteString("U") + writer.Context().Push("u", "uint32", "writing property") + writer.WriteString("u") { v := value.U writer.WriteU32(v) } writer.Context().Pop() - writer.Context().Push("OptU", "*uint32", "writing property") - writer.WriteString("OptU") + writer.Context().Push("optU", "*uint32", "writing property") + writer.WriteString("optU") { v := value.OptU if v == nil { @@ -51,64 +51,64 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("M_u8", "uint8", "writing property") - writer.WriteString("M_u8") + writer.Context().Push("u8", "uint8", "writing property") + writer.WriteString("u8") { v := value.M_u8 writer.WriteU8(v) } writer.Context().Pop() - writer.Context().Push("M_u16", "uint16", "writing property") - writer.WriteString("M_u16") + writer.Context().Push("u16", "uint16", "writing property") + writer.WriteString("u16") { v := value.M_u16 writer.WriteU16(v) } writer.Context().Pop() - writer.Context().Push("M_u32", "uint32", "writing property") - writer.WriteString("M_u32") + writer.Context().Push("u32", "uint32", "writing property") + writer.WriteString("u32") { v := value.M_u32 writer.WriteU32(v) } writer.Context().Pop() - writer.Context().Push("I", "int32", "writing property") - writer.WriteString("I") + writer.Context().Push("i", "int32", "writing property") + writer.WriteString("i") { v := value.I writer.WriteI32(v) } writer.Context().Pop() - writer.Context().Push("M_i8", "int8", "writing property") - writer.WriteString("M_i8") + writer.Context().Push("i8", "int8", "writing property") + writer.WriteString("i8") { v := value.M_i8 writer.WriteI8(v) } writer.Context().Pop() - writer.Context().Push("M_i16", "int16", "writing property") - writer.WriteString("M_i16") + writer.Context().Push("i16", "int16", "writing property") + writer.WriteString("i16") { v := value.M_i16 writer.WriteI16(v) } writer.Context().Pop() - writer.Context().Push("M_i32", "int32", "writing property") - writer.WriteString("M_i32") + writer.Context().Push("i32", "int32", "writing property") + writer.WriteString("i32") { v := value.M_i32 writer.WriteI32(v) } writer.Context().Pop() - writer.Context().Push("Bigint", "*big.Int", "writing property") - writer.WriteString("Bigint") + writer.Context().Push("bigint", "*big.Int", "writing property") + writer.WriteString("bigint") { v := value.Bigint writer.WriteBigInt(v) } writer.Context().Pop() - writer.Context().Push("OptBigint", "*big.Int", "writing property") - writer.WriteString("OptBigint") + writer.Context().Push("optBigint", "*big.Int", "writing property") + writer.WriteString("optBigint") { v := value.OptBigint if v == nil { @@ -118,15 +118,15 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("Bignumber", "*big.Int", "writing property") - writer.WriteString("Bignumber") + writer.Context().Push("bignumber", "*big.Int", "writing property") + writer.WriteString("bignumber") { v := value.Bignumber writer.WriteBigInt(v) } writer.Context().Pop() - writer.Context().Push("OptBignumber", "*big.Int", "writing property") - writer.WriteString("OptBignumber") + writer.Context().Push("optBignumber", "*big.Int", "writing property") + writer.WriteString("optBignumber") { v := value.OptBignumber if v == nil { @@ -136,15 +136,15 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("Json", "*fastjson.Value", "writing property") - writer.WriteString("Json") + writer.Context().Push("json", "*fastjson.Value", "writing property") + writer.WriteString("json") { v := value.Json writer.WriteJson(v) } writer.Context().Pop() - writer.Context().Push("OptJson", "*fastjson.Value", "writing property") - writer.WriteString("OptJson") + writer.Context().Push("optJson", "*fastjson.Value", "writing property") + writer.WriteString("optJson") { v := value.OptJson if v == nil { @@ -154,15 +154,15 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("Bytes", "[]byte", "writing property") - writer.WriteString("Bytes") + writer.Context().Push("bytes", "[]byte", "writing property") + writer.WriteString("bytes") { v := value.Bytes writer.WriteBytes(v) } writer.Context().Pop() - writer.Context().Push("OptBytes", "[]byte", "writing property") - writer.WriteString("OptBytes") + writer.Context().Push("optBytes", "[]byte", "writing property") + writer.WriteString("optBytes") { v := value.OptBytes if v == nil { @@ -172,15 +172,15 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("M_boolean", "bool", "writing property") - writer.WriteString("M_boolean") + writer.Context().Push("boolean", "bool", "writing property") + writer.WriteString("boolean") { v := value.M_boolean writer.WriteBool(v) } writer.Context().Pop() - writer.Context().Push("OptBoolean", "*bool", "writing property") - writer.WriteString("OptBoolean") + writer.Context().Push("optBoolean", "*bool", "writing property") + writer.WriteString("optBoolean") { v := value.OptBoolean if v == nil { @@ -190,8 +190,8 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("U_array", "[]uint32", "writing property") - writer.WriteString("U_array") + writer.Context().Push("u_array", "[]uint32", "writing property") + writer.WriteString("u_array") if value.U_array == nil { writer.WriteNil() } else if len(value.U_array) == 0 { @@ -206,8 +206,8 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("UOpt_array", "[]uint32", "writing property") - writer.WriteString("UOpt_array") + writer.Context().Push("uOpt_array", "[]uint32", "writing property") + writer.WriteString("uOpt_array") if value.UOpt_array == nil { writer.WriteNil() } else if len(value.UOpt_array) == 0 { @@ -242,8 +242,8 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("OptStrOptArray", "[]*string", "writing property") - writer.WriteString("OptStrOptArray") + writer.Context().Push("optStrOptArray", "[]*string", "writing property") + writer.WriteString("optStrOptArray") if value.OptStrOptArray == nil { writer.WriteNil() } else if len(value.OptStrOptArray) == 0 { @@ -262,8 +262,8 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("UArrayArray", "[][]uint32", "writing property") - writer.WriteString("UArrayArray") + writer.Context().Push("uArrayArray", "[][]uint32", "writing property") + writer.WriteString("uArrayArray") if value.UArrayArray == nil { writer.WriteNil() } else if len(value.UArrayArray) == 0 { @@ -287,8 +287,8 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("UOptArrayOptArray", "[][]*uint32", "writing property") - writer.WriteString("UOptArrayOptArray") + writer.Context().Push("uOptArrayOptArray", "[][]*uint32", "writing property") + writer.WriteString("uOptArrayOptArray") if value.UOptArrayOptArray == nil { writer.WriteNil() } else if len(value.UOptArrayOptArray) == 0 { @@ -316,8 +316,8 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("UArrayOptArrayArray", "[][][]uint32", "writing property") - writer.WriteString("UArrayOptArrayArray") + writer.Context().Push("uArrayOptArrayArray", "[][][]uint32", "writing property") + writer.WriteString("uArrayOptArrayArray") if value.UArrayOptArrayArray == nil { writer.WriteNil() } else if len(value.UArrayOptArrayArray) == 0 { @@ -350,8 +350,8 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("CrazyArray", "[][][][]uint32", "writing property") - writer.WriteString("CrazyArray") + writer.Context().Push("crazyArray", "[][][][]uint32", "writing property") + writer.WriteString("crazyArray") if value.CrazyArray == nil { writer.WriteNil() } else if len(value.CrazyArray) == 0 { @@ -393,22 +393,22 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("Object", "AnotherType", "writing property") - writer.WriteString("Object") + writer.Context().Push("object", "AnotherType", "writing property") + writer.WriteString("object") { v := value.Object AnotherTypeWrite(writer, &v) } writer.Context().Pop() - writer.Context().Push("OptObject", "*AnotherType", "writing property") - writer.WriteString("OptObject") + writer.Context().Push("optObject", "*AnotherType", "writing property") + writer.WriteString("optObject") { v := value.OptObject AnotherTypeWrite(writer, v) } writer.Context().Pop() - writer.Context().Push("ObjectArray", "[]AnotherType", "writing property") - writer.WriteString("ObjectArray") + writer.Context().Push("objectArray", "[]AnotherType", "writing property") + writer.WriteString("objectArray") if value.ObjectArray == nil { writer.WriteNil() } else if len(value.ObjectArray) == 0 { @@ -423,8 +423,8 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("OptObjectArray", "[]*AnotherType", "writing property") - writer.WriteString("OptObjectArray") + writer.Context().Push("optObjectArray", "[]*AnotherType", "writing property") + writer.WriteString("optObjectArray") if value.OptObjectArray == nil { writer.WriteNil() } else if len(value.OptObjectArray) == 0 { @@ -439,15 +439,15 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("En", "CustomEnum", "writing property") - writer.WriteString("En") + writer.Context().Push("en", "CustomEnum", "writing property") + writer.WriteString("en") { v := value.En writer.WriteI32(int32(v)) } writer.Context().Pop() - writer.Context().Push("OptEnum", "*CustomEnum", "writing property") - writer.WriteString("OptEnum") + writer.Context().Push("optEnum", "*CustomEnum", "writing property") + writer.WriteString("optEnum") { v := value.OptEnum if v == nil { @@ -457,8 +457,8 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("EnumArray", "[]CustomEnum", "writing property") - writer.WriteString("EnumArray") + writer.Context().Push("enumArray", "[]CustomEnum", "writing property") + writer.WriteString("enumArray") if value.EnumArray == nil { writer.WriteNil() } else if len(value.EnumArray) == 0 { @@ -473,8 +473,8 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("OptEnumArray", "[]*CustomEnum", "writing property") - writer.WriteString("OptEnumArray") + writer.Context().Push("optEnumArray", "[]*CustomEnum", "writing property") + writer.WriteString("optEnumArray") if value.OptEnumArray == nil { writer.WriteNil() } else if len(value.OptEnumArray) == 0 { @@ -493,8 +493,8 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("M_map", "map[string]int32", "writing property") - writer.WriteString("M_map") + writer.Context().Push("map", "map[string]int32", "writing property") + writer.WriteString("map") if value.M_map == nil { writer.WriteNil() } else if len(value.M_map) == 0 { @@ -509,8 +509,8 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("MapOfArr", "map[string][]int32", "writing property") - writer.WriteString("MapOfArr") + writer.Context().Push("mapOfArr", "map[string][]int32", "writing property") + writer.WriteString("mapOfArr") if value.MapOfArr == nil { writer.WriteNil() } else if len(value.MapOfArr) == 0 { @@ -534,8 +534,8 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("MapOfObj", "map[string]AnotherType", "writing property") - writer.WriteString("MapOfObj") + writer.Context().Push("mapOfObj", "map[string]AnotherType", "writing property") + writer.WriteString("mapOfObj") if value.MapOfObj == nil { writer.WriteNil() } else if len(value.MapOfObj) == 0 { @@ -550,8 +550,8 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("MapOfArrOfObj", "map[string][]AnotherType", "writing property") - writer.WriteString("MapOfArrOfObj") + writer.Context().Push("mapOfArrOfObj", "map[string][]AnotherType", "writing property") + writer.WriteString("mapOfArrOfObj") if value.MapOfArrOfObj == nil { writer.WriteNil() } else if len(value.MapOfArrOfObj) == 0 { @@ -575,8 +575,8 @@ func writeCustomType(writer msgpack.Write, value *CustomType) { } } writer.Context().Pop() - writer.Context().Push("MapCustomValue", "map[string]*CustomMapValue", "writing property") - writer.WriteString("MapCustomValue") + writer.Context().Push("mapCustomValue", "map[string]*CustomMapValue", "writing property") + writer.WriteString("mapCustomValue") if value.MapCustomValue == nil { writer.WriteNil() } else if len(value.MapCustomValue) == 0 { diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-go/types/object_env_serialization.go b/packages/test-cases/cases/bind/sanity/output/wrap-go/types/object_env_serialization.go index 9d12746234..393202c3f7 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-go/types/object_env_serialization.go +++ b/packages/test-cases/cases/bind/sanity/output/wrap-go/types/object_env_serialization.go @@ -13,15 +13,15 @@ func serializeEnv(value *Env) []byte { func writeEnv(writer msgpack.Write, value *Env) { writer.WriteMapLength(3) - writer.Context().Push("Prop", "string", "writing property") - writer.WriteString("Prop") + writer.Context().Push("prop", "string", "writing property") + writer.WriteString("prop") { v := value.Prop writer.WriteString(v) } writer.Context().Pop() - writer.Context().Push("OptProp", "*string", "writing property") - writer.WriteString("OptProp") + writer.Context().Push("optProp", "*string", "writing property") + writer.WriteString("optProp") { v := value.OptProp if v == nil { @@ -31,8 +31,8 @@ func writeEnv(writer msgpack.Write, value *Env) { } } writer.Context().Pop() - writer.Context().Push("OptMap", "map[string]*int32", "writing property") - writer.WriteString("OptMap") + writer.Context().Push("optMap", "map[string]*int32", "writing property") + writer.WriteString("optMap") if value.OptMap == nil { writer.WriteNil() } else if len(value.OptMap) == 0 { diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-go/types/objectelse_serialization.go b/packages/test-cases/cases/bind/sanity/output/wrap-go/types/objectelse_serialization.go index a89c8e047d..b7bf1eeba4 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-go/types/objectelse_serialization.go +++ b/packages/test-cases/cases/bind/sanity/output/wrap-go/types/objectelse_serialization.go @@ -13,8 +13,8 @@ func serializeElse(value *Else) []byte { func writeElse(writer msgpack.Write, value *Else) { writer.WriteMapLength(1) - writer.Context().Push("M_else", "string", "writing property") - writer.WriteString("M_else") + writer.Context().Push("else", "string", "writing property") + writer.WriteString("else") { v := value.M_else writer.WriteString(v) From 0c48b7c29f307b3cd6205b21567945ed1d1a0c7c Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Sun, 16 Jul 2023 14:32:41 -0400 Subject: [PATCH 03/19] chore: add wrap-rust abi-bindgen wrap --- .../bind/src/__tests__/test-cases.spec.ts | 4 +- packages/schema/bind/src/bindings/index.ts | 7 +- .../bind/src/bindings/rust/functions.ts | 385 -------- .../schema/bind/src/bindings/rust/index.ts | 3 - .../src/bindings/rust/transforms/byRef.ts | 24 - .../src/bindings/rust/transforms/index.ts | 2 - .../bindings/rust/transforms/propertyDeps.ts | 207 ----- .../schema/bind/src/bindings/rust/types.ts | 103 --- .../bind/src/bindings/rust/wasm/index.ts | 209 ----- .../templates/$deserialize_array.mustache | 23 - .../$deserialize_array_nobox.mustache | 23 - .../wasm/templates/$deserialize_enum.mustache | 22 - .../templates/$deserialize_map_value.mustache | 23 - .../$deserialize_map_value_nobox.mustache | 23 - .../templates/$deserialize_object.mustache | 11 - .../$deserialize_object_nobox.mustache | 11 - .../$deserialize_object_refmut.mustache | 11 - .../wasm/templates/$serialize_array.mustache | 21 - .../wasm/templates/$serialize_enum.mustache | 6 - .../templates/$serialize_map_value.mustache | 35 - .../wasm/templates/$serialize_object.mustache | 10 - .../rust/wasm/templates/entry-rs.mustache | 40 - .../wasm/templates/enum-type/mod-rs.mustache | 55 -- .../wasm/templates/env-type/mod-rs.mustache | 54 -- .../env-type/serialization-rs.mustache | 169 ---- .../imported/enum-type/mod-rs.mustache | 55 -- .../imported/env-type/mod-rs.mustache | 59 -- .../env-type/serialization-rs.mustache | 169 ---- .../wasm/templates/imported/mod-rs.mustache | 16 - .../imported/module-type/mod-rs.mustache | 85 -- .../module-type/serialization-rs.mustache | 268 ------ .../imported/object-type/mod-rs.mustache | 59 -- .../object-type/serialization-rs.mustache | 169 ---- .../templates/interface-type/mod-rs.mustache | 23 - .../rust/wasm/templates/mod-rs.mustache | 61 -- .../templates/module-type/mod-rs.mustache | 21 - .../templates/module-type/module-rs.mustache | 37 - .../module-type/serialization-rs.mustache | 269 ------ .../templates/module-type/wrapped-rs.mustache | 71 -- .../templates/object-type/mod-rs.mustache | 55 -- .../object-type/serialization-rs.mustache | 169 ---- packages/templates/plugin/rust/Cargo.toml | 9 +- packages/templates/plugin/rust/src/lib.rs | 2 +- packages/templates/plugin/rust/tests/e2e.rs | 23 +- packages/templates/tests.spec.ts | 4 +- .../bind/sanity/output/wrap-rs/_else/mod.rs | 34 +- .../output/wrap-rs/_else/serialization.rs | 68 -- .../bind/sanity/output/wrap-rs/_while/mod.rs | 2 + .../sanity/output/wrap-rs/another_type/mod.rs | 34 +- .../wrap-rs/another_type/serialization.rs | 97 -- .../sanity/output/wrap-rs/custom_enum/mod.rs | 2 + .../output/wrap-rs/custom_map_value/mod.rs | 34 +- .../wrap-rs/custom_map_value/serialization.rs | 68 -- .../sanity/output/wrap-rs/custom_type/mod.rs | 76 +- .../wrap-rs/custom_type/serialization.rs | 851 ------------------ .../cases/bind/sanity/output/wrap-rs/entry.rs | 1 - .../bind/sanity/output/wrap-rs/env/mod.rs | 35 +- .../output/wrap-rs/env/serialization.rs | 98 -- .../test_import_another_object/mod.rs | 33 +- .../serialization.rs | 68 -- .../wrap-rs/imported/test_import_enum/mod.rs | 2 + .../imported/test_import_enum_return/mod.rs | 2 + .../wrap-rs/imported/test_import_env/mod.rs | 38 +- .../imported/test_import_env/serialization.rs | 241 ----- .../imported/test_import_module/mod.rs | 71 +- .../test_import_module/serialization.rs | 554 ------------ .../imported/test_import_object/mod.rs | 44 +- .../test_import_object/serialization.rs | 241 ----- .../cases/bind/sanity/output/wrap-rs/mod.rs | 9 +- .../bind/sanity/output/wrap-rs/module/mod.rs | 17 +- .../sanity/output/wrap-rs/module/module.rs | 19 +- .../output/wrap-rs/module/serialization.rs | 770 ---------------- .../sanity/output/wrap-rs/module/wrapped.rs | 99 +- .../sanity/output/wrap-rs/test_import/mod.rs | 2 +- 74 files changed, 254 insertions(+), 6461 deletions(-) delete mode 100644 packages/schema/bind/src/bindings/rust/functions.ts delete mode 100644 packages/schema/bind/src/bindings/rust/index.ts delete mode 100644 packages/schema/bind/src/bindings/rust/transforms/byRef.ts delete mode 100644 packages/schema/bind/src/bindings/rust/transforms/index.ts delete mode 100644 packages/schema/bind/src/bindings/rust/transforms/propertyDeps.ts delete mode 100644 packages/schema/bind/src/bindings/rust/types.ts delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/index.ts delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_array.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_array_nobox.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_enum.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_map_value.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_map_value_nobox.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_object.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_object_nobox.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_object_refmut.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/$serialize_array.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/$serialize_enum.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/$serialize_map_value.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/$serialize_object.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/entry-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/enum-type/mod-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/env-type/mod-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/env-type/serialization-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/imported/enum-type/mod-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/imported/env-type/mod-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/imported/env-type/serialization-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/imported/mod-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/imported/module-type/mod-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/imported/module-type/serialization-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/imported/object-type/mod-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/imported/object-type/serialization-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/interface-type/mod-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/mod-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/module-type/mod-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/module-type/module-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/module-type/serialization-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/module-type/wrapped-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/object-type/mod-rs.mustache delete mode 100644 packages/schema/bind/src/bindings/rust/wasm/templates/object-type/serialization-rs.mustache delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/_else/serialization.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/another_type/serialization.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_map_value/serialization.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_type/serialization.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/env/serialization.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_another_object/serialization.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_env/serialization.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_module/serialization.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_object/serialization.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/module/serialization.rs diff --git a/packages/schema/bind/src/__tests__/test-cases.spec.ts b/packages/schema/bind/src/__tests__/test-cases.spec.ts index c5f73e0f5b..0e4a9188e1 100644 --- a/packages/schema/bind/src/__tests__/test-cases.spec.ts +++ b/packages/schema/bind/src/__tests__/test-cases.spec.ts @@ -72,10 +72,10 @@ describe("Polywrap Binding Test Suite", () => { output.output.entries = sort(output.output.entries); expectedOutput.output.entries = sort(expectedOutput.output.entries); - const testResultDir = path.join(__dirname, "/test-results/"); + const testResultDir = path.join(__dirname, "/test-results/", language); if (!fs.existsSync(testResultDir)) { - fs.mkdirSync(testResultDir); + fs.mkdirSync(testResultDir, { recursive: true }); } writeFileSync( diff --git a/packages/schema/bind/src/bindings/index.ts b/packages/schema/bind/src/bindings/index.ts index 0f21b912ca..29c62535ed 100644 --- a/packages/schema/bind/src/bindings/index.ts +++ b/packages/schema/bind/src/bindings/index.ts @@ -1,10 +1,9 @@ import { GenerateBindingFn } from "./types"; import { BindLanguage } from "../"; -import * as Rust from "./rust"; import * as WrapBindgen from "./wrap-bindgen"; import * as Golang from "./golang"; -export { Rust, Golang }; +export { Golang }; export * from "./types"; export * from "./utils"; @@ -17,7 +16,9 @@ export function getGenerateBindingFn( "https://github.com/polywrap/wrap-abi-bindgen/tree/wrap-0.1/implementations/wrap-assemblyscript" ); case "wrap-rs": - return Rust.Wasm.generateBinding; + return WrapBindgen.getGenerateBindingFn( + "https://github.com/polywrap/wrap-abi-bindgen/tree/wrap-0.1/implementations/wrap-rust" + ); case "wrap-go": return Golang.Wasm.generateBinding; case "plugin-ts": diff --git a/packages/schema/bind/src/bindings/rust/functions.ts b/packages/schema/bind/src/bindings/rust/functions.ts deleted file mode 100644 index aca46a07b5..0000000000 --- a/packages/schema/bind/src/bindings/rust/functions.ts +++ /dev/null @@ -1,385 +0,0 @@ -import { isKeyword } from "./types"; -import { MustacheFn } from "../types"; - -function replaceAt(str: string, index: number, replacement: string): string { - return ( - str.substr(0, index) + replacement + str.substr(index + replacement.length) - ); -} - -function insertAt(str: string, index: number, insert: string): string { - return str.substr(0, index) + insert + str.substr(index); -} - -function removeAt(str: string, index: number): string { - return str.substr(0, index) + str.substr(index + 1); -} - -export const toLower: MustacheFn = () => { - return (value: string, render: (template: string) => string) => { - let type = render(value); - - for (let i = 0; i < type.length; ++i) { - const char = type.charAt(i); - const lower = char.toLowerCase(); - - if (char !== lower) { - // Replace the uppercase char w/ the lowercase version - type = replaceAt(type, i, lower); - - if (i !== 0 && type[i - 1] !== "_") { - // Make sure all lowercase conversions have an underscore before them - type = insertAt(type, i, "_"); - } - } - } - - return type; - }; -}; - -export const toUpper: MustacheFn = () => { - return (value: string, render: (template: string) => string) => { - let type = render(value); - - // First character must always be upper case - const firstChar = type.charAt(0); - const firstUpper = firstChar.toUpperCase(); - type = replaceAt(type, 0, firstUpper); - - // Look for any underscores, remove them if they exist, and make next letter uppercase - for (let i = 0; i < type.length; ++i) { - const char = type.charAt(i); - - if (char === "_") { - const nextChar = type.charAt(i + 1); - const nextCharUpper = nextChar.toUpperCase(); - type = replaceAt(type, i + 1, nextCharUpper); - type = removeAt(type, i); - } - } - - return type; - }; -}; - -export const noBox: MustacheFn = () => { - return (value: string, render: (template: string) => string) => { - const type = render(value); - const extract = /(.*)Box<([a-zA-Z0-9]*)>(.*)/gm; - const match = [...type.matchAll(extract)]; - - if (match.length === 0) { - return type; - } - - const strings = match[0] as string[]; - return strings[1] + strings[2] + strings[3]; - }; -}; - -export const toMsgPack: MustacheFn = () => { - return (value: string, render: (template: string) => string) => { - let type = render(value); - - let modifier = ""; - if (type[type.length - 1] === "!") { - type = type.substr(0, type.length - 1); - } else { - modifier = "optional_"; - } - - if (type[0] === "[") { - return modifier + "array"; - } - if (type.startsWith("Map<")) { - return modifier + "ext_generic_map"; - } - - switch (type) { - case "Int": - return modifier + "i32"; - case "Int8": - return modifier + "i8"; - case "Int16": - return modifier + "i16"; - case "Int32": - return modifier + "i32"; - case "Int64": - return modifier + "i64"; - case "UInt": - case "UInt32": - return modifier + "u32"; - case "UInt8": - return modifier + "u8"; - case "UInt16": - return modifier + "u16"; - case "UInt64": - return modifier + "u64"; - case "String": - return modifier + "string"; - case "Boolean": - return modifier + "bool"; - case "Bytes": - return modifier + "bytes"; - case "BigInt": - return modifier + "bigint"; - case "BigNumber": - return modifier + "bignumber"; - case "JSON": - return modifier + "json"; - default: - throw Error(`Unknown toWasm type "${type}"`); - } - }; -}; - -export const toWasmInit: MustacheFn = () => { - return (value: string, render: (template: string) => string) => { - let type = render(value); - let optional = false; - - const optionalModifier = (str: string): string => { - return !optional ? str : "None"; - }; - - if (type[type.length - 1] === "!") { - type = type.substr(0, type.length - 1); - } else { - optional = true; - } - - if (type[0] === "[") { - return optionalModifier("vec![]"); - } - - if (type.startsWith("Map<")) { - const firstOpenBracketIdx = type.indexOf("<"); - const lastCloseBracketIdx = type.lastIndexOf(">"); - - if (firstOpenBracketIdx === -1 || lastCloseBracketIdx === -1) { - throw new Error(`Invalid Map: ${type}`); - } - - const keyValTypes = type.substring( - firstOpenBracketIdx + 1, - lastCloseBracketIdx - ); - - const firstCommaIdx = keyValTypes.indexOf(","); - if (firstCommaIdx === -1) { - throw new Error(`Invalid Map: ${type}`); - } - - const keyType = keyValTypes.substring(0, firstCommaIdx).trim(); - const valType = keyValTypes.substring(firstCommaIdx + 1).trim(); - - const wasmKeyType = toWasm()(keyType, (str) => str); - const wasmValType = toWasm()(valType, (str) => str); - - return optionalModifier(`Map::<${wasmKeyType}, ${wasmValType}>::new()`); - } - - switch (type) { - case "Int": - case "Int8": - case "Int16": - case "Int32": - case "Int64": - case "UInt": - case "UInt8": - case "UInt16": - case "UInt32": - case "UInt64": - return optionalModifier("0"); - case "String": - return optionalModifier("String::new()"); - case "Boolean": - return optionalModifier("false"); - case "Bytes": - return optionalModifier("vec![]"); - case "BigInt": - return optionalModifier("BigInt::default()"); - case "BigNumber": - return optionalModifier("BigNumber::default()"); - case "JSON": - return optionalModifier("JSON::Value::Null"); - default: - if (type.includes("Enum_")) { - return optionalModifier(`${toWasm()(value, render)}::_MAX_`); - } else { - return optionalModifier(`${toWasm()(value, render)}::new()`); - } - } - }; -}; - -export const toWasm: MustacheFn = () => { - return (value: string, render: (template: string) => string) => { - let type = render(value); - - let optional = false; - if (type[type.length - 1] === "!") { - type = type.substr(0, type.length - 1); - } else { - optional = true; - } - - if (type[0] === "[") { - return toWasmArray(type, optional); - } - - if (type.startsWith("Map<")) { - return toWasmMap(type, optional); - } - - switch (type) { - case "Int": - type = "i32"; - break; - case "Int8": - type = "i8"; - break; - case "Int16": - type = "i16"; - break; - case "Int32": - type = "i32"; - break; - case "Int64": - type = "i64"; - break; - case "UInt": - case "UInt32": - type = "u32"; - break; - case "UInt8": - type = "u8"; - break; - case "UInt16": - type = "u16"; - break; - case "UInt64": - type = "u64"; - break; - case "String": - type = "String"; - break; - case "Boolean": - type = "bool"; - break; - case "Bytes": - type = "Vec"; - break; - case "BigInt": - type = "BigInt"; - break; - case "BigNumber": - type = "BigNumber"; - break; - case "JSON": - type = "JSON::Value"; - break; - default: - if (type.includes("Enum_")) { - type = type.replace("Enum_", ""); - } - type = toUpper()(type, (str) => str); - type = detectKeyword()(type, (str) => str); - } - - return applyOptional(type, optional); - }; -}; - -// check if any of the keywords match the property name; -// if there's a match, insert `_` at the beginning of the property name. -export const detectKeyword: MustacheFn = () => { - return (value: string, render: (template: string) => string): string => { - const type = render(value); - if (isKeyword(type)) { - return "_" + type; - } - return type; - }; -}; - -export const serdeKeyword: MustacheFn = () => { - return (value: string, render: (template: string) => string): string => { - const type = render(value); - if (isKeyword(type)) { - return `#[serde(rename = "${type}")]\n `; - } - return ""; - }; -}; - -export const serdeAnnotateIfBytes: MustacheFn = () => { - return (value: string, render: (template: string) => string): string => { - const scalarType: string | undefined = render(value); - - if (scalarType === "Bytes") { - return `#[serde(with = "serde_bytes")]\n `; - } - return ""; - }; -}; - -export const serdeRenameIfCaseMismatch: MustacheFn = () => { - return (value: string, render: (template: string) => string): string => { - const type = render(value); - - if (hasUppercase(type) || isKeyword(type)) { - return `#[serde(rename = "${type}")]\n `; - } - return ""; - }; -}; - -const hasUppercase = (value: string): boolean => value !== value.toLowerCase(); - -const toWasmArray = (type: string, optional: boolean): string => { - const result = type.match(/(\[)([[\]A-Za-z1-9_.!]+)(\])/); - - if (!result || result.length !== 4) { - throw Error(`Invalid Array: ${type}`); - } - - const wasmType = toWasm()(result[2], (str) => str); - return applyOptional("Vec<" + wasmType + ">", optional); -}; - -const toWasmMap = (type: string, optional: boolean): string => { - const firstOpenBracketIdx = type.indexOf("<"); - const lastCloseBracketIdx = type.lastIndexOf(">"); - - if (firstOpenBracketIdx === -1 || lastCloseBracketIdx === -1) { - throw new Error(`Invalid Map: ${type}`); - } - - const keyValTypes = type.substring( - firstOpenBracketIdx + 1, - lastCloseBracketIdx - ); - - const firstCommaIdx = keyValTypes.indexOf(","); - if (firstCommaIdx === -1) { - throw new Error(`Invalid Map: ${type}`); - } - - const keyType = keyValTypes.substring(0, firstCommaIdx).trim(); - const valType = keyValTypes.substring(firstCommaIdx + 1).trim(); - - const wasmKeyType = toWasm()(keyType, (str) => str); - const wasmValType = toWasm()(valType, (str) => str); - - return applyOptional(`Map<${wasmKeyType}, ${wasmValType}>`, optional); -}; - -const applyOptional = (type: string, optional: boolean): string => { - if (optional) { - return `Option<${type}>`; - } else { - return type; - } -}; diff --git a/packages/schema/bind/src/bindings/rust/index.ts b/packages/schema/bind/src/bindings/rust/index.ts deleted file mode 100644 index a01310ad9e..0000000000 --- a/packages/schema/bind/src/bindings/rust/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * as Wasm from "./wasm"; -export * as Functions from "./functions"; -export * as Types from "./types"; diff --git a/packages/schema/bind/src/bindings/rust/transforms/byRef.ts b/packages/schema/bind/src/bindings/rust/transforms/byRef.ts deleted file mode 100644 index b5f87a673c..0000000000 --- a/packages/schema/bind/src/bindings/rust/transforms/byRef.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { AbiTransforms } from "@polywrap/schema-parse"; -import { AnyDefinition } from "@polywrap/wrap-manifest-types-js"; - -export function byRef(): AbiTransforms { - return { - enter: { - // eslint-disable-next-line @typescript-eslint/naming-convention - AnyDefinition: (def: AnyDefinition) => { - const byRefScalars = ["String", "BigInt", "BigNumber", "Map", "Bytes"]; - - if (def.scalar) { - if (byRefScalars.indexOf(def.scalar.type) > -1 || !def.required) { - return { - ...def, - byRef: true, - }; - } - } - - return def; - }, - }, - }; -} diff --git a/packages/schema/bind/src/bindings/rust/transforms/index.ts b/packages/schema/bind/src/bindings/rust/transforms/index.ts deleted file mode 100644 index 56b11478c3..0000000000 --- a/packages/schema/bind/src/bindings/rust/transforms/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./byRef"; -export * from "./propertyDeps"; diff --git a/packages/schema/bind/src/bindings/rust/transforms/propertyDeps.ts b/packages/schema/bind/src/bindings/rust/transforms/propertyDeps.ts deleted file mode 100644 index 5a6a5d20ba..0000000000 --- a/packages/schema/bind/src/bindings/rust/transforms/propertyDeps.ts +++ /dev/null @@ -1,207 +0,0 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -/* eslint-disable no-useless-escape */ -import { isBaseType, isBuiltInType } from "../types"; - -import { - ImportedModuleDefinition, - ObjectDefinition, - AnyDefinition, - ModuleDefinition, - EnvDefinition, - Abi, - ImportedEnvDefinition, -} from "@polywrap/wrap-manifest-types-js"; -import { AbiTransforms } from "@polywrap/schema-parse"; - -interface PropertyDep { - crate: string; - type: string; - isEnum: boolean; -} - -interface PropertyDepsState { - abiEnvDefinition?: EnvDefinition; - envDefinition?: EnvDefinition; - importedEnvDefinition?: ImportedEnvDefinition; - objectDefinition?: ObjectDefinition; - moduleDefinition?: ModuleDefinition; - importedModuleDefinition?: ImportedModuleDefinition; - propertyDeps?: PropertyDep[]; -} - -export function propertyDeps(): AbiTransforms { - const state: PropertyDepsState = {}; - - return { - enter: { - Abi: (abi: Abi) => { - if (abi.envType) { - state.abiEnvDefinition = abi.envType; - } - return abi; - }, - EnvDefinition: (def: EnvDefinition) => { - state.envDefinition = def; - state.propertyDeps = []; - return def; - }, - ImportedEnvDefinition: (def: ImportedEnvDefinition) => { - state.envDefinition = def; - state.propertyDeps = []; - return def; - }, - ObjectDefinition: (def: ObjectDefinition) => { - state.objectDefinition = def; - state.propertyDeps = []; - return def; - }, - ModuleDefinition: (def: ModuleDefinition) => { - state.moduleDefinition = def; - state.propertyDeps = []; - if (state.abiEnvDefinition) { - state.propertyDeps.push({ - crate: "crate", - type: "Env", - isEnum: false, - }); - } - return def; - }, - ImportedModuleDefinition: (def: ImportedModuleDefinition) => { - state.importedModuleDefinition = def; - state.propertyDeps = []; - return def; - }, - AnyDefinition: (def: AnyDefinition) => { - const appendPropertyDep = ( - rootType: string, - array: PropertyDep[] - ): PropertyDep[] => { - let typeName = def.type; - - if (typeName.indexOf("[") === 0) { - typeName = typeName.replace(/\[|\]|\!|\?/g, ""); - } - - const appendUnique = (item: PropertyDep) => { - if ( - array.findIndex( - (i) => i.crate === item.crate && i.type === item.type - ) === -1 - ) { - array.push(item); - } - }; - - const isKnownType = (name: string) => - isBaseType(name) || isBuiltInType(name) || name === rootType; - - // if type is map and the value is custom, - // we need to add it into property dependency - if (typeName.startsWith("Map<")) { - const valueName = def.map?.object?.type ?? def.map?.enum?.type; - if (valueName && !isKnownType(valueName)) { - appendUnique({ - crate: "crate", - type: valueName, - isEnum: valueName === def.map?.enum?.type, - }); - - return array; - } - - return array; - } - - if (isKnownType(typeName)) { - return array; - } - - appendUnique({ - crate: "crate", - type: typeName, - isEnum: !!def.enum || !!def.array?.enum, - }); - - return array; - }; - - if (state.envDefinition && state.propertyDeps) { - state.propertyDeps = appendPropertyDep( - state.envDefinition.type, - state.propertyDeps - ); - } else if (state.importedEnvDefinition && state.propertyDeps) { - state.propertyDeps = appendPropertyDep( - state.importedEnvDefinition.type, - state.propertyDeps - ); - } else if (state.objectDefinition && state.propertyDeps) { - state.propertyDeps = appendPropertyDep( - state.objectDefinition.type, - state.propertyDeps - ); - } else if (state.moduleDefinition && state.propertyDeps) { - state.propertyDeps = appendPropertyDep( - state.moduleDefinition.type, - state.propertyDeps - ); - } else if (state.importedModuleDefinition && state.propertyDeps) { - state.propertyDeps = appendPropertyDep( - state.importedModuleDefinition.type, - state.propertyDeps - ); - } - - return def; - }, - }, - leave: { - EnvDefinition: (def: EnvDefinition) => { - const propertyDeps = state.propertyDeps; - state.propertyDeps = undefined; - state.envDefinition = undefined; - return { - ...def, - propertyDeps, - }; - }, - ImportedEnvDefinition: (def: ImportedEnvDefinition) => { - const propertyDeps = state.propertyDeps; - state.propertyDeps = undefined; - state.importedEnvDefinition = undefined; - return { - ...def, - propertyDeps, - }; - }, - ObjectDefinition: (def: ObjectDefinition) => { - const propertyDeps = state.propertyDeps; - state.propertyDeps = undefined; - state.objectDefinition = undefined; - return { - ...def, - propertyDeps, - }; - }, - ModuleDefinition: (def: ModuleDefinition) => { - const propertyDeps = state.propertyDeps; - state.propertyDeps = undefined; - state.moduleDefinition = undefined; - return { - ...def, - propertyDeps, - }; - }, - ImportedModuleDefinition: (def: ImportedModuleDefinition) => { - const propertyDeps = state.propertyDeps; - state.propertyDeps = undefined; - state.importedModuleDefinition = undefined; - return { - ...def, - propertyDeps, - }; - }, - }, - }; -} diff --git a/packages/schema/bind/src/bindings/rust/types.ts b/packages/schema/bind/src/bindings/rust/types.ts deleted file mode 100644 index 2ca3c140a5..0000000000 --- a/packages/schema/bind/src/bindings/rust/types.ts +++ /dev/null @@ -1,103 +0,0 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -const baseTypes = { - UInt: "UInt", - UInt8: "UInt8", - UInt16: "UInt16", - UInt32: "UInt32", - UInt64: "UInt64", - Int: "Int", - Int8: "Int8", - Int16: "Int16", - Int32: "Int32", - Int64: "Int64", - String: "String", - Boolean: "Boolean", - Bytes: "Bytes", -}; - -export type BaseTypes = typeof baseTypes; - -export type BaseType = keyof BaseTypes; - -export function isBaseType(type: string): type is BaseType { - return type in baseTypes; -} - -const builtInTypes = { - BigInt: "BigInt", - BigNumber: "BigNumber", - JSON: "JSON", -}; - -export type BuiltInTypes = typeof builtInTypes; - -export type BuiltInType = keyof BuiltInTypes; - -export function isBuiltInType(type: string): type is BuiltInType { - return type in builtInTypes; -} - -const keywords = { - as: "as", - break: "break", - const: "const", - continue: "continue", - crate: "crate", - else: "else", - enum: "enum", - extern: "extern", - false: "false", - fn: "fn", - for: "for", - if: "if", - impl: "impl", - in: "in", - let: "let", - loop: "loop", - match: "match", - mod: "mod", - move: "move", - mut: "mut", - pub: "pub", - ref: "ref", - return: "return", - self: "self", - Self: "Self", - static: "static", - struct: "struct", - super: "super", - trait: "trait", - true: "true", - type: "type", - unsafe: "unsafe", - use: "use", - where: "where", - while: "while", - async: "async", - await: "await", - dyn: "dyn", - abstract: "abstract", - become: "become", - box: "box", - Box: "Box", - do: "do", - final: "final", - macro: "macro", - override: "override", - priv: "priv", - typeof: "typeof", - unsized: "unsized", - virtual: "virtual", - yield: "yield", - try: "try", - macro_rules: "macro_rules", - union: "union", -}; - -export type Keywords = typeof keywords; - -export type Keyword = keyof Keywords; - -export function isKeyword(keyword: string): keyword is Keyword { - return keyword in keywords; -} diff --git a/packages/schema/bind/src/bindings/rust/wasm/index.ts b/packages/schema/bind/src/bindings/rust/wasm/index.ts deleted file mode 100644 index 8c4ce600f4..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/index.ts +++ /dev/null @@ -1,209 +0,0 @@ -import * as Transforms from "../transforms"; -import { Functions } from "../"; -import { GenerateBindingFn, renderTemplates } from "../.."; -import { loadSubTemplates } from "../../utils"; -import { BindOptions, BindOutput } from "../../.."; - -import { - transformAbi, - extendType, - addFirstLast, - toPrefixedGraphQLType, - hasImports, - methodParentPointers, -} from "@polywrap/schema-parse"; -import { OutputEntry, readDirectorySync } from "@polywrap/os-js"; -import path from "path"; -import { WrapAbi } from "@polywrap/wrap-manifest-types-js/src"; - -const templatesDir = readDirectorySync(path.join(__dirname, "./templates")); -const subTemplates = loadSubTemplates(templatesDir.entries); -const templatePath = (subpath: string) => - path.join(__dirname, "./templates", subpath); - -const toLower = (type: string) => Functions.toLower()(type, (str) => str); - -export const generateBinding: GenerateBindingFn = ( - options: BindOptions -): BindOutput => { - const result: BindOutput = { - output: { - entries: [], - }, - outputDirAbs: options.outputDirAbs, - }; - const output = result.output; - const abi = applyTransforms(options.wrapInfo.abi); - - // Generate object type folders - if (abi.objectTypes) { - for (const objectType of abi.objectTypes) { - output.entries.push({ - type: "Directory", - name: Functions.detectKeyword()(toLower(objectType.type), (str) => str), - data: renderTemplates( - templatePath("object-type"), - objectType, - subTemplates - ), - }); - } - } - - // Generate env type folders - if (abi.envType) { - output.entries.push({ - type: "Directory", - name: Functions.detectKeyword()(toLower(abi.envType.type), (str) => str), - data: renderTemplates( - templatePath("env-type"), - abi.envType, - subTemplates - ), - }); - } - - // Generate imported folder - const importEntries: OutputEntry[] = []; - - // Generate imported module type folders - if (abi.importedModuleTypes) { - for (const importedModuleType of abi.importedModuleTypes) { - importEntries.push({ - type: "Directory", - name: toLower(importedModuleType.type), - data: renderTemplates( - templatePath("imported/module-type"), - importedModuleType, - subTemplates - ), - }); - } - } - - // Generate imported enum type folders - if (abi.importedEnumTypes) { - for (const importedEnumType of abi.importedEnumTypes) { - importEntries.push({ - type: "Directory", - name: Functions.detectKeyword()( - toLower(importedEnumType.type), - (str) => str - ), - data: renderTemplates( - templatePath("imported/enum-type"), - importedEnumType, - subTemplates - ), - }); - } - } - - // Generate imported object type folders - if (abi.importedObjectTypes) { - for (const importedObectType of abi.importedObjectTypes) { - importEntries.push({ - type: "Directory", - name: Functions.detectKeyword()( - toLower(importedObectType.type), - (str) => str - ), - data: renderTemplates( - templatePath("imported/object-type"), - importedObectType, - subTemplates - ), - }); - } - } - - // Generate imported env type folders - if (abi.importedEnvTypes) { - for (const importedEnvType of abi.importedEnvTypes) { - importEntries.push({ - type: "Directory", - name: Functions.detectKeyword()( - toLower(importedEnvType.type), - (str) => str - ), - data: renderTemplates( - templatePath("imported/env-type"), - importedEnvType, - subTemplates - ), - }); - } - } - - if (importEntries.length > 0) { - output.entries.push({ - type: "Directory", - name: "imported", - data: [ - ...importEntries, - ...renderTemplates(templatePath("imported"), abi, subTemplates), - ], - }); - } - - // Generate interface type folders - if (abi.interfaceTypes) { - for (const interfaceType of abi.interfaceTypes) { - output.entries.push({ - type: "Directory", - name: toLower(interfaceType.type), - data: renderTemplates( - templatePath("interface-type"), - interfaceType, - subTemplates - ), - }); - } - } - - // Generate module type folders - if (abi.moduleType) { - output.entries.push({ - type: "Directory", - name: toLower(abi.moduleType.type), - data: renderTemplates(templatePath("module-type"), abi, subTemplates), - }); - } - - // Generate enum type folders - if (abi.enumTypes) { - for (const enumType of abi.enumTypes) { - output.entries.push({ - type: "Directory", - name: Functions.detectKeyword()(toLower(enumType.type), (str) => str), - data: renderTemplates( - templatePath("enum-type"), - enumType, - subTemplates - ), - }); - } - } - - // Generate root entry file - output.entries.push(...renderTemplates(templatePath(""), abi, subTemplates)); - - return result; -}; - -function applyTransforms(abi: WrapAbi): WrapAbi { - const transforms = [ - extendType(Functions), - addFirstLast, - toPrefixedGraphQLType, - hasImports, - methodParentPointers(), - Transforms.propertyDeps(), - Transforms.byRef(), - ]; - - for (const transform of transforms) { - abi = transformAbi(abi, transform); - } - return abi; -} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_array.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_array.mustache deleted file mode 100644 index 677e8785b0..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_array.mustache +++ /dev/null @@ -1,23 +0,0 @@ -{{#scalar}} -reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}() -{{/scalar}} -{{#array}} -reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - {{> deserialize_array}} -}) -{{/array}} -{{#map}} -reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - reader.read_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}() -}, |reader| { - {{> deserialize_map_value}} -}) -{{/map}} -{{#enum}} -{{> deserialize_enum}} -Ok(value) -{{/enum}} -{{#object}} -{{> deserialize_object}} -Ok(object) -{{/object}} \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_array_nobox.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_array_nobox.mustache deleted file mode 100644 index 3ff7fb4f1b..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_array_nobox.mustache +++ /dev/null @@ -1,23 +0,0 @@ -{{#scalar}} -reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}() -{{/scalar}} -{{#array}} -reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - {{> deserialize_array_nobox}} -}) -{{/array}} -{{#map}} -reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - reader.read_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}() -}, |reader| { - {{> deserialize_map_value_nobox}} -}) -{{/map}} -{{#enum}} -{{> deserialize_enum}} -Ok(value) -{{/enum}} -{{#object}} -{{> deserialize_object_nobox}} -Ok(object) -{{/object}} \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_enum.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_enum.mustache deleted file mode 100644 index 4c5c792b2f..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_enum.mustache +++ /dev/null @@ -1,22 +0,0 @@ -{{#required}} -let mut value: {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} = {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::_MAX_; -if reader.is_next_string()? { - value = get_{{#toLower}}{{type}}{{/toLower}}_value(&reader.read_string()?)?; -} else { - value = {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::try_from(reader.read_i32()?)?; - sanitize_{{#toLower}}{{type}}{{/toLower}}_value(value as i32)?; -} -{{/required}} -{{^required}} -let mut value: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = None; -if !reader.is_next_nil()? { - if reader.is_next_string()? { - value = Some(get_{{#toLower}}{{type}}{{/toLower}}_value(&reader.read_string()?)?); - } else { - value = Some({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::try_from(reader.read_i32()?)?); - sanitize_{{#toLower}}{{type}}{{/toLower}}_value(value.unwrap() as i32)?; - } -} else { - value = None; -} -{{/required}} \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_map_value.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_map_value.mustache deleted file mode 100644 index 85fa4c841b..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_map_value.mustache +++ /dev/null @@ -1,23 +0,0 @@ -{{#scalar}} -reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}() -{{/scalar}} -{{#array}} -reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - {{> deserialize_array}} -}) -{{/array}} -{{#map}} -reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - reader.read_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}() -}, |reader| { - {{> deserialize_map_value}} -}) -{{/map}} -{{#enum}} -{{> deserialize_enum}} -Ok(value) -{{/enum}} -{{#object}} -{{> deserialize_object}} -Ok(object) -{{/object}} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_map_value_nobox.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_map_value_nobox.mustache deleted file mode 100644 index 6147316f80..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_map_value_nobox.mustache +++ /dev/null @@ -1,23 +0,0 @@ -{{#scalar}} -reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}() -{{/scalar}} -{{#array}} -reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - {{> deserialize_array_nobox}} -}) -{{/array}} -{{#map}} -reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - reader.read_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}() -}, |reader| { - {{> deserialize_map_value_nobox}} -}) -{{/map}} -{{#enum}} -{{> deserialize_enum}} -Ok(value) -{{/enum}} -{{#object}} -{{> deserialize_object_nobox}} -Ok(object) -{{/object}} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_object.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_object.mustache deleted file mode 100644 index ba82c73512..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_object.mustache +++ /dev/null @@ -1,11 +0,0 @@ -{{#required}} -let object = Box::new({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::read(reader)?); -{{/required}} -{{^required}} -let mut object: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = None; -if !reader.is_next_nil()? { - object = Some(Box::new({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::read(reader)?)); -} else { - object = None; -} -{{/required}} \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_object_nobox.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_object_nobox.mustache deleted file mode 100644 index bf4cb82114..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_object_nobox.mustache +++ /dev/null @@ -1,11 +0,0 @@ -{{#required}} -let object = {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::read(reader)?; -{{/required}} -{{^required}} -let mut object: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = None; -if !reader.is_next_nil()? { - object = Some({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::read(reader)?); -} else { - object = None; -} -{{/required}} \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_object_refmut.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_object_refmut.mustache deleted file mode 100644 index bd6e80fd9e..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/$deserialize_object_refmut.mustache +++ /dev/null @@ -1,11 +0,0 @@ -{{#required}} -let object = {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::read(&mut reader)?; -{{/required}} -{{^required}} -let mut object: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = None; -if !reader.is_next_nil()? { - object = Some({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::read(&mut reader)?); -} else { - object = None; -} -{{/required}} \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/$serialize_array.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/$serialize_array.mustache deleted file mode 100644 index 793cd62322..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/$serialize_array.mustache +++ /dev/null @@ -1,21 +0,0 @@ -{{#scalar}} -writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(item) -{{/scalar}} -{{#array}} -writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(item, |writer, item| { - {{> serialize_array}} -}) -{{/array}} -{{#map}} -writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(item, |writer, key| { - writer.write_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}(key) -}, |writer, value| { - {{> serialize_map_value}} -}) -{{/map}} -{{#enum}} -{{> serialize_enum}} -{{/enum}} -{{#object}} -{{> serialize_object}} -{{/object}} \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/$serialize_enum.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/$serialize_enum.mustache deleted file mode 100644 index 5ada8b40f4..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/$serialize_enum.mustache +++ /dev/null @@ -1,6 +0,0 @@ -{{#required}} -writer.write_i32(&(*item as i32)) -{{/required}} -{{^required}} -writer.write_optional_i32(&item.map(|f| f as i32)) -{{/required}} \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/$serialize_map_value.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/$serialize_map_value.mustache deleted file mode 100644 index b0550dca9a..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/$serialize_map_value.mustache +++ /dev/null @@ -1,35 +0,0 @@ -{{#scalar}} -writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(value) -{{/scalar}} -{{#array}} -writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(value, |writer, item| { - {{> serialize_array}} -}) -{{/array}} -{{#map}} -writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(value, |writer, key| { - writer.write_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}(key) -}, |writer, value| { - {{> serialize_map_value}} -}) -{{/map}} -{{#enum}} -{{#required}} -writer.write_i32(&(*value as i32)) -{{/required}} -{{^required}} -writer.write_optional_i32(&value.map(|f| f as i32)) -{{/required}} -{{/enum}} -{{#object}} -{{#required}} -{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(value, writer) -{{/required}} -{{^required}} -if value.is_some() { - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(value.as_ref().as_ref().unwrap(), writer) -} else { - writer.write_nil() -} -{{/required}} -{{/object}} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/$serialize_object.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/$serialize_object.mustache deleted file mode 100644 index 8a1ca4d6d1..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/$serialize_object.mustache +++ /dev/null @@ -1,10 +0,0 @@ -{{#required}} -{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(item, writer) -{{/required}} -{{^required}} -if item.is_some() { - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(item.as_ref().as_ref().unwrap(), writer) -} else { - writer.write_nil() -} -{{/required}} \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/entry-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/entry-rs.mustache deleted file mode 100644 index 4287286a50..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/entry-rs.mustache +++ /dev/null @@ -1,40 +0,0 @@ -{{#moduleType}} -{{#methods.length}} -use crate::{ - {{#methods}} - {{#toLower}}{{name}}{{/toLower}}_wrapped{{^last}},{{/last}} - {{/methods}} -}; -{{/methods.length}} -{{/moduleType}} -use polywrap_wasm_rs::{ - abort, - invoke, - InvokeArgs, -}; -use crate::module::Module; - -#[no_mangle] -pub extern "C" fn _wrap_invoke(method_size: u32, args_size: u32, env_size: u32) -> bool { - // Ensure the abort handler is properly setup - abort::wrap_abort_setup(); - - let args: InvokeArgs = invoke::wrap_invoke_args(method_size, args_size); - let result: Vec; - - match args.method.as_str() { - {{#moduleType}} - {{#methods}} - "{{name}}" => { - result = {{#toLower}}{{name}}{{/toLower}}_wrapped(args.args.as_slice(), env_size); - } - {{/methods}} - {{/moduleType}} - _ => { - invoke::wrap_invoke_error(format!("Could not find invoke function {}", args.method)); - return false; - } - }; - invoke::wrap_invoke_result(result); - return true; -} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/enum-type/mod-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/enum-type/mod-rs.mustache deleted file mode 100644 index f87a2c5691..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/enum-type/mod-rs.mustache +++ /dev/null @@ -1,55 +0,0 @@ -use polywrap_wasm_rs::{EnumTypeError}; -use serde::{Serialize, Deserialize}; -use std::convert::TryFrom; - -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] -pub enum {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#constants}} - {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}{{#detectKeyword}}{{.}}{{/detectKeyword}}, - {{/constants}} - _MAX_ -} - -pub fn sanitize_{{#toLower}}{{type}}{{/toLower}}_value(value: i32) -> Result<(), EnumTypeError> { - if value < 0 && value >= {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::_MAX_ as i32 { - return Err(EnumTypeError::EnumProcessingError(format!("Invalid value for enum '{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}': {}", value.to_string()))); - } - Ok(()) -} - -pub fn get_{{#toLower}}{{type}}{{/toLower}}_value(key: &str) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, EnumTypeError> { - match key { - {{#constants}} - "{{#detectKeyword}}{{.}}{{/detectKeyword}}" => Ok({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::{{#detectKeyword}}{{.}}{{/detectKeyword}}), - {{/constants}} - "_MAX_" => Ok({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::_MAX_), - err => Err(EnumTypeError::EnumProcessingError(format!("Invalid key for enum '{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}': {}", err))) - } -} - -pub fn get_{{#toLower}}{{type}}{{/toLower}}_key(value: {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}) -> Result { - if sanitize_{{#toLower}}{{type}}{{/toLower}}_value(value as i32).is_ok() { - match value { - {{#constants}} - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::{{#detectKeyword}}{{.}}{{/detectKeyword}} => Ok("{{#detectKeyword}}{{.}}{{/detectKeyword}}".to_string()), - {{/constants}} - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::_MAX_ => Ok("_MAX_".to_string()), - } - } else { - Err(EnumTypeError::EnumProcessingError(format!("Invalid value for enum '{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}': {}", (value as i32).to_string()))) - } -} - -impl TryFrom for {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - type Error = EnumTypeError; - - fn try_from(v: i32) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, Self::Error> { - match v { - {{#constants}} - x if x == {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::{{#detectKeyword}}{{.}}{{/detectKeyword}} as i32 => Ok({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::{{#detectKeyword}}{{.}}{{/detectKeyword}}), - {{/constants}} - x if x == {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::_MAX_ as i32 => Ok({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::_MAX_), - _ => Err(EnumTypeError::ParseEnumError(format!("Invalid value for enum '{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}': {}", (v as i32).to_string()))), - } - } -} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/env-type/mod-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/env-type/mod-rs.mustache deleted file mode 100644 index 77569c3e85..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/env-type/mod-rs.mustache +++ /dev/null @@ -1,54 +0,0 @@ -use serde::{Serialize, Deserialize}; -pub mod serialization; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - DecodeError, - EncodeError, - Read, - Write, - JSON, -}; -pub use serialization::{ - deserialize_{{#toLower}}{{type}}{{/toLower}}, - read_{{#toLower}}{{type}}{{/toLower}}, - serialize_{{#toLower}}{{type}}{{/toLower}}, - write_{{#toLower}}{{type}}{{/toLower}} -}; -{{#propertyDeps}} -use {{crate}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/propertyDeps}} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#properties}} - {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}pub {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}}, - {{/properties}} -} - -impl {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - pub fn new() -> {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#properties}} - {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasmInit}}{{toGraphQLType}}{{/toWasmInit}}, - {{/properties}} - } - } - - pub fn to_buffer(args: &{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}) -> Result, EncodeError> { - serialize_{{#toLower}}{{type}}{{/toLower}}(args).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn from_buffer(args: &[u8]) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, DecodeError> { - deserialize_{{#toLower}}{{type}}{{/toLower}}(args).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } - - pub fn write(args: &{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, writer: &mut W) -> Result<(), EncodeError> { - write_{{#toLower}}{{type}}{{/toLower}}(args, writer).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn read(reader: &mut R) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, DecodeError> { - read_{{#toLower}}{{type}}{{/toLower}}(reader).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } -} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/env-type/serialization-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/env-type/serialization-rs.mustache deleted file mode 100644 index fad845897d..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/env-type/serialization-rs.mustache +++ /dev/null @@ -1,169 +0,0 @@ -use std::convert::TryFrom; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Context, - DecodeError, - EncodeError, - Read, - ReadDecoder, - Write, - WriteEncoder, - JSON, -}; -use crate::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{#propertyDeps.length}} - -{{/propertyDeps.length}}{{#propertyDeps}} -{{^isEnum}} -use {{crate}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/isEnum}} -{{#isEnum}} -use crate::{ - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, - get_{{#toLower}}{{type}}{{/toLower}}_value, - sanitize_{{#toLower}}{{type}}{{/toLower}}_value -}; -{{/isEnum}} -{{/propertyDeps}} - -pub fn serialize_{{#toLower}}{{type}}{{/toLower}}(args: &{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) env-type: {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_{{#toLower}}{{type}}{{/toLower}}(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_{{#toLower}}{{type}}{{/toLower}}(args: &{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, writer: &mut W) -> Result<(), EncodeError> { - {{#properties.length}} - writer.write_map_length(&{{properties.length}})?; - {{/properties.length}} - {{^properties}} - writer.write_map_length(&0)?; - {{/properties}} - {{#properties}} - writer.context().push("{{name}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property"); - writer.write_string("{{name}}")?; - {{#scalar}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}})?; - {{/scalar}} - {{#array}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, |writer, item| { - {{> serialize_array}} - })?; - {{/array}} - {{#map}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, |writer, key| { - writer.write_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}(key) - }, |writer, value| { - {{> serialize_map_value}} - })?; - {{/map}} - {{#object}} - {{#required}} - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, writer)?; - {{/required}} - {{^required}} - if args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.is_some() { - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.as_ref().as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - {{/required}} - {{/object}} - {{#enum}} - {{#required}} - writer.write_i32(&(args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}} as i32))?; - {{/required}} - {{^required}} - writer.write_optional_i32(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.map(|f| f as i32))?; - {{/required}} - {{/enum}} - writer.context().pop(); - {{/properties}} - Ok(()) -} - -pub fn deserialize_{{#toLower}}{{type}}{{/toLower}}(args: &[u8]) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, DecodeError> { - let mut context = Context::new(); - context.description = "Deserializing env-type: {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}".to_string(); - let mut reader = ReadDecoder::new(args, context); - read_{{#toLower}}{{type}}{{/toLower}}(&mut reader) -} - -pub fn read_{{#toLower}}{{type}}{{/toLower}}(reader: &mut R) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, DecodeError> { - let mut num_of_fields = reader.read_map_length()?; - - {{#properties}} - {{^object}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = {{#toWasmInit}}{{toGraphQLType}}{{/toWasmInit}}; - {{/object}} - {{#object}} - {{#required}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = {{#toWasmInit}}{{toGraphQLType}}{{/toWasmInit}}; - {{/required}} - {{^required}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = None; - {{/required}} - {{/object}} - {{#required}} - let mut _{{#toLower}}{{name}}{{/toLower}}_set = false; - {{/required}} - {{/properties}} - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - {{#properties}} - "{{name}}" => { - reader.context().push(&field, "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "type found, reading property"); - {{#scalar}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}()?; - {{/scalar}} - {{#array}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - {{> deserialize_array_nobox}} - })?; - {{/array}} - {{#map}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - reader.read_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}()? - }, |reader| { - {{> deserialize_map_value_nobox}} - })?; - {{/map}} - {{#enum}} - {{> deserialize_enum}} - _{{#toLower}}{{name}}{{/toLower}} = value; - {{/enum}} - {{#object}} - {{> deserialize_object_nobox}} - _{{#toLower}}{{name}}{{/toLower}} = object; - {{/object}} - {{#required}} - _{{#toLower}}{{name}}{{/toLower}}_set = true; - {{/required}} - reader.context().pop(); - } - {{/properties}} - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - {{#properties}} - {{#required}} - if !_{{#toLower}}{{name}}{{/toLower}}_set { - return Err(DecodeError::MissingField("{{name}}: {{type}}.".to_string())); - } - {{/required}} - {{/properties}} - - Ok({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#properties}} - {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: _{{#toLower}}{{name}}{{/toLower}}, - {{/properties}} - }) -} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/imported/enum-type/mod-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/imported/enum-type/mod-rs.mustache deleted file mode 100644 index ff39f8054b..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/imported/enum-type/mod-rs.mustache +++ /dev/null @@ -1,55 +0,0 @@ -use polywrap_wasm_rs::EnumTypeError; -use serde::{Serialize, Deserialize}; -use std::convert::TryFrom; - -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] -pub enum {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#constants}} - {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}{{#detectKeyword}}{{.}}{{/detectKeyword}}, - {{/constants}} - _MAX_ -} - -pub fn sanitize_{{#toLower}}{{type}}{{/toLower}}_value(value: i32) -> Result<(), EnumTypeError> { - if value < 0 && value >= {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::_MAX_ as i32 { - return Err(EnumTypeError::EnumProcessingError(format!("Invalid value for enum '{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}': {}", value.to_string()))); - } - Ok(()) -} - -pub fn get_{{#toLower}}{{type}}{{/toLower}}_value(key: &str) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, EnumTypeError> { - match key { - {{#constants}} - "{{#detectKeyword}}{{.}}{{/detectKeyword}}" => Ok({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::{{#detectKeyword}}{{.}}{{/detectKeyword}}), - {{/constants}} - "_MAX_" => Ok({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::_MAX_), - err => Err(EnumTypeError::EnumProcessingError(format!("Invalid key for enum '{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}': {}", err))) - } -} - -pub fn get_{{#toLower}}{{type}}{{/toLower}}_key(value: {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}) -> Result { - if sanitize_{{#toLower}}{{type}}{{/toLower}}_value(value as i32).is_ok() { - match value { - {{#constants}} - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::{{#detectKeyword}}{{.}}{{/detectKeyword}} => Ok("{{#detectKeyword}}{{.}}{{/detectKeyword}}".to_string()), - {{/constants}} - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::_MAX_ => Ok("_MAX_".to_string()), - } - } else { - Err(EnumTypeError::EnumProcessingError(format!("Invalid value for enum '{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}': {}", (value as i32).to_string()))) - } -} - -impl TryFrom for {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - type Error = EnumTypeError; - - fn try_from(v: i32) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, Self::Error> { - match v { - {{#constants}} - x if x == {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::{{#detectKeyword}}{{.}}{{/detectKeyword}} as i32 => Ok({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::{{#detectKeyword}}{{.}}{{/detectKeyword}}), - {{/constants}} - x if x == {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::_MAX_ as i32 => Ok({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::_MAX_), - _ => Err(EnumTypeError::ParseEnumError(format!("Invalid value for enum '{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}': {}", (v as i32).to_string()))), - } - } -} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/imported/env-type/mod-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/imported/env-type/mod-rs.mustache deleted file mode 100644 index 0553426858..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/imported/env-type/mod-rs.mustache +++ /dev/null @@ -1,59 +0,0 @@ -use serde::{Serialize, Deserialize}; -pub mod serialization; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - DecodeError, - EncodeError, - Read, - Write, - JSON, -}; -pub use serialization::{ - deserialize_{{#toLower}}{{type}}{{/toLower}}, - read_{{#toLower}}{{type}}{{/toLower}}, - serialize_{{#toLower}}{{type}}{{/toLower}}, - write_{{#toLower}}{{type}}{{/toLower}} -}; -{{#propertyDeps.length}} - -{{#propertyDeps}} -use {{crate}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/propertyDeps}} -{{/propertyDeps.length}} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#properties}} - pub {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}}, - {{/properties}} -} - -impl {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - pub const URI: &'static str = "{{uri}}"; - - pub fn new() -> {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#properties}} - {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasmInit}}{{toGraphQLType}}{{/toWasmInit}}, - {{/properties}} - } - } - - pub fn to_buffer(args: &{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}) -> Result, EncodeError> { - serialize_{{#toLower}}{{type}}{{/toLower}}(args).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn from_buffer(args: &[u8]) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, DecodeError> { - deserialize_{{#toLower}}{{type}}{{/toLower}}(args).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } - - pub fn write(args: &{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, writer: &mut W) -> Result<(), EncodeError> { - write_{{#toLower}}{{type}}{{/toLower}}(args, writer).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn read(reader: &mut R) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, DecodeError> { - read_{{#toLower}}{{type}}{{/toLower}}(reader).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } -} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/imported/env-type/serialization-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/imported/env-type/serialization-rs.mustache deleted file mode 100644 index e451fe9180..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/imported/env-type/serialization-rs.mustache +++ /dev/null @@ -1,169 +0,0 @@ -use std::convert::TryFrom; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Context, - DecodeError, - EncodeError, - Read, - ReadDecoder, - Write, - WriteEncoder, - JSON, -}; -use crate::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{#propertyDeps.length}} - -{{/propertyDeps.length}}{{#propertyDeps}} -{{^isEnum}} -use {{crate}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/isEnum}} -{{#isEnum}} -use crate::{ - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, - get_{{#toLower}}{{type}}{{/toLower}}_value, - sanitize_{{#toLower}}{{type}}{{/toLower}}_value -}; -{{/isEnum}} -{{/propertyDeps}} - -pub fn serialize_{{#toLower}}{{type}}{{/toLower}}(args: &{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) imported env-type: {{#toUpper}}{{type}}{{/toUpper}}".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_{{#toLower}}{{type}}{{/toLower}}(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_{{#toLower}}{{type}}{{/toLower}}(args: &{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, writer: &mut W) -> Result<(), EncodeError> { - {{#properties.length}} - writer.write_map_length(&{{properties.length}})?; - {{/properties.length}} - {{^properties}} - writer.write_map_length(&0)?; - {{/properties}} - {{#properties}} - writer.context().push("{{name}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property"); - writer.write_string("{{name}}")?; - {{#scalar}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}})?; - {{/scalar}} - {{#array}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, |writer, item| { - {{> serialize_array}} - })?; - {{/array}} - {{#map}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, |writer, key| { - writer.write_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}(key) - }, |writer, value| { - {{> serialize_map_value}} - })?; - {{/map}} - {{#object}} - {{#required}} - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, writer)?; - {{/required}} - {{^required}} - if args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.is_some() { - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.as_ref().as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - {{/required}} - {{/object}} - {{#enum}} - {{#required}} - writer.write_i32(&(args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}} as i32))?; - {{/required}} - {{^required}} - writer.write_optional_i32(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.map(|f| f as i32))?; - {{/required}} - {{/enum}} - writer.context().pop(); - {{/properties}} - Ok(()) -} - -pub fn deserialize_{{#toLower}}{{type}}{{/toLower}}(args: &[u8]) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, DecodeError> { - let mut context = Context::new(); - context.description = "Deserializing imported env-type: {{#toUpper}}{{type}}{{/toUpper}}".to_string(); - let mut reader = ReadDecoder::new(args, context); - read_{{#toLower}}{{type}}{{/toLower}}(&mut reader) -} - -pub fn read_{{#toLower}}{{type}}{{/toLower}}(reader: &mut R) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, DecodeError> { - let mut num_of_fields = reader.read_map_length()?; - - {{#properties}} - {{^object}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = {{#toWasmInit}}{{toGraphQLType}}{{/toWasmInit}}; - {{/object}} - {{#object}} - {{#required}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = {{#toWasmInit}}{{toGraphQLType}}{{/toWasmInit}}; - {{/required}} - {{^required}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = None; - {{/required}} - {{/object}} - {{#required}} - let mut _{{#toLower}}{{name}}{{/toLower}}_set = false; - {{/required}} - {{/properties}} - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - {{#properties}} - "{{name}}" => { - reader.context().push(&field, "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "type found, reading property"); - {{#scalar}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}()?; - {{/scalar}} - {{#array}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - {{> deserialize_array_nobox}} - })?; - {{/array}} - {{#map}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - reader.read_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}()? - }, |reader| { - {{> deserialize_map_value_nobox}} - })?; - {{/map}} - {{#enum}} - {{> deserialize_enum}} - _{{#toLower}}{{name}}{{/toLower}} = value; - {{/enum}} - {{#object}} - {{> deserialize_object_nobox}} - _{{#toLower}}{{name}}{{/toLower}} = object; - {{/object}} - {{#required}} - _{{#toLower}}{{name}}{{/toLower}}_set = true; - {{/required}} - reader.context().pop(); - } - {{/properties}} - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - {{#properties}} - {{#required}} - if !_{{#toLower}}{{name}}{{/toLower}}_set { - return Err(DecodeError::MissingField("{{name}}: {{type}}.".to_string())); - } - {{/required}} - {{/properties}} - - Ok({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#properties}} - {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: _{{#toLower}}{{name}}{{/toLower}}, - {{/properties}} - }) -} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/imported/mod-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/imported/mod-rs.mustache deleted file mode 100644 index 1ba73c7a99..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/imported/mod-rs.mustache +++ /dev/null @@ -1,16 +0,0 @@ -{{#importedObjectTypes}} -pub mod {{#toLower}}{{type}}{{/toLower}}; -pub use {{#toLower}}{{type}}{{/toLower}}::*; -{{/importedObjectTypes}} -{{#importedEnumTypes}} -pub mod {{#toLower}}{{type}}{{/toLower}}; -pub use {{#toLower}}{{type}}{{/toLower}}::*; -{{/importedEnumTypes}} -{{#importedModuleTypes}} -pub mod {{#toLower}}{{type}}{{/toLower}}; -pub use {{#toLower}}{{type}}{{/toLower}}::*; -{{/importedModuleTypes}} -{{#importedEnvTypes}} -pub mod {{#toLower}}{{type}}{{/toLower}}; -pub use {{#toLower}}{{type}}{{/toLower}}::*; -{{/importedEnvTypes}} \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/imported/module-type/mod-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/imported/module-type/mod-rs.mustache deleted file mode 100644 index 68a3c9bb93..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/imported/module-type/mod-rs.mustache +++ /dev/null @@ -1,85 +0,0 @@ -use serde::{Serialize, Deserialize}; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Read, - Write, - JSON, - subinvoke, -}; -pub mod serialization; -{{#methods.length}} -pub use serialization::{ - {{#methods}} - deserialize_{{#toLower}}{{name}}{{/toLower}}_result, - serialize_{{#toLower}}{{name}}{{/toLower}}_args, - Args{{#toUpper}}{{name}}{{/toUpper}}{{^last}},{{/last}} - {{/methods}} -}; -{{/methods.length}} -{{#propertyDeps.length}} - -{{#propertyDeps}} -use {{crate}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/propertyDeps}} -{{/propertyDeps.length}} - -{{^isInterface}} -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} {} - -impl {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - pub const URI: &'static str = "{{uri}}"; - - pub fn new() -> {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} {} - } - - {{#methods}} - pub fn {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(args: &Args{{#toUpper}}{{name}}{{/toUpper}}) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, String> { - let uri = {{#parent}}{{#toUpper}}{{type}}{{/toUpper}}{{/parent}}::URI; - let args = serialize_{{#toLower}}{{name}}{{/toLower}}_args(args).map_err(|e| e.to_string())?; - let result = subinvoke::wrap_subinvoke( - uri, - "{{name}}", - args, - )?; - deserialize_{{#toLower}}{{name}}{{/toLower}}_result(result.as_slice()).map_err(|e| e.to_string()) - } - {{^last}} - - {{/last}} - {{/methods}} -} -{{/isInterface}} -{{#isInterface}} -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#isInterface}}uri: String{{/isInterface}} -} - -impl {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - pub const INTERFACE_URI: &'static str = "{{uri}}"; - - pub fn new(uri: String) -> {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { uri } - } - - {{#methods}} - pub fn {{#toLower}}{{name}}{{/toLower}}(&self, args: &Args{{#toUpper}}{{name}}{{/toUpper}}) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, String> { - let ref uri = self.uri; - let args = serialize_{{#toLower}}{{name}}{{/toLower}}_args(args).map_err(|e| e.to_string())?; - let result = subinvoke::wrap_subinvoke( - uri.as_str(), - "{{name}}", - args, - )?; - deserialize_{{#toLower}}{{name}}{{/toLower}}_result(result.as_slice()).map_err(|e| e.to_string()) - } - {{^last}} - - {{/last}} - {{/methods}} -} -{{/isInterface}} \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/imported/module-type/serialization-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/imported/module-type/serialization-rs.mustache deleted file mode 100644 index c0f580c851..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/imported/module-type/serialization-rs.mustache +++ /dev/null @@ -1,268 +0,0 @@ -{{#methods.length}} -use serde::{Serialize, Deserialize}; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Context, - DecodeError, - EncodeError, - Read, - ReadDecoder, - Write, - WriteEncoder, - JSON, -}; -{{#propertyDeps.length}} - -{{#propertyDeps}} -{{^isEnum}} -use {{crate}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/isEnum}} -{{#isEnum}} -use crate::{ - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, - get_{{#toLower}}{{type}}{{/toLower}}_value, - sanitize_{{#toLower}}{{type}}{{/toLower}}_value -}; -{{/isEnum}} -{{/propertyDeps}} -{{/propertyDeps.length}} - -{{#methods}} -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Args{{#toUpper}}{{name}}{{/toUpper}} { - {{#arguments}} - {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}pub {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}}, - {{/arguments}} -} - -pub fn deserialize_{{#toLower}}{{name}}{{/toLower}}_args(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing imported module-type: {{#toLower}}{{name}}{{/toLower}} Args".to_string(); - - {{#arguments.length}} - let mut reader = ReadDecoder::new(args, context); - let mut num_of_fields = reader.read_map_length()?; - - {{#arguments}} - {{^object}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = {{#toWasmInit}}{{toGraphQLType}}{{/toWasmInit}}; - {{/object}} - {{#object}} - {{#required}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = {{#toWasmInit}}{{toGraphQLType}}{{/toWasmInit}}; - {{/required}} - {{^required}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = None; - {{/required}} - {{/object}} - {{#required}} - let mut _{{#toLower}}{{name}}{{/toLower}}_set = false; - {{/required}} - {{/arguments}} - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - {{#arguments}} - "{{name}}" => { - reader.context().push(&field, "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "type found, reading argument"); - {{#scalar}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}()?; - {{/scalar}} - {{#array}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - {{> deserialize_array_nobox}} - })?; - {{/array}} - {{#map}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - reader.read_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}() - }, |reader| { - {{> deserialize_map_value_nobox}} - })?; - {{/map}} - {{#enum}} - {{> deserialize_enum}} - _{{#toLower}}{{name}}{{/toLower}} = value; - {{/enum}} - {{#object}} - {{> deserialize_object_refmut}} - _{{#toLower}}{{name}}{{/toLower}} = object; - {{/object}} - {{#required}} - _{{#toLower}}{{name}}{{/toLower}}_set = true; - {{/required}} - reader.context().pop(); - } - {{/arguments}} - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - {{#arguments}} - {{#required}} - if !_{{#toLower}}{{name}}{{/toLower}}_set { - return Err(DecodeError::MissingField("{{name}}: {{type}}.".to_string())); - } - {{/required}} - {{/arguments}} - {{/arguments.length}} - - Ok(Args{{#toUpper}}{{name}}{{/toUpper}} { - {{#arguments}} - {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: _{{#toLower}}{{name}}{{/toLower}}, - {{/arguments}} - }) -} - -pub fn serialize_{{#toLower}}{{name}}{{/toLower}}_args(args: &Args{{#toUpper}}{{name}}{{/toUpper}}) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) imported module-type: {{#toLower}}{{name}}{{/toLower}} Args".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_{{#toLower}}{{name}}{{/toLower}}_args(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_{{#toLower}}{{name}}{{/toLower}}_args(args: &Args{{#toUpper}}{{name}}{{/toUpper}}, writer: &mut W) -> Result<(), EncodeError> { - {{#arguments.length}} - writer.write_map_length(&{{arguments.length}})?; - {{/arguments.length}} - {{^arguments}} - writer.write_map_length(&0)?; - {{/arguments}} - {{#arguments}} - writer.context().push("{{name}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property"); - writer.write_string("{{name}}")?; - {{#scalar}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}})?; - {{/scalar}} - {{#array}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, |writer, item| { - {{> serialize_array}} - })?; - {{/array}} - {{#map}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, |writer, key| { - writer.write_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}(key) - }, |writer, value| { - {{> serialize_map_value}} - })?; - {{/map}} - {{#enum}} - {{#required}} - writer.write_i32(&(args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}} as i32))?; - {{/required}} - {{^required}} - writer.write_optional_i32(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.map(|f| f as i32))?; - {{/required}} - {{/enum}} - {{#object}} - {{#required}} - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, writer)?; - {{/required}} - {{^required}} - if args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.is_some() { - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.as_ref().as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - {{/required}} - {{/object}} - writer.context().pop(); - {{/arguments}} - Ok(()) -} - -pub fn serialize_{{#toLower}}{{name}}{{/toLower}}_result(result: {{#return}}&{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) imported module-type: {{#toLower}}{{name}}{{/toLower}} Result".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_{{#toLower}}{{name}}{{/toLower}}_result(result, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_{{#toLower}}{{name}}{{/toLower}}_result(result: {{#return}}&{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, writer: &mut W) -> Result<(), EncodeError> { - {{#return}} - writer.context().push("{{name}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing result"); - {{#scalar}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(result)?; - {{/scalar}} - {{#array}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&result, |writer, item| { - {{> serialize_array}} - })?; - {{/array}} - {{#map}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&result, |writer, key| { - writer.write_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}(key) - }, |writer, value| { - {{> serialize_map_value}} - })?; - {{/map}} - {{#enum}} - {{#required}} - writer.write_i32(&(*result as i32))?; - {{/required}} - {{^required}} - writer.write_optional_i32(&result.map(|f| f as i32))?; - {{/required}} - {{/enum}} - {{#object}} - {{#required}} - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(&result, writer)?; - {{/required}} - {{^required}} - if result.is_some() { - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(result.as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - {{/required}} - {{/object}} - writer.context().pop(); - {{/return}} - Ok(()) -} - -pub fn deserialize_{{#toLower}}{{name}}{{/toLower}}_result(result: &[u8]) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, DecodeError> { - let mut context = Context::new(); - context.description = "Deserializing imported module-type: {{#toLower}}{{name}}{{/toLower}} Result".to_string(); - let mut reader = ReadDecoder::new(result, context); - - {{#return}} - reader.context().push("{{name}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "reading function output"); - {{#scalar}} - let res = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}()?; - {{/scalar}} - {{#array}} - let res = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - {{> deserialize_array_nobox}} - })?; - {{/array}} - {{#map}} - let res = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - reader.read_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}() - }, |reader| { - {{> deserialize_map_value_nobox}} - })?; - {{/map}} - {{#enum}} - {{> deserialize_enum}} - let res = value; - {{/enum}} - {{#object}} - {{> deserialize_object_refmut}} - let res = object; - {{/object}} - {{/return}} - reader.context().pop(); - Ok(res) -} -{{^last}} - -{{/last}} -{{/methods}} -{{/methods.length}} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/imported/object-type/mod-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/imported/object-type/mod-rs.mustache deleted file mode 100644 index 80312021cc..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/imported/object-type/mod-rs.mustache +++ /dev/null @@ -1,59 +0,0 @@ -use serde::{Serialize, Deserialize}; -pub mod serialization; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - DecodeError, - EncodeError, - Read, - Write, - JSON, -}; -pub use serialization::{ - deserialize_{{#toLower}}{{type}}{{/toLower}}, - read_{{#toLower}}{{type}}{{/toLower}}, - serialize_{{#toLower}}{{type}}{{/toLower}}, - write_{{#toLower}}{{type}}{{/toLower}} -}; -{{#propertyDeps.length}} - -{{#propertyDeps}} -use {{crate}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/propertyDeps}} -{{/propertyDeps.length}} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#properties}} - {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}pub {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}}, - {{/properties}} -} - -impl {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - pub const URI: &'static str = "{{uri}}"; - - pub fn new() -> {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#properties}} - {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasmInit}}{{toGraphQLType}}{{/toWasmInit}}, - {{/properties}} - } - } - - pub fn to_buffer(args: &{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}) -> Result, EncodeError> { - serialize_{{#toLower}}{{type}}{{/toLower}}(args).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn from_buffer(args: &[u8]) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, DecodeError> { - deserialize_{{#toLower}}{{type}}{{/toLower}}(args).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } - - pub fn write(args: &{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, writer: &mut W) -> Result<(), EncodeError> { - write_{{#toLower}}{{type}}{{/toLower}}(args, writer).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn read(reader: &mut R) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, DecodeError> { - read_{{#toLower}}{{type}}{{/toLower}}(reader).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } -} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/imported/object-type/serialization-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/imported/object-type/serialization-rs.mustache deleted file mode 100644 index 5c5d2f149a..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/imported/object-type/serialization-rs.mustache +++ /dev/null @@ -1,169 +0,0 @@ -use std::convert::TryFrom; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Context, - DecodeError, - EncodeError, - Read, - ReadDecoder, - Write, - WriteEncoder, - JSON, -}; -use crate::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{#propertyDeps.length}} - -{{/propertyDeps.length}}{{#propertyDeps}} -{{^isEnum}} -use {{crate}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/isEnum}} -{{#isEnum}} -use crate::{ - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, - get_{{#toLower}}{{type}}{{/toLower}}_value, - sanitize_{{#toLower}}{{type}}{{/toLower}}_value -}; -{{/isEnum}} -{{/propertyDeps}} - -pub fn serialize_{{#toLower}}{{type}}{{/toLower}}(args: &{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) imported object-type: {{#toUpper}}{{type}}{{/toUpper}}".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_{{#toLower}}{{type}}{{/toLower}}(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_{{#toLower}}{{type}}{{/toLower}}(args: &{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, writer: &mut W) -> Result<(), EncodeError> { - {{#properties.length}} - writer.write_map_length(&{{properties.length}})?; - {{/properties.length}} - {{^properties}} - writer.write_map_length(&0)?; - {{/properties}} - {{#properties}} - writer.context().push("{{name}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property"); - writer.write_string("{{name}}")?; - {{#scalar}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}})?; - {{/scalar}} - {{#array}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, |writer, item| { - {{> serialize_array}} - })?; - {{/array}} - {{#map}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, |writer, key| { - writer.write_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}(key) - }, |writer, value| { - {{> serialize_map_value}} - })?; - {{/map}} - {{#object}} - {{#required}} - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, writer)?; - {{/required}} - {{^required}} - if args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.is_some() { - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.as_ref().as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - {{/required}} - {{/object}} - {{#enum}} - {{#required}} - writer.write_i32(&(args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}} as i32))?; - {{/required}} - {{^required}} - writer.write_optional_i32(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.map(|f| f as i32))?; - {{/required}} - {{/enum}} - writer.context().pop(); - {{/properties}} - Ok(()) -} - -pub fn deserialize_{{#toLower}}{{type}}{{/toLower}}(args: &[u8]) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, DecodeError> { - let mut context = Context::new(); - context.description = "Deserializing imported object-type: {{#toUpper}}{{type}}{{/toUpper}}".to_string(); - let mut reader = ReadDecoder::new(args, context); - read_{{#toLower}}{{type}}{{/toLower}}(&mut reader) -} - -pub fn read_{{#toLower}}{{type}}{{/toLower}}(reader: &mut R) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, DecodeError> { - let mut num_of_fields = reader.read_map_length()?; - - {{#properties}} - {{^object}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = {{#toWasmInit}}{{toGraphQLType}}{{/toWasmInit}}; - {{/object}} - {{#object}} - {{#required}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = {{#toWasmInit}}{{toGraphQLType}}{{/toWasmInit}}; - {{/required}} - {{^required}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = None; - {{/required}} - {{/object}} - {{#required}} - let mut _{{#toLower}}{{name}}{{/toLower}}_set = false; - {{/required}} - {{/properties}} - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - {{#properties}} - "{{name}}" => { - reader.context().push(&field, "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "type found, reading property"); - {{#scalar}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}()?; - {{/scalar}} - {{#array}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - {{> deserialize_array_nobox}} - })?; - {{/array}} - {{#map}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - reader.read_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}() - }, |reader| { - {{> deserialize_map_value_nobox}} - })?; - {{/map}} - {{#enum}} - {{> deserialize_enum}} - _{{#toLower}}{{name}}{{/toLower}} = value; - {{/enum}} - {{#object}} - {{> deserialize_object_nobox}} - _{{#toLower}}{{name}}{{/toLower}} = object; - {{/object}} - {{#required}} - _{{#toLower}}{{name}}{{/toLower}}_set = true; - {{/required}} - reader.context().pop(); - } - {{/properties}} - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - {{#properties}} - {{#required}} - if !_{{#toLower}}{{name}}{{/toLower}}_set { - return Err(DecodeError::MissingField("{{name}}: {{type}}.".to_string())); - } - {{/required}} - {{/properties}} - - Ok({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#properties}} - {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: _{{#toLower}}{{name}}{{/toLower}}, - {{/properties}} - }) -} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/interface-type/mod-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/interface-type/mod-rs.mustache deleted file mode 100644 index 3235c088b4..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/interface-type/mod-rs.mustache +++ /dev/null @@ -1,23 +0,0 @@ -{{#capabilities}} -{{#getImplementations}} -{{#enabled}} -use polywrap_wasm_rs::wrap_get_implementations; -{{/enabled}} -{{/getImplementations}} -{{/capabilities}} - -pub struct {{#detectKeyword}}{{#toUpper}}{{namespace}}{{/toUpper}}{{/detectKeyword}} {} - -impl {{#detectKeyword}}{{#toUpper}}{{namespace}}{{/toUpper}}{{/detectKeyword}} { - const uri: &'static str = "{{uri}}"; - - {{#capabilities}} - {{#getImplementations}} - {{#enabled}} - pub fn get_implementations() -> Vec { - wrap_get_implementations(Self::uri) - } - {{/enabled}} - {{/getImplementations}} - {{/capabilities}} -} \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/mod-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/mod-rs.mustache deleted file mode 100644 index 4995ae44f4..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/mod-rs.mustache +++ /dev/null @@ -1,61 +0,0 @@ -pub mod entry; -{{#objectTypes}} -pub mod {{#detectKeyword}}{{#toLower}}{{type}}{{/toLower}}{{/detectKeyword}}; -pub use {{#detectKeyword}}{{#toLower}}{{type}}{{/toLower}}{{/detectKeyword}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/objectTypes}} -{{#enumTypes}} -pub mod {{#detectKeyword}}{{#toLower}}{{type}}{{/toLower}}{{/detectKeyword}}; -pub use {{#detectKeyword}}{{#toLower}}{{type}}{{/toLower}}{{/detectKeyword}}::{ - get_{{#toLower}}{{type}}{{/toLower}}_key, - get_{{#toLower}}{{type}}{{/toLower}}_value, - sanitize_{{#toLower}}{{type}}{{/toLower}}_value, - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} -}; -{{/enumTypes}} -{{#envType}} -pub mod {{#detectKeyword}}{{#toLower}}{{type}}{{/toLower}}{{/detectKeyword}}; -pub use {{#detectKeyword}}{{#toLower}}{{type}}{{/toLower}}{{/detectKeyword}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/envType}} -{{#hasImports}} -pub mod imported; -{{/hasImports}} -{{#importedObjectTypes}} -pub use imported::{{#detectKeyword}}{{#toLower}}{{type}}{{/toLower}}{{/detectKeyword}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/importedObjectTypes}} -{{#importedEnumTypes}} -pub use imported::{{#detectKeyword}}{{#toLower}}{{type}}{{/toLower}}{{/detectKeyword}}::{ - get_{{#toLower}}{{type}}{{/toLower}}_key, - get_{{#toLower}}{{type}}{{/toLower}}_value, - sanitize_{{#toLower}}{{type}}{{/toLower}}_value, - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} -}; -{{/importedEnumTypes}} -{{#importedEnvTypes}} -pub use imported::{{#detectKeyword}}{{#toLower}}{{type}}{{/toLower}}{{/detectKeyword}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/importedEnvTypes}} -{{#importedModuleTypes}} -pub use imported::{{#detectKeyword}}{{#toLower}}{{type}}{{/toLower}}{{/detectKeyword}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/importedModuleTypes}} -{{#interfaceTypes}} -pub mod {{#detectKeyword}}{{#toLower}}{{namespace}}{{/toLower}}{{/detectKeyword}}; -pub use {{#detectKeyword}}{{#toLower}}{{namespace}}{{/toLower}}{{/detectKeyword}}::{{#detectKeyword}}{{#toUpper}}{{namespace}}{{/toUpper}}{{/detectKeyword}}; -{{/interfaceTypes}} -{{#moduleType}} -pub mod {{#detectKeyword}}{{#toLower}}{{type}}{{/toLower}}{{/detectKeyword}}; -pub use {{#detectKeyword}}{{#toLower}}{{type}}{{/toLower}}{{/detectKeyword}}::{ - Module, - ModuleTrait, - {{#methods}} - deserialize_{{#toLower}}{{name}}{{/toLower}}_args, - serialize_{{#toLower}}{{name}}{{/toLower}}_result, - {{#toLower}}{{name}}{{/toLower}}_wrapped, - Args{{#toUpper}}{{name}}{{/toUpper}}{{^last}},{{/last}} - {{/methods}} -}; -{{/moduleType}} - -// Override print!(...) & println!(...) macros -#[macro_export] -macro_rules! println { ($($args:tt)*) => { polywrap_wasm_rs::wrap_debug_log(format!($($args)*).as_str()); } } -#[macro_export] -macro_rules! print { ($($args:tt)*) => { polywrap_wasm_rs::wrap_debug_log(format!($($args)*).as_str()); } } diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/module-type/mod-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/module-type/mod-rs.mustache deleted file mode 100644 index ed7476933f..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/module-type/mod-rs.mustache +++ /dev/null @@ -1,21 +0,0 @@ -{{#moduleType}} -{{#methods.length}} -pub mod wrapped; -pub use wrapped::{ - {{#methods}} - {{#toLower}}{{name}}{{/toLower}}_wrapped{{^last}},{{/last}} - {{/methods}} -}; -pub mod serialization; -pub use serialization::{ - {{#methods}} - deserialize_{{#toLower}}{{name}}{{/toLower}}_args, - serialize_{{#toLower}}{{name}}{{/toLower}}_result, - Args{{#toUpper}}{{name}}{{/toUpper}}{{^last}},{{/last}} - {{/methods}} -}; -{{/methods.length}} - -pub mod module; -pub use module::*; -{{/moduleType}} \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/module-type/module-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/module-type/module-rs.mustache deleted file mode 100644 index 1e4490872b..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/module-type/module-rs.mustache +++ /dev/null @@ -1,37 +0,0 @@ -{{#moduleType}} -use crate::{ - {{#methods}} - Args{{#toUpper}}{{name}}{{/toUpper}}, - {{/methods}} -}; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - JSON, -}; -{{#propertyDeps.length}} - -{{#propertyDeps}} -{{^isEnum}} -use {{crate}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/isEnum}} -{{#isEnum}} -use crate::{ - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, -}; -{{/isEnum}} -{{/propertyDeps}} -{{/propertyDeps.length}} - -pub struct Module; - -pub trait ModuleTrait { - {{#methods}} - fn {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(args: Args{{#toUpper}}{{name}}{{/toUpper}}{{#env}}, env: {{#required}}Env{{/required}}{{^required}}Option{{/required}}{{/env}}) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, String>; - {{^last}} - - {{/last}} - {{/methods}} -} -{{/moduleType}} \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/module-type/serialization-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/module-type/serialization-rs.mustache deleted file mode 100644 index 2b94133316..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/module-type/serialization-rs.mustache +++ /dev/null @@ -1,269 +0,0 @@ -{{#moduleType}} -use serde::{Serialize, Deserialize}; -use std::convert::TryFrom; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Context, - DecodeError, - EncodeError, - Read, - ReadDecoder, - Write, - WriteEncoder, - JSON, -}; -{{#propertyDeps.length}} - -{{#propertyDeps}} -{{^isEnum}} -use {{crate}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/isEnum}} -{{#isEnum}} -use crate::{ - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, - get_{{#toLower}}{{type}}{{/toLower}}_value, - sanitize_{{#toLower}}{{type}}{{/toLower}}_value -}; -{{/isEnum}} -{{/propertyDeps}} -{{/propertyDeps.length}} - -{{#methods}} -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Args{{#toUpper}}{{name}}{{/toUpper}} { - {{#arguments}} - {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}pub {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}}, - {{/arguments}} -} - -pub fn deserialize_{{#toLower}}{{name}}{{/toLower}}_args(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing module-type: {{#toLower}}{{name}}{{/toLower}} Args".to_string(); - - {{#arguments.length}} - let mut reader = ReadDecoder::new(args, context); - let mut num_of_fields = reader.read_map_length()?; - - {{#arguments}} - {{^object}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = {{#toWasmInit}}{{toGraphQLType}}{{/toWasmInit}}; - {{/object}} - {{#object}} - {{#required}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = {{#toWasmInit}}{{toGraphQLType}}{{/toWasmInit}}; - {{/required}} - {{^required}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = None; - {{/required}} - {{/object}} - {{#required}} - let mut _{{#toLower}}{{name}}{{/toLower}}_set = false; - {{/required}} - {{/arguments}} - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - {{#arguments}} - "{{name}}" => { - reader.context().push(&field, "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "type found, reading argument"); - {{#scalar}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}()?; - {{/scalar}} - {{#array}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - {{> deserialize_array_nobox}} - })?; - {{/array}} - {{#map}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - reader.read_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}() - }, |reader| { - {{> deserialize_map_value_nobox}} - })?; - {{/map}} - {{#enum}} - {{> deserialize_enum}} - _{{#toLower}}{{name}}{{/toLower}} = value; - {{/enum}} - {{#object}} - {{> deserialize_object_refmut}} - _{{#toLower}}{{name}}{{/toLower}} = object; - {{/object}} - {{#required}} - _{{#toLower}}{{name}}{{/toLower}}_set = true; - {{/required}} - reader.context().pop(); - } - {{/arguments}} - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - {{#arguments}} - {{#required}} - if !_{{#toLower}}{{name}}{{/toLower}}_set { - return Err(DecodeError::MissingField("{{name}}: {{type}}.".to_string())); - } - {{/required}} - {{/arguments}} - {{/arguments.length}} - - Ok(Args{{#toUpper}}{{name}}{{/toUpper}} { - {{#arguments}} - {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: _{{#toLower}}{{name}}{{/toLower}}, - {{/arguments}} - }) -} - -pub fn serialize_{{#toLower}}{{name}}{{/toLower}}_args(args: &Args{{#toUpper}}{{name}}{{/toUpper}}) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) module-type: {{#toLower}}{{name}}{{/toLower}} Args".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_{{#toLower}}{{name}}{{/toLower}}_args(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_{{#toLower}}{{name}}{{/toLower}}_args(args: &Args{{#toUpper}}{{name}}{{/toUpper}}, writer: &mut W) -> Result<(), EncodeError> { - {{#arguments.length}} - writer.write_map_length(&{{arguments.length}})?; - {{/arguments.length}} - {{^arguments}} - writer.write_map_length(&0)?; - {{/arguments}} - {{#arguments}} - writer.context().push("{{name}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property"); - writer.write_string("{{name}}")?; - {{#scalar}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}})?; - {{/scalar}} - {{#array}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, |writer, item| { - {{> serialize_array}} - })?; - {{/array}} - {{#map}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, |writer, key| { - writer.write_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}(key) - }, |writer, value| { - {{> serialize_map_value}} - })?; - {{/map}} - {{#enum}} - {{#required}} - writer.write_i32(&(args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}} as i32))?; - {{/required}} - {{^required}} - writer.write_optional_i32(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.map(|f| f as i32))?; - {{/required}} - {{/enum}} - {{#object}} - {{#required}} - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, writer)?; - {{/required}} - {{^required}} - if args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.is_some() { - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.as_ref().as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - {{/required}} - {{/object}} - writer.context().pop(); - {{/arguments}} - Ok(()) -} - -pub fn serialize_{{#toLower}}{{name}}{{/toLower}}_result(result: {{#return}}&{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) module-type: {{#toLower}}{{name}}{{/toLower}} Result".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_{{#toLower}}{{name}}{{/toLower}}_result(result, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_{{#toLower}}{{name}}{{/toLower}}_result(result: {{#return}}&{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, writer: &mut W) -> Result<(), EncodeError> { - {{#return}} - writer.context().push("{{name}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing result"); - {{#scalar}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(result)?; - {{/scalar}} - {{#array}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&result, |writer, item| { - {{> serialize_array}} - })?; - {{/array}} - {{#map}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&result, |writer, key| { - writer.write_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}(key) - }, |writer, value| { - {{> serialize_map_value}} - })?; - {{/map}} - {{#enum}} - {{#required}} - writer.write_i32(&(*result as i32))?; - {{/required}} - {{^required}} - writer.write_optional_i32(&result.map(|f| f as i32))?; - {{/required}} - {{/enum}} - {{#object}} - {{#required}} - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(&result, writer)?; - {{/required}} - {{^required}} - if result.is_some() { - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(result.as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - {{/required}} - {{/object}} - writer.context().pop(); - {{/return}} - Ok(()) -} - -pub fn deserialize_{{#toLower}}{{name}}{{/toLower}}_result(result: &[u8]) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, DecodeError> { - let mut context = Context::new(); - context.description = "Deserializing module-type: {{#toLower}}{{name}}{{/toLower}} Result".to_string(); - let mut reader = ReadDecoder::new(result, context); - - {{#return}} - reader.context().push("{{name}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "reading function output"); - {{#scalar}} - let res = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}()?; - {{/scalar}} - {{#array}} - let res = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - {{> deserialize_array_nobox}} - })?; - {{/array}} - {{#map}} - let res = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - reader.read_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}() - }, |reader| { - {{> deserialize_map_value_nobox}} - })?; - {{/map}} - {{#enum}} - {{> deserialize_enum}} - let res = value; - {{/enum}} - {{#object}} - {{> deserialize_object_refmut}} - let res = object; - {{/object}} - {{/return}} - reader.context().pop(); - Ok(res) -} -{{^last}} - -{{/last}} -{{/methods}} -{{/moduleType}} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/module-type/wrapped-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/module-type/wrapped-rs.mustache deleted file mode 100644 index 1ab6becd14..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/module-type/wrapped-rs.mustache +++ /dev/null @@ -1,71 +0,0 @@ -{{#moduleType}} -{{#methods.length}} -use polywrap_wasm_rs::{ - wrap_load_env -}; - -use crate::{ - {{#methods}} - Args{{#toUpper}}{{name}}{{/toUpper}}, - deserialize_{{#toLower}}{{name}}{{/toLower}}_args, - serialize_{{#toLower}}{{name}}{{/toLower}}_result{{^last}},{{/last}} - {{/methods}} -}; -{{/methods.length}} - -use crate::module::{ModuleTrait, Module}; -{{#envType}} -use crate::Env; -{{/envType}} - -{{#methods}} -pub fn {{#toLower}}{{name}}{{/toLower}}_wrapped(args: &[u8], env_size: u32) -> Vec { - {{#env}} - {{#required}} - if env_size == 0 { - panic!("Environment is not set, and it is required by method '{{name}}'"); - } - - let env_buf = wrap_load_env(env_size); - let env = Env::from_buffer(&env_buf).unwrap(); - - {{/required}} - {{^required}} - let mut env: Option = None; - if env_size > 0 { - let env_buf = wrap_load_env(env_size); - env = Some(Env::from_buffer(&env_buf).unwrap()); - } - - {{/required}} - {{/env}} - {{#arguments.length}} - match deserialize_{{#toLower}}{{name}}{{/toLower}}_args(args) { - Ok(args) => { - {{/arguments.length}} - let result = Module::{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(Args{{#toUpper}}{{name}}{{/toUpper}} { - {{#arguments}} - {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, - {{/arguments}} - }{{#env}}, env{{/env}}); - match result { - Ok(res) => { - serialize_{{#toLower}}{{name}}{{/toLower}}_result({{#return}}&{{/return}}res).unwrap() - } - Err(e) => { - panic!("{}", e.to_string()) - } - } - {{#arguments.length}} - } - Err(e) => { - panic!("{}", e.to_string()) - } - } - {{/arguments.length}} -} -{{^last}} - -{{/last}} -{{/methods}} -{{/moduleType}} \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/object-type/mod-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/object-type/mod-rs.mustache deleted file mode 100644 index 1dc58d4cb4..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/object-type/mod-rs.mustache +++ /dev/null @@ -1,55 +0,0 @@ -use serde::{Serialize, Deserialize}; -pub mod serialization; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - DecodeError, - EncodeError, - Read, - Write, - JSON, -}; -pub use serialization::{ - deserialize_{{#toLower}}{{type}}{{/toLower}}, - read_{{#toLower}}{{type}}{{/toLower}}, - serialize_{{#toLower}}{{type}}{{/toLower}}, - write_{{#toLower}}{{type}}{{/toLower}} -}; - -{{#propertyDeps}} -use {{crate}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/propertyDeps}} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#properties}} - {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}pub {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}}, - {{/properties}} -} - -impl {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - pub fn new() -> {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#properties}} - {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasmInit}}{{toGraphQLType}}{{/toWasmInit}}, - {{/properties}} - } - } - - pub fn to_buffer(args: &{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}) -> Result, EncodeError> { - serialize_{{#toLower}}{{type}}{{/toLower}}(args).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn from_buffer(args: &[u8]) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, DecodeError> { - deserialize_{{#toLower}}{{type}}{{/toLower}}(args).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } - - pub fn write(args: &{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, writer: &mut W) -> Result<(), EncodeError> { - write_{{#toLower}}{{type}}{{/toLower}}(args, writer).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn read(reader: &mut R) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, DecodeError> { - read_{{#toLower}}{{type}}{{/toLower}}(reader).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } -} diff --git a/packages/schema/bind/src/bindings/rust/wasm/templates/object-type/serialization-rs.mustache b/packages/schema/bind/src/bindings/rust/wasm/templates/object-type/serialization-rs.mustache deleted file mode 100644 index 0743b3c9f3..0000000000 --- a/packages/schema/bind/src/bindings/rust/wasm/templates/object-type/serialization-rs.mustache +++ /dev/null @@ -1,169 +0,0 @@ -use std::convert::TryFrom; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Context, - DecodeError, - EncodeError, - Read, - ReadDecoder, - Write, - WriteEncoder, - JSON, -}; -use crate::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{#propertyDeps.length}} - -{{/propertyDeps.length}}{{#propertyDeps}} -{{^isEnum}} -use {{crate}}::{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}; -{{/isEnum}} -{{#isEnum}} -use crate::{ - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, - get_{{#toLower}}{{type}}{{/toLower}}_value, - sanitize_{{#toLower}}{{type}}{{/toLower}}_value -}; -{{/isEnum}} -{{/propertyDeps}} - -pub fn serialize_{{#toLower}}{{type}}{{/toLower}}(args: &{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) object-type: {{#toUpper}}{{type}}{{/toUpper}}".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_{{#toLower}}{{type}}{{/toLower}}(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_{{#toLower}}{{type}}{{/toLower}}(args: &{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, writer: &mut W) -> Result<(), EncodeError> { - {{#properties.length}} - writer.write_map_length(&{{properties.length}})?; - {{/properties.length}} - {{^properties}} - writer.write_map_length(&0)?; - {{/properties}} - {{#properties}} - writer.context().push("{{name}}", "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "writing property"); - writer.write_string("{{name}}")?; - {{#scalar}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}})?; - {{/scalar}} - {{#array}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, |writer, item| { - {{> serialize_array}} - })?; - {{/array}} - {{#map}} - writer.write_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, |writer, key| { - writer.write_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}(key) - }, |writer, value| { - {{> serialize_map_value}} - })?; - {{/map}} - {{#object}} - {{#required}} - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, writer)?; - {{/required}} - {{^required}} - if args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.is_some() { - {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}::write(args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.as_ref().as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - {{/required}} - {{/object}} - {{#enum}} - {{#required}} - writer.write_i32(&(args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}} as i32))?; - {{/required}} - {{^required}} - writer.write_optional_i32(&args.{{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}.map(|f| f as i32))?; - {{/required}} - {{/enum}} - writer.context().pop(); - {{/properties}} - Ok(()) -} - -pub fn deserialize_{{#toLower}}{{type}}{{/toLower}}(args: &[u8]) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, DecodeError> { - let mut context = Context::new(); - context.description = "Deserializing object-type: {{#toUpper}}{{type}}{{/toUpper}}".to_string(); - let mut reader = ReadDecoder::new(args, context); - read_{{#toLower}}{{type}}{{/toLower}}(&mut reader) -} - -pub fn read_{{#toLower}}{{type}}{{/toLower}}(reader: &mut R) -> Result<{{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}, DecodeError> { - let mut num_of_fields = reader.read_map_length()?; - - {{#properties}} - {{^object}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = {{#toWasmInit}}{{toGraphQLType}}{{/toWasmInit}}; - {{/object}} - {{#object}} - {{#required}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = {{#toWasmInit}}{{toGraphQLType}}{{/toWasmInit}}; - {{/required}} - {{^required}} - let mut _{{#toLower}}{{name}}{{/toLower}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}} = None; - {{/required}} - {{/object}} - {{#required}} - let mut _{{#toLower}}{{name}}{{/toLower}}_set = false; - {{/required}} - {{/properties}} - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - {{#properties}} - "{{name}}" => { - reader.context().push(&field, "{{#toWasm}}{{toGraphQLType}}{{/toWasm}}", "type found, reading property"); - {{#scalar}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}()?; - {{/scalar}} - {{#array}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - {{> deserialize_array_nobox}} - })?; - {{/array}} - {{#map}} - _{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| { - reader.read_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}() - }, |reader| { - {{> deserialize_map_value_nobox}} - })?; - {{/map}} - {{#enum}} - {{> deserialize_enum}} - _{{#toLower}}{{name}}{{/toLower}} = value; - {{/enum}} - {{#object}} - {{> deserialize_object_nobox}} - _{{#toLower}}{{name}}{{/toLower}} = object; - {{/object}} - {{#required}} - _{{#toLower}}{{name}}{{/toLower}}_set = true; - {{/required}} - reader.context().pop(); - } - {{/properties}} - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - {{#properties}} - {{#required}} - if !_{{#toLower}}{{name}}{{/toLower}}_set { - return Err(DecodeError::MissingField("{{name}}: {{type}}.".to_string())); - } - {{/required}} - {{/properties}} - - Ok({{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { - {{#properties}} - {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: _{{#toLower}}{{name}}{{/toLower}}, - {{/properties}} - }) -} diff --git a/packages/templates/plugin/rust/Cargo.toml b/packages/templates/plugin/rust/Cargo.toml index 1715867d8b..347cd75813 100644 --- a/packages/templates/plugin/rust/Cargo.toml +++ b/packages/templates/plugin/rust/Cargo.toml @@ -11,10 +11,11 @@ include = [ ] [dependencies] -polywrap_core = { version = "0.1.6-beta.1" } -polywrap_plugin = { version = "0.1.6-beta.1" } -polywrap_msgpack = { version = "0.1.6-beta.1" } -wrap_manifest_schemas = { version = "0.1.6-beta.1" } +polywrap_core = { version = "~0.1.6-beta.1" } +polywrap_plugin = { version = "~0.1.6-beta.1" } +polywrap_msgpack = { version = "~0.1.6-beta.1" } +polywrap_msgpack_serde = { version = "~0.0.2-beta.1" } +wrap_manifest_schemas = { version = "~0.1.6-beta.1" } serde = {version = "1.0.145", features = ["derive"]} [dev-dependencies] diff --git a/packages/templates/plugin/rust/src/lib.rs b/packages/templates/plugin/rust/src/lib.rs index 73e8c4539c..6fc1dc2105 100644 --- a/packages/templates/plugin/rust/src/lib.rs +++ b/packages/templates/plugin/rust/src/lib.rs @@ -1,5 +1,5 @@ use crate::wrap::wrap_info::get_manifest; -use polywrap_core::invoke::Invoker; +use polywrap_core::invoker::Invoker; use polywrap_plugin::{error::PluginError, implementor::plugin_impl, JSON}; use wrap::{ module::{ArgsSampleMethod, Module}, diff --git a/packages/templates/plugin/rust/tests/e2e.rs b/packages/templates/plugin/rust/tests/e2e.rs index e0dbf56088..9c16e8b54b 100644 --- a/packages/templates/plugin/rust/tests/e2e.rs +++ b/packages/templates/plugin/rust/tests/e2e.rs @@ -1,16 +1,13 @@ use template_plugin_rs::SamplePlugin; use polywrap_core::{ client::ClientConfig, - resolvers::{ - static_resolver::{StaticResolver, StaticResolverLike}, - uri_resolution_context::UriPackage, - }, uri::Uri, }; use polywrap_msgpack::{msgpack}; use polywrap_plugin::{package::PluginPackage}; use polywrap_client::{ client::PolywrapClient, + builder::{PolywrapClientConfig, PolywrapClientConfigBuilder}, }; use std::{ sync::{Arc, Mutex}, @@ -18,19 +15,15 @@ use std::{ fn get_client() -> PolywrapClient { let sample_plugin = SamplePlugin {}; - let plugin_pkg: PluginPackage = sample_plugin.into(); - let package = Arc::new(Mutex::new(plugin_pkg)); + let plugin_pkg = PluginPackage::::from(sample_plugin); - let resolver = StaticResolver::from(vec![StaticResolverLike::Package(UriPackage { - uri: Uri::try_from("plugin/sample").unwrap(), - package, - })]); + let mut config = PolywrapClientConfig::new(); + config.add_package( + Uri::try_from("plugin/sample").unwrap(), + Arc::new(plugin_pkg) + ); - PolywrapClient::new(ClientConfig { - resolver: Arc::new(resolver), - interfaces: None, - envs: None, - }) + PolywrapClient::new(config.into()) } #[test] diff --git a/packages/templates/tests.spec.ts b/packages/templates/tests.spec.ts index 395fb12314..eb5b8d3937 100644 --- a/packages/templates/tests.spec.ts +++ b/packages/templates/tests.spec.ts @@ -36,8 +36,8 @@ describe("Templates", () => { }, "plugin/rust": { codegen: "npx polywrap codegen", - build: "cargo build", - test: "cargo test", + /*build: "cargo build", + test: "cargo test",*/ }, interface: { build: "npx polywrap build" }, }; diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/_else/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/_else/mod.rs index d474a4a346..1e13036df9 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/_else/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/_else/mod.rs @@ -1,23 +1,15 @@ use serde::{Serialize, Deserialize}; -pub mod serialization; +use polywrap_msgpack_serde::{ + wrappers::polywrap_json::JSONString, + wrappers::polywrap_bigint::BigIntWrapper +}; use polywrap_wasm_rs::{ BigInt, BigNumber, Map, - DecodeError, - EncodeError, - Read, - Write, - JSON, -}; -pub use serialization::{ - deserialize_else, - read_else, - serialize_else, - write_else + JSON }; - #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Else { #[serde(rename = "else")] @@ -30,20 +22,4 @@ impl Else { _else: String::new(), } } - - pub fn to_buffer(args: &Else) -> Result, EncodeError> { - serialize_else(args).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn from_buffer(args: &[u8]) -> Result { - deserialize_else(args).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } - - pub fn write(args: &Else, writer: &mut W) -> Result<(), EncodeError> { - write_else(args, writer).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn read(reader: &mut R) -> Result { - read_else(reader).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } } diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/_else/serialization.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/_else/serialization.rs deleted file mode 100644 index 5e0481623e..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/_else/serialization.rs +++ /dev/null @@ -1,68 +0,0 @@ -use std::convert::TryFrom; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Context, - DecodeError, - EncodeError, - Read, - ReadDecoder, - Write, - WriteEncoder, - JSON, -}; -use crate::Else; - -pub fn serialize_else(args: &Else) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) object-type: Else".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_else(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_else(args: &Else, writer: &mut W) -> Result<(), EncodeError> { - writer.write_map_length(&1)?; - writer.context().push("else", "String", "writing property"); - writer.write_string("else")?; - writer.write_string(&args._else)?; - writer.context().pop(); - Ok(()) -} - -pub fn deserialize_else(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing object-type: Else".to_string(); - let mut reader = ReadDecoder::new(args, context); - read_else(&mut reader) -} - -pub fn read_else(reader: &mut R) -> Result { - let mut num_of_fields = reader.read_map_length()?; - - let mut _else: String = String::new(); - let mut _else_set = false; - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - "else" => { - reader.context().push(&field, "String", "type found, reading property"); - _else = reader.read_string()?; - _else_set = true; - reader.context().pop(); - } - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - if !_else_set { - return Err(DecodeError::MissingField("else: String.".to_string())); - } - - Ok(Else { - _else: _else, - }) -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/_while/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/_while/mod.rs index a17acc23f4..94f61f4505 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/_while/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/_while/mod.rs @@ -4,7 +4,9 @@ use std::convert::TryFrom; #[derive(Clone, Copy, Debug, Deserialize, Serialize)] pub enum While { + #[serde(rename = "for")] _for, + #[serde(rename = "in")] _in, _MAX_ } diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/another_type/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/another_type/mod.rs index 15091a2e37..171fa6448a 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/another_type/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/another_type/mod.rs @@ -1,22 +1,14 @@ use serde::{Serialize, Deserialize}; -pub mod serialization; +use polywrap_msgpack_serde::{ + wrappers::polywrap_json::JSONString, + wrappers::polywrap_bigint::BigIntWrapper +}; use polywrap_wasm_rs::{ BigInt, BigNumber, Map, - DecodeError, - EncodeError, - Read, - Write, - JSON, -}; -pub use serialization::{ - deserialize_another_type, - read_another_type, - serialize_another_type, - write_another_type + JSON }; - use crate::CustomType; #[derive(Clone, Debug, Deserialize, Serialize)] @@ -35,20 +27,4 @@ impl AnotherType { _const: None, } } - - pub fn to_buffer(args: &AnotherType) -> Result, EncodeError> { - serialize_another_type(args).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn from_buffer(args: &[u8]) -> Result { - deserialize_another_type(args).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } - - pub fn write(args: &AnotherType, writer: &mut W) -> Result<(), EncodeError> { - write_another_type(args, writer).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn read(reader: &mut R) -> Result { - read_another_type(reader).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } } diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/another_type/serialization.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/another_type/serialization.rs deleted file mode 100644 index f8c50b4675..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/another_type/serialization.rs +++ /dev/null @@ -1,97 +0,0 @@ -use std::convert::TryFrom; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Context, - DecodeError, - EncodeError, - Read, - ReadDecoder, - Write, - WriteEncoder, - JSON, -}; -use crate::AnotherType; - -use crate::CustomType; - -pub fn serialize_another_type(args: &AnotherType) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) object-type: AnotherType".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_another_type(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_another_type(args: &AnotherType, writer: &mut W) -> Result<(), EncodeError> { - writer.write_map_length(&3)?; - writer.context().push("prop", "Option", "writing property"); - writer.write_string("prop")?; - writer.write_optional_string(&args.prop)?; - writer.context().pop(); - writer.context().push("circular", "Option", "writing property"); - writer.write_string("circular")?; - if args.circular.is_some() { - CustomType::write(args.circular.as_ref().as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - writer.context().pop(); - writer.context().push("const", "Option", "writing property"); - writer.write_string("const")?; - writer.write_optional_string(&args._const)?; - writer.context().pop(); - Ok(()) -} - -pub fn deserialize_another_type(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing object-type: AnotherType".to_string(); - let mut reader = ReadDecoder::new(args, context); - read_another_type(&mut reader) -} - -pub fn read_another_type(reader: &mut R) -> Result { - let mut num_of_fields = reader.read_map_length()?; - - let mut _prop: Option = None; - let mut _circular: Option = None; - let mut _const: Option = None; - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - "prop" => { - reader.context().push(&field, "Option", "type found, reading property"); - _prop = reader.read_optional_string()?; - reader.context().pop(); - } - "circular" => { - reader.context().push(&field, "Option", "type found, reading property"); - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(CustomType::read(reader)?); - } else { - object = None; - } - _circular = object; - reader.context().pop(); - } - "const" => { - reader.context().push(&field, "Option", "type found, reading property"); - _const = reader.read_optional_string()?; - reader.context().pop(); - } - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - - Ok(AnotherType { - prop: _prop, - circular: _circular, - _const: _const, - }) -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_enum/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_enum/mod.rs index dd8f6bb187..477827bda7 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_enum/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_enum/mod.rs @@ -4,7 +4,9 @@ use std::convert::TryFrom; #[derive(Clone, Copy, Debug, Deserialize, Serialize)] pub enum CustomEnum { + #[serde(rename = "STRING")] STRING, + #[serde(rename = "BYTES")] BYTES, _MAX_ } diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_map_value/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_map_value/mod.rs index e8c525f0ea..29689350bb 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_map_value/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_map_value/mod.rs @@ -1,23 +1,15 @@ use serde::{Serialize, Deserialize}; -pub mod serialization; +use polywrap_msgpack_serde::{ + wrappers::polywrap_json::JSONString, + wrappers::polywrap_bigint::BigIntWrapper +}; use polywrap_wasm_rs::{ BigInt, BigNumber, Map, - DecodeError, - EncodeError, - Read, - Write, - JSON, -}; -pub use serialization::{ - deserialize_custom_map_value, - read_custom_map_value, - serialize_custom_map_value, - write_custom_map_value + JSON }; - #[derive(Clone, Debug, Deserialize, Serialize)] pub struct CustomMapValue { pub foo: String, @@ -29,20 +21,4 @@ impl CustomMapValue { foo: String::new(), } } - - pub fn to_buffer(args: &CustomMapValue) -> Result, EncodeError> { - serialize_custom_map_value(args).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn from_buffer(args: &[u8]) -> Result { - deserialize_custom_map_value(args).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } - - pub fn write(args: &CustomMapValue, writer: &mut W) -> Result<(), EncodeError> { - write_custom_map_value(args, writer).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn read(reader: &mut R) -> Result { - read_custom_map_value(reader).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } } diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_map_value/serialization.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_map_value/serialization.rs deleted file mode 100644 index aafbc308bd..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_map_value/serialization.rs +++ /dev/null @@ -1,68 +0,0 @@ -use std::convert::TryFrom; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Context, - DecodeError, - EncodeError, - Read, - ReadDecoder, - Write, - WriteEncoder, - JSON, -}; -use crate::CustomMapValue; - -pub fn serialize_custom_map_value(args: &CustomMapValue) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) object-type: CustomMapValue".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_custom_map_value(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_custom_map_value(args: &CustomMapValue, writer: &mut W) -> Result<(), EncodeError> { - writer.write_map_length(&1)?; - writer.context().push("foo", "String", "writing property"); - writer.write_string("foo")?; - writer.write_string(&args.foo)?; - writer.context().pop(); - Ok(()) -} - -pub fn deserialize_custom_map_value(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing object-type: CustomMapValue".to_string(); - let mut reader = ReadDecoder::new(args, context); - read_custom_map_value(&mut reader) -} - -pub fn read_custom_map_value(reader: &mut R) -> Result { - let mut num_of_fields = reader.read_map_length()?; - - let mut _foo: String = String::new(); - let mut _foo_set = false; - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - "foo" => { - reader.context().push(&field, "String", "type found, reading property"); - _foo = reader.read_string()?; - _foo_set = true; - reader.context().pop(); - } - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - if !_foo_set { - return Err(DecodeError::MissingField("foo: String.".to_string())); - } - - Ok(CustomMapValue { - foo: _foo, - }) -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_type/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_type/mod.rs index a15c664dc8..2e53a74ff4 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_type/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_type/mod.rs @@ -1,22 +1,14 @@ use serde::{Serialize, Deserialize}; -pub mod serialization; +use polywrap_msgpack_serde::{ + wrappers::polywrap_json::JSONString, + wrappers::polywrap_bigint::BigIntWrapper +}; use polywrap_wasm_rs::{ BigInt, BigNumber, Map, - DecodeError, - EncodeError, - Read, - Write, - JSON, -}; -pub use serialization::{ - deserialize_custom_type, - read_custom_type, - serialize_custom_type, - write_custom_type + JSON }; - use crate::AnotherType; use crate::CustomEnum; use crate::CustomMapValue; @@ -24,8 +16,10 @@ use crate::CustomMapValue; #[derive(Clone, Debug, Deserialize, Serialize)] pub struct CustomType { pub str: String, + #[serde(rename = "optStr")] pub opt_str: Option, pub u: u32, + #[serde(rename = "optU")] pub opt_u: Option, pub u8: u8, pub u16: u16, @@ -34,36 +28,60 @@ pub struct CustomType { pub i8: i8, pub i16: i16, pub i32: i32, - pub bigint: BigInt, - pub opt_bigint: Option, + pub bigint: BigIntWrapper, + #[serde(rename = "optBigint")] + pub opt_bigint: Option, pub bignumber: BigNumber, + #[serde(rename = "optBignumber")] pub opt_bignumber: Option, - pub json: JSON::Value, - pub opt_json: Option, + pub json: JSONString, + #[serde(rename = "optJson")] + pub opt_json: Option, + #[serde(with = "serde_bytes")] pub bytes: Vec, + #[serde(with = "serde_bytes")] + #[serde(rename = "optBytes")] pub opt_bytes: Option>, pub boolean: bool, + #[serde(rename = "optBoolean")] pub opt_boolean: Option, pub u_array: Vec, + #[serde(rename = "uOpt_array")] pub u_opt_array: Option>, + #[serde(rename = "_opt_uOptArray")] pub _opt_u_opt_array: Option>>, + #[serde(rename = "optStrOptArray")] pub opt_str_opt_array: Option>>, + #[serde(rename = "uArrayArray")] pub u_array_array: Vec>, + #[serde(rename = "uOptArrayOptArray")] pub u_opt_array_opt_array: Vec>>>, + #[serde(rename = "uArrayOptArrayArray")] pub u_array_opt_array_array: Vec>>>, + #[serde(rename = "crazyArray")] pub crazy_array: Option>>>>>>, pub object: AnotherType, + #[serde(rename = "optObject")] pub opt_object: Option, + #[serde(rename = "objectArray")] pub object_array: Vec, + #[serde(rename = "optObjectArray")] pub opt_object_array: Option>>, pub en: CustomEnum, + #[serde(rename = "optEnum")] pub opt_enum: Option, + #[serde(rename = "enumArray")] pub enum_array: Vec, + #[serde(rename = "optEnumArray")] pub opt_enum_array: Option>>, pub map: Map, + #[serde(rename = "mapOfArr")] pub map_of_arr: Map>, + #[serde(rename = "mapOfObj")] pub map_of_obj: Map, + #[serde(rename = "mapOfArrOfObj")] pub map_of_arr_of_obj: Map>, + #[serde(rename = "mapCustomValue")] pub map_custom_value: Map>, } @@ -81,11 +99,11 @@ impl CustomType { i8: 0, i16: 0, i32: 0, - bigint: BigInt::default(), + bigint: BigIntWrapper(BigInt::default()), opt_bigint: None, bignumber: BigNumber::default(), opt_bignumber: None, - json: JSON::Value::Null, + json: JSONString::from(JSON::Value::Null), opt_json: None, bytes: vec![], opt_bytes: None, @@ -99,11 +117,11 @@ impl CustomType { u_opt_array_opt_array: vec![], u_array_opt_array_array: vec![], crazy_array: None, - object: AnotherType::new(), + object: Option::new(), opt_object: None, object_array: vec![], opt_object_array: None, - en: CustomEnum::_MAX_, + en: Option::_MAX_, opt_enum: None, enum_array: vec![], opt_enum_array: None, @@ -114,20 +132,4 @@ impl CustomType { map_custom_value: Map::>::new(), } } - - pub fn to_buffer(args: &CustomType) -> Result, EncodeError> { - serialize_custom_type(args).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn from_buffer(args: &[u8]) -> Result { - deserialize_custom_type(args).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } - - pub fn write(args: &CustomType, writer: &mut W) -> Result<(), EncodeError> { - write_custom_type(args, writer).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn read(reader: &mut R) -> Result { - read_custom_type(reader).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } } diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_type/serialization.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_type/serialization.rs deleted file mode 100644 index a9faa0a662..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_type/serialization.rs +++ /dev/null @@ -1,851 +0,0 @@ -use std::convert::TryFrom; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Context, - DecodeError, - EncodeError, - Read, - ReadDecoder, - Write, - WriteEncoder, - JSON, -}; -use crate::CustomType; - -use crate::AnotherType; -use crate::{ - CustomEnum, - get_custom_enum_value, - sanitize_custom_enum_value -}; -use crate::CustomMapValue; - -pub fn serialize_custom_type(args: &CustomType) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) object-type: CustomType".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_custom_type(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_custom_type(args: &CustomType, writer: &mut W) -> Result<(), EncodeError> { - writer.write_map_length(&42)?; - writer.context().push("str", "String", "writing property"); - writer.write_string("str")?; - writer.write_string(&args.str)?; - writer.context().pop(); - writer.context().push("optStr", "Option", "writing property"); - writer.write_string("optStr")?; - writer.write_optional_string(&args.opt_str)?; - writer.context().pop(); - writer.context().push("u", "u32", "writing property"); - writer.write_string("u")?; - writer.write_u32(&args.u)?; - writer.context().pop(); - writer.context().push("optU", "Option", "writing property"); - writer.write_string("optU")?; - writer.write_optional_u32(&args.opt_u)?; - writer.context().pop(); - writer.context().push("u8", "u8", "writing property"); - writer.write_string("u8")?; - writer.write_u8(&args.u8)?; - writer.context().pop(); - writer.context().push("u16", "u16", "writing property"); - writer.write_string("u16")?; - writer.write_u16(&args.u16)?; - writer.context().pop(); - writer.context().push("u32", "u32", "writing property"); - writer.write_string("u32")?; - writer.write_u32(&args.u32)?; - writer.context().pop(); - writer.context().push("i", "i32", "writing property"); - writer.write_string("i")?; - writer.write_i32(&args.i)?; - writer.context().pop(); - writer.context().push("i8", "i8", "writing property"); - writer.write_string("i8")?; - writer.write_i8(&args.i8)?; - writer.context().pop(); - writer.context().push("i16", "i16", "writing property"); - writer.write_string("i16")?; - writer.write_i16(&args.i16)?; - writer.context().pop(); - writer.context().push("i32", "i32", "writing property"); - writer.write_string("i32")?; - writer.write_i32(&args.i32)?; - writer.context().pop(); - writer.context().push("bigint", "BigInt", "writing property"); - writer.write_string("bigint")?; - writer.write_bigint(&args.bigint)?; - writer.context().pop(); - writer.context().push("optBigint", "Option", "writing property"); - writer.write_string("optBigint")?; - writer.write_optional_bigint(&args.opt_bigint)?; - writer.context().pop(); - writer.context().push("bignumber", "BigNumber", "writing property"); - writer.write_string("bignumber")?; - writer.write_bignumber(&args.bignumber)?; - writer.context().pop(); - writer.context().push("optBignumber", "Option", "writing property"); - writer.write_string("optBignumber")?; - writer.write_optional_bignumber(&args.opt_bignumber)?; - writer.context().pop(); - writer.context().push("json", "JSON::Value", "writing property"); - writer.write_string("json")?; - writer.write_json(&args.json)?; - writer.context().pop(); - writer.context().push("optJson", "Option", "writing property"); - writer.write_string("optJson")?; - writer.write_optional_json(&args.opt_json)?; - writer.context().pop(); - writer.context().push("bytes", "Vec", "writing property"); - writer.write_string("bytes")?; - writer.write_bytes(&args.bytes)?; - writer.context().pop(); - writer.context().push("optBytes", "Option>", "writing property"); - writer.write_string("optBytes")?; - writer.write_optional_bytes(&args.opt_bytes)?; - writer.context().pop(); - writer.context().push("boolean", "bool", "writing property"); - writer.write_string("boolean")?; - writer.write_bool(&args.boolean)?; - writer.context().pop(); - writer.context().push("optBoolean", "Option", "writing property"); - writer.write_string("optBoolean")?; - writer.write_optional_bool(&args.opt_boolean)?; - writer.context().pop(); - writer.context().push("u_array", "Vec", "writing property"); - writer.write_string("u_array")?; - writer.write_array(&args.u_array, |writer, item| { - writer.write_u32(item) - })?; - writer.context().pop(); - writer.context().push("uOpt_array", "Option>", "writing property"); - writer.write_string("uOpt_array")?; - writer.write_optional_array(&args.u_opt_array, |writer, item| { - writer.write_u32(item) - })?; - writer.context().pop(); - writer.context().push("_opt_uOptArray", "Option>>", "writing property"); - writer.write_string("_opt_uOptArray")?; - writer.write_optional_array(&args._opt_u_opt_array, |writer, item| { - writer.write_optional_u32(item) - })?; - writer.context().pop(); - writer.context().push("optStrOptArray", "Option>>", "writing property"); - writer.write_string("optStrOptArray")?; - writer.write_optional_array(&args.opt_str_opt_array, |writer, item| { - writer.write_optional_string(item) - })?; - writer.context().pop(); - writer.context().push("uArrayArray", "Vec>", "writing property"); - writer.write_string("uArrayArray")?; - writer.write_array(&args.u_array_array, |writer, item| { - writer.write_array(item, |writer, item| { - writer.write_u32(item) - }) - })?; - writer.context().pop(); - writer.context().push("uOptArrayOptArray", "Vec>>>", "writing property"); - writer.write_string("uOptArrayOptArray")?; - writer.write_array(&args.u_opt_array_opt_array, |writer, item| { - writer.write_optional_array(item, |writer, item| { - writer.write_optional_u32(item) - }) - })?; - writer.context().pop(); - writer.context().push("uArrayOptArrayArray", "Vec>>>", "writing property"); - writer.write_string("uArrayOptArrayArray")?; - writer.write_array(&args.u_array_opt_array_array, |writer, item| { - writer.write_optional_array(item, |writer, item| { - writer.write_array(item, |writer, item| { - writer.write_u32(item) - }) - }) - })?; - writer.context().pop(); - writer.context().push("crazyArray", "Option>>>>>>", "writing property"); - writer.write_string("crazyArray")?; - writer.write_optional_array(&args.crazy_array, |writer, item| { - writer.write_optional_array(item, |writer, item| { - writer.write_array(item, |writer, item| { - writer.write_optional_array(item, |writer, item| { - writer.write_u32(item) - }) - }) - }) - })?; - writer.context().pop(); - writer.context().push("object", "AnotherType", "writing property"); - writer.write_string("object")?; - AnotherType::write(&args.object, writer)?; - writer.context().pop(); - writer.context().push("optObject", "Option", "writing property"); - writer.write_string("optObject")?; - if args.opt_object.is_some() { - AnotherType::write(args.opt_object.as_ref().as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - writer.context().pop(); - writer.context().push("objectArray", "Vec", "writing property"); - writer.write_string("objectArray")?; - writer.write_array(&args.object_array, |writer, item| { - AnotherType::write(item, writer) - })?; - writer.context().pop(); - writer.context().push("optObjectArray", "Option>>", "writing property"); - writer.write_string("optObjectArray")?; - writer.write_optional_array(&args.opt_object_array, |writer, item| { - if item.is_some() { - AnotherType::write(item.as_ref().as_ref().unwrap(), writer) - } else { - writer.write_nil() - } - })?; - writer.context().pop(); - writer.context().push("en", "CustomEnum", "writing property"); - writer.write_string("en")?; - writer.write_i32(&(args.en as i32))?; - writer.context().pop(); - writer.context().push("optEnum", "Option", "writing property"); - writer.write_string("optEnum")?; - writer.write_optional_i32(&args.opt_enum.map(|f| f as i32))?; - writer.context().pop(); - writer.context().push("enumArray", "Vec", "writing property"); - writer.write_string("enumArray")?; - writer.write_array(&args.enum_array, |writer, item| { - writer.write_i32(&(*item as i32)) - })?; - writer.context().pop(); - writer.context().push("optEnumArray", "Option>>", "writing property"); - writer.write_string("optEnumArray")?; - writer.write_optional_array(&args.opt_enum_array, |writer, item| { - writer.write_optional_i32(&item.map(|f| f as i32)) - })?; - writer.context().pop(); - writer.context().push("map", "Map", "writing property"); - writer.write_string("map")?; - writer.write_ext_generic_map(&args.map, |writer, key| { - writer.write_string(key) - }, |writer, value| { - writer.write_i32(value) - })?; - writer.context().pop(); - writer.context().push("mapOfArr", "Map>", "writing property"); - writer.write_string("mapOfArr")?; - writer.write_ext_generic_map(&args.map_of_arr, |writer, key| { - writer.write_string(key) - }, |writer, value| { - writer.write_array(value, |writer, item| { - writer.write_i32(item) - }) - })?; - writer.context().pop(); - writer.context().push("mapOfObj", "Map", "writing property"); - writer.write_string("mapOfObj")?; - writer.write_ext_generic_map(&args.map_of_obj, |writer, key| { - writer.write_string(key) - }, |writer, value| { - AnotherType::write(value, writer) - })?; - writer.context().pop(); - writer.context().push("mapOfArrOfObj", "Map>", "writing property"); - writer.write_string("mapOfArrOfObj")?; - writer.write_ext_generic_map(&args.map_of_arr_of_obj, |writer, key| { - writer.write_string(key) - }, |writer, value| { - writer.write_array(value, |writer, item| { - AnotherType::write(item, writer) - }) - })?; - writer.context().pop(); - writer.context().push("mapCustomValue", "Map>", "writing property"); - writer.write_string("mapCustomValue")?; - writer.write_ext_generic_map(&args.map_custom_value, |writer, key| { - writer.write_string(key) - }, |writer, value| { - if value.is_some() { - CustomMapValue::write(value.as_ref().as_ref().unwrap(), writer) - } else { - writer.write_nil() - } - })?; - writer.context().pop(); - Ok(()) -} - -pub fn deserialize_custom_type(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing object-type: CustomType".to_string(); - let mut reader = ReadDecoder::new(args, context); - read_custom_type(&mut reader) -} - -pub fn read_custom_type(reader: &mut R) -> Result { - let mut num_of_fields = reader.read_map_length()?; - - let mut _str: String = String::new(); - let mut _str_set = false; - let mut _opt_str: Option = None; - let mut _u: u32 = 0; - let mut _u_set = false; - let mut _opt_u: Option = None; - let mut _u8: u8 = 0; - let mut _u8_set = false; - let mut _u16: u16 = 0; - let mut _u16_set = false; - let mut _u32: u32 = 0; - let mut _u32_set = false; - let mut _i: i32 = 0; - let mut _i_set = false; - let mut _i8: i8 = 0; - let mut _i8_set = false; - let mut _i16: i16 = 0; - let mut _i16_set = false; - let mut _i32: i32 = 0; - let mut _i32_set = false; - let mut _bigint: BigInt = BigInt::default(); - let mut _bigint_set = false; - let mut _opt_bigint: Option = None; - let mut _bignumber: BigNumber = BigNumber::default(); - let mut _bignumber_set = false; - let mut _opt_bignumber: Option = None; - let mut _json: JSON::Value = JSON::Value::Null; - let mut _json_set = false; - let mut _opt_json: Option = None; - let mut _bytes: Vec = vec![]; - let mut _bytes_set = false; - let mut _opt_bytes: Option> = None; - let mut _boolean: bool = false; - let mut _boolean_set = false; - let mut _opt_boolean: Option = None; - let mut _u_array: Vec = vec![]; - let mut _u_array_set = false; - let mut _u_opt_array: Option> = None; - let mut __opt_u_opt_array: Option>> = None; - let mut _opt_str_opt_array: Option>> = None; - let mut _u_array_array: Vec> = vec![]; - let mut _u_array_array_set = false; - let mut _u_opt_array_opt_array: Vec>>> = vec![]; - let mut _u_opt_array_opt_array_set = false; - let mut _u_array_opt_array_array: Vec>>> = vec![]; - let mut _u_array_opt_array_array_set = false; - let mut _crazy_array: Option>>>>>> = None; - let mut _object: AnotherType = AnotherType::new(); - let mut _object_set = false; - let mut _opt_object: Option = None; - let mut _object_array: Vec = vec![]; - let mut _object_array_set = false; - let mut _opt_object_array: Option>> = None; - let mut _en: CustomEnum = CustomEnum::_MAX_; - let mut _en_set = false; - let mut _opt_enum: Option = None; - let mut _enum_array: Vec = vec![]; - let mut _enum_array_set = false; - let mut _opt_enum_array: Option>> = None; - let mut _map: Map = Map::::new(); - let mut _map_set = false; - let mut _map_of_arr: Map> = Map::>::new(); - let mut _map_of_arr_set = false; - let mut _map_of_obj: Map = Map::::new(); - let mut _map_of_obj_set = false; - let mut _map_of_arr_of_obj: Map> = Map::>::new(); - let mut _map_of_arr_of_obj_set = false; - let mut _map_custom_value: Map> = Map::>::new(); - let mut _map_custom_value_set = false; - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - "str" => { - reader.context().push(&field, "String", "type found, reading property"); - _str = reader.read_string()?; - _str_set = true; - reader.context().pop(); - } - "optStr" => { - reader.context().push(&field, "Option", "type found, reading property"); - _opt_str = reader.read_optional_string()?; - reader.context().pop(); - } - "u" => { - reader.context().push(&field, "u32", "type found, reading property"); - _u = reader.read_u32()?; - _u_set = true; - reader.context().pop(); - } - "optU" => { - reader.context().push(&field, "Option", "type found, reading property"); - _opt_u = reader.read_optional_u32()?; - reader.context().pop(); - } - "u8" => { - reader.context().push(&field, "u8", "type found, reading property"); - _u8 = reader.read_u8()?; - _u8_set = true; - reader.context().pop(); - } - "u16" => { - reader.context().push(&field, "u16", "type found, reading property"); - _u16 = reader.read_u16()?; - _u16_set = true; - reader.context().pop(); - } - "u32" => { - reader.context().push(&field, "u32", "type found, reading property"); - _u32 = reader.read_u32()?; - _u32_set = true; - reader.context().pop(); - } - "i" => { - reader.context().push(&field, "i32", "type found, reading property"); - _i = reader.read_i32()?; - _i_set = true; - reader.context().pop(); - } - "i8" => { - reader.context().push(&field, "i8", "type found, reading property"); - _i8 = reader.read_i8()?; - _i8_set = true; - reader.context().pop(); - } - "i16" => { - reader.context().push(&field, "i16", "type found, reading property"); - _i16 = reader.read_i16()?; - _i16_set = true; - reader.context().pop(); - } - "i32" => { - reader.context().push(&field, "i32", "type found, reading property"); - _i32 = reader.read_i32()?; - _i32_set = true; - reader.context().pop(); - } - "bigint" => { - reader.context().push(&field, "BigInt", "type found, reading property"); - _bigint = reader.read_bigint()?; - _bigint_set = true; - reader.context().pop(); - } - "optBigint" => { - reader.context().push(&field, "Option", "type found, reading property"); - _opt_bigint = reader.read_optional_bigint()?; - reader.context().pop(); - } - "bignumber" => { - reader.context().push(&field, "BigNumber", "type found, reading property"); - _bignumber = reader.read_bignumber()?; - _bignumber_set = true; - reader.context().pop(); - } - "optBignumber" => { - reader.context().push(&field, "Option", "type found, reading property"); - _opt_bignumber = reader.read_optional_bignumber()?; - reader.context().pop(); - } - "json" => { - reader.context().push(&field, "JSON::Value", "type found, reading property"); - _json = reader.read_json()?; - _json_set = true; - reader.context().pop(); - } - "optJson" => { - reader.context().push(&field, "Option", "type found, reading property"); - _opt_json = reader.read_optional_json()?; - reader.context().pop(); - } - "bytes" => { - reader.context().push(&field, "Vec", "type found, reading property"); - _bytes = reader.read_bytes()?; - _bytes_set = true; - reader.context().pop(); - } - "optBytes" => { - reader.context().push(&field, "Option>", "type found, reading property"); - _opt_bytes = reader.read_optional_bytes()?; - reader.context().pop(); - } - "boolean" => { - reader.context().push(&field, "bool", "type found, reading property"); - _boolean = reader.read_bool()?; - _boolean_set = true; - reader.context().pop(); - } - "optBoolean" => { - reader.context().push(&field, "Option", "type found, reading property"); - _opt_boolean = reader.read_optional_bool()?; - reader.context().pop(); - } - "u_array" => { - reader.context().push(&field, "Vec", "type found, reading property"); - _u_array = reader.read_array(|reader| { - reader.read_u32() - })?; - _u_array_set = true; - reader.context().pop(); - } - "uOpt_array" => { - reader.context().push(&field, "Option>", "type found, reading property"); - _u_opt_array = reader.read_optional_array(|reader| { - reader.read_u32() - })?; - reader.context().pop(); - } - "_opt_uOptArray" => { - reader.context().push(&field, "Option>>", "type found, reading property"); - __opt_u_opt_array = reader.read_optional_array(|reader| { - reader.read_optional_u32() - })?; - reader.context().pop(); - } - "optStrOptArray" => { - reader.context().push(&field, "Option>>", "type found, reading property"); - _opt_str_opt_array = reader.read_optional_array(|reader| { - reader.read_optional_string() - })?; - reader.context().pop(); - } - "uArrayArray" => { - reader.context().push(&field, "Vec>", "type found, reading property"); - _u_array_array = reader.read_array(|reader| { - reader.read_array(|reader| { - reader.read_u32() - }) - })?; - _u_array_array_set = true; - reader.context().pop(); - } - "uOptArrayOptArray" => { - reader.context().push(&field, "Vec>>>", "type found, reading property"); - _u_opt_array_opt_array = reader.read_array(|reader| { - reader.read_optional_array(|reader| { - reader.read_optional_u32() - }) - })?; - _u_opt_array_opt_array_set = true; - reader.context().pop(); - } - "uArrayOptArrayArray" => { - reader.context().push(&field, "Vec>>>", "type found, reading property"); - _u_array_opt_array_array = reader.read_array(|reader| { - reader.read_optional_array(|reader| { - reader.read_array(|reader| { - reader.read_u32() - }) - }) - })?; - _u_array_opt_array_array_set = true; - reader.context().pop(); - } - "crazyArray" => { - reader.context().push(&field, "Option>>>>>>", "type found, reading property"); - _crazy_array = reader.read_optional_array(|reader| { - reader.read_optional_array(|reader| { - reader.read_array(|reader| { - reader.read_optional_array(|reader| { - reader.read_u32() - }) - }) - }) - })?; - reader.context().pop(); - } - "object" => { - reader.context().push(&field, "AnotherType", "type found, reading property"); - let object = AnotherType::read(reader)?; - _object = object; - _object_set = true; - reader.context().pop(); - } - "optObject" => { - reader.context().push(&field, "Option", "type found, reading property"); - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(AnotherType::read(reader)?); - } else { - object = None; - } - _opt_object = object; - reader.context().pop(); - } - "objectArray" => { - reader.context().push(&field, "Vec", "type found, reading property"); - _object_array = reader.read_array(|reader| { - let object = AnotherType::read(reader)?; - Ok(object) - })?; - _object_array_set = true; - reader.context().pop(); - } - "optObjectArray" => { - reader.context().push(&field, "Option>>", "type found, reading property"); - _opt_object_array = reader.read_optional_array(|reader| { - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(AnotherType::read(reader)?); - } else { - object = None; - } - Ok(object) - })?; - reader.context().pop(); - } - "en" => { - reader.context().push(&field, "CustomEnum", "type found, reading property"); - let mut value: CustomEnum = CustomEnum::_MAX_; - if reader.is_next_string()? { - value = get_custom_enum_value(&reader.read_string()?)?; - } else { - value = CustomEnum::try_from(reader.read_i32()?)?; - sanitize_custom_enum_value(value as i32)?; - } - _en = value; - _en_set = true; - reader.context().pop(); - } - "optEnum" => { - reader.context().push(&field, "Option", "type found, reading property"); - let mut value: Option = None; - if !reader.is_next_nil()? { - if reader.is_next_string()? { - value = Some(get_custom_enum_value(&reader.read_string()?)?); - } else { - value = Some(CustomEnum::try_from(reader.read_i32()?)?); - sanitize_custom_enum_value(value.unwrap() as i32)?; - } - } else { - value = None; - } - _opt_enum = value; - reader.context().pop(); - } - "enumArray" => { - reader.context().push(&field, "Vec", "type found, reading property"); - _enum_array = reader.read_array(|reader| { - let mut value: CustomEnum = CustomEnum::_MAX_; - if reader.is_next_string()? { - value = get_custom_enum_value(&reader.read_string()?)?; - } else { - value = CustomEnum::try_from(reader.read_i32()?)?; - sanitize_custom_enum_value(value as i32)?; - } - Ok(value) - })?; - _enum_array_set = true; - reader.context().pop(); - } - "optEnumArray" => { - reader.context().push(&field, "Option>>", "type found, reading property"); - _opt_enum_array = reader.read_optional_array(|reader| { - let mut value: Option = None; - if !reader.is_next_nil()? { - if reader.is_next_string()? { - value = Some(get_custom_enum_value(&reader.read_string()?)?); - } else { - value = Some(CustomEnum::try_from(reader.read_i32()?)?); - sanitize_custom_enum_value(value.unwrap() as i32)?; - } - } else { - value = None; - } - Ok(value) - })?; - reader.context().pop(); - } - "map" => { - reader.context().push(&field, "Map", "type found, reading property"); - _map = reader.read_ext_generic_map(|reader| { - reader.read_string() - }, |reader| { - reader.read_i32() - })?; - _map_set = true; - reader.context().pop(); - } - "mapOfArr" => { - reader.context().push(&field, "Map>", "type found, reading property"); - _map_of_arr = reader.read_ext_generic_map(|reader| { - reader.read_string() - }, |reader| { - reader.read_array(|reader| { - reader.read_i32() - }) - })?; - _map_of_arr_set = true; - reader.context().pop(); - } - "mapOfObj" => { - reader.context().push(&field, "Map", "type found, reading property"); - _map_of_obj = reader.read_ext_generic_map(|reader| { - reader.read_string() - }, |reader| { - let object = AnotherType::read(reader)?; - Ok(object) - })?; - _map_of_obj_set = true; - reader.context().pop(); - } - "mapOfArrOfObj" => { - reader.context().push(&field, "Map>", "type found, reading property"); - _map_of_arr_of_obj = reader.read_ext_generic_map(|reader| { - reader.read_string() - }, |reader| { - reader.read_array(|reader| { - let object = AnotherType::read(reader)?; - Ok(object) - }) - })?; - _map_of_arr_of_obj_set = true; - reader.context().pop(); - } - "mapCustomValue" => { - reader.context().push(&field, "Map>", "type found, reading property"); - _map_custom_value = reader.read_ext_generic_map(|reader| { - reader.read_string() - }, |reader| { - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(CustomMapValue::read(reader)?); - } else { - object = None; - } - Ok(object) - })?; - _map_custom_value_set = true; - reader.context().pop(); - } - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - if !_str_set { - return Err(DecodeError::MissingField("str: String.".to_string())); - } - if !_u_set { - return Err(DecodeError::MissingField("u: UInt.".to_string())); - } - if !_u8_set { - return Err(DecodeError::MissingField("u8: UInt8.".to_string())); - } - if !_u16_set { - return Err(DecodeError::MissingField("u16: UInt16.".to_string())); - } - if !_u32_set { - return Err(DecodeError::MissingField("u32: UInt32.".to_string())); - } - if !_i_set { - return Err(DecodeError::MissingField("i: Int.".to_string())); - } - if !_i8_set { - return Err(DecodeError::MissingField("i8: Int8.".to_string())); - } - if !_i16_set { - return Err(DecodeError::MissingField("i16: Int16.".to_string())); - } - if !_i32_set { - return Err(DecodeError::MissingField("i32: Int32.".to_string())); - } - if !_bigint_set { - return Err(DecodeError::MissingField("bigint: BigInt.".to_string())); - } - if !_bignumber_set { - return Err(DecodeError::MissingField("bignumber: BigNumber.".to_string())); - } - if !_json_set { - return Err(DecodeError::MissingField("json: JSON.".to_string())); - } - if !_bytes_set { - return Err(DecodeError::MissingField("bytes: Bytes.".to_string())); - } - if !_boolean_set { - return Err(DecodeError::MissingField("boolean: Boolean.".to_string())); - } - if !_u_array_set { - return Err(DecodeError::MissingField("u_array: [UInt].".to_string())); - } - if !_u_array_array_set { - return Err(DecodeError::MissingField("uArrayArray: [[UInt]].".to_string())); - } - if !_u_opt_array_opt_array_set { - return Err(DecodeError::MissingField("uOptArrayOptArray: [[UInt32]].".to_string())); - } - if !_u_array_opt_array_array_set { - return Err(DecodeError::MissingField("uArrayOptArrayArray: [[[UInt32]]].".to_string())); - } - if !_object_set { - return Err(DecodeError::MissingField("object: AnotherType.".to_string())); - } - if !_object_array_set { - return Err(DecodeError::MissingField("objectArray: [AnotherType].".to_string())); - } - if !_en_set { - return Err(DecodeError::MissingField("en: CustomEnum.".to_string())); - } - if !_enum_array_set { - return Err(DecodeError::MissingField("enumArray: [CustomEnum].".to_string())); - } - if !_map_set { - return Err(DecodeError::MissingField("map: Map.".to_string())); - } - if !_map_of_arr_set { - return Err(DecodeError::MissingField("mapOfArr: Map.".to_string())); - } - if !_map_of_obj_set { - return Err(DecodeError::MissingField("mapOfObj: Map.".to_string())); - } - if !_map_of_arr_of_obj_set { - return Err(DecodeError::MissingField("mapOfArrOfObj: Map.".to_string())); - } - if !_map_custom_value_set { - return Err(DecodeError::MissingField("mapCustomValue: Map.".to_string())); - } - - Ok(CustomType { - str: _str, - opt_str: _opt_str, - u: _u, - opt_u: _opt_u, - u8: _u8, - u16: _u16, - u32: _u32, - i: _i, - i8: _i8, - i16: _i16, - i32: _i32, - bigint: _bigint, - opt_bigint: _opt_bigint, - bignumber: _bignumber, - opt_bignumber: _opt_bignumber, - json: _json, - opt_json: _opt_json, - bytes: _bytes, - opt_bytes: _opt_bytes, - boolean: _boolean, - opt_boolean: _opt_boolean, - u_array: _u_array, - u_opt_array: _u_opt_array, - _opt_u_opt_array: __opt_u_opt_array, - opt_str_opt_array: _opt_str_opt_array, - u_array_array: _u_array_array, - u_opt_array_opt_array: _u_opt_array_opt_array, - u_array_opt_array_array: _u_array_opt_array_array, - crazy_array: _crazy_array, - object: _object, - opt_object: _opt_object, - object_array: _object_array, - opt_object_array: _opt_object_array, - en: _en, - opt_enum: _opt_enum, - enum_array: _enum_array, - opt_enum_array: _opt_enum_array, - map: _map, - map_of_arr: _map_of_arr, - map_of_obj: _map_of_obj, - map_of_arr_of_obj: _map_of_arr_of_obj, - map_custom_value: _map_custom_value, - }) -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/entry.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/entry.rs index 9a410f9c8e..25d939ff06 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/entry.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/entry.rs @@ -9,7 +9,6 @@ use polywrap_wasm_rs::{ invoke, InvokeArgs, }; -use crate::module::Module; #[no_mangle] pub extern "C" fn _wrap_invoke(method_size: u32, args_size: u32, env_size: u32) -> bool { diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/env/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/env/mod.rs index 2a79852d21..cc57defade 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/env/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/env/mod.rs @@ -1,26 +1,21 @@ use serde::{Serialize, Deserialize}; -pub mod serialization; +use polywrap_msgpack_serde::{ + wrappers::polywrap_json::JSONString, + wrappers::polywrap_bigint::BigIntWrapper +}; use polywrap_wasm_rs::{ BigInt, BigNumber, Map, - DecodeError, - EncodeError, - Read, - Write, - JSON, -}; -pub use serialization::{ - deserialize_env, - read_env, - serialize_env, - write_env + JSON }; #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Env { pub prop: String, + #[serde(rename = "optProp")] pub opt_prop: Option, + #[serde(rename = "optMap")] pub opt_map: Option>>, } @@ -32,20 +27,4 @@ impl Env { opt_map: None, } } - - pub fn to_buffer(args: &Env) -> Result, EncodeError> { - serialize_env(args).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn from_buffer(args: &[u8]) -> Result { - deserialize_env(args).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } - - pub fn write(args: &Env, writer: &mut W) -> Result<(), EncodeError> { - write_env(args, writer).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn read(reader: &mut R) -> Result { - read_env(reader).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } } diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/env/serialization.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/env/serialization.rs deleted file mode 100644 index df2a91bc9c..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/env/serialization.rs +++ /dev/null @@ -1,98 +0,0 @@ -use std::convert::TryFrom; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Context, - DecodeError, - EncodeError, - Read, - ReadDecoder, - Write, - WriteEncoder, - JSON, -}; -use crate::Env; - -pub fn serialize_env(args: &Env) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) env-type: Env".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_env(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_env(args: &Env, writer: &mut W) -> Result<(), EncodeError> { - writer.write_map_length(&3)?; - writer.context().push("prop", "String", "writing property"); - writer.write_string("prop")?; - writer.write_string(&args.prop)?; - writer.context().pop(); - writer.context().push("optProp", "Option", "writing property"); - writer.write_string("optProp")?; - writer.write_optional_string(&args.opt_prop)?; - writer.context().pop(); - writer.context().push("optMap", "Option>>", "writing property"); - writer.write_string("optMap")?; - writer.write_optional_ext_generic_map(&args.opt_map, |writer, key| { - writer.write_string(key) - }, |writer, value| { - writer.write_optional_i32(value) - })?; - writer.context().pop(); - Ok(()) -} - -pub fn deserialize_env(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing env-type: Env".to_string(); - let mut reader = ReadDecoder::new(args, context); - read_env(&mut reader) -} - -pub fn read_env(reader: &mut R) -> Result { - let mut num_of_fields = reader.read_map_length()?; - - let mut _prop: String = String::new(); - let mut _prop_set = false; - let mut _opt_prop: Option = None; - let mut _opt_map: Option>> = None; - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - "prop" => { - reader.context().push(&field, "String", "type found, reading property"); - _prop = reader.read_string()?; - _prop_set = true; - reader.context().pop(); - } - "optProp" => { - reader.context().push(&field, "Option", "type found, reading property"); - _opt_prop = reader.read_optional_string()?; - reader.context().pop(); - } - "optMap" => { - reader.context().push(&field, "Option>>", "type found, reading property"); - _opt_map = reader.read_optional_ext_generic_map(|reader| { - reader.read_string()? - }, |reader| { - reader.read_optional_i32() - })?; - reader.context().pop(); - } - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - if !_prop_set { - return Err(DecodeError::MissingField("prop: String.".to_string())); - } - - Ok(Env { - prop: _prop, - opt_prop: _opt_prop, - opt_map: _opt_map, - }) -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_another_object/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_another_object/mod.rs index 838d59b797..d5b29d8ab3 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_another_object/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_another_object/mod.rs @@ -1,20 +1,13 @@ use serde::{Serialize, Deserialize}; -pub mod serialization; +use polywrap_msgpack_serde::{ + wrappers::polywrap_json::JSONString, + wrappers::polywrap_bigint::BigIntWrapper +}; use polywrap_wasm_rs::{ BigInt, BigNumber, Map, - DecodeError, - EncodeError, - Read, - Write, - JSON, -}; -pub use serialization::{ - deserialize_test_import_another_object, - read_test_import_another_object, - serialize_test_import_another_object, - write_test_import_another_object + JSON }; #[derive(Clone, Debug, Deserialize, Serialize)] @@ -30,20 +23,4 @@ impl TestImportAnotherObject { prop: String::new(), } } - - pub fn to_buffer(args: &TestImportAnotherObject) -> Result, EncodeError> { - serialize_test_import_another_object(args).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn from_buffer(args: &[u8]) -> Result { - deserialize_test_import_another_object(args).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } - - pub fn write(args: &TestImportAnotherObject, writer: &mut W) -> Result<(), EncodeError> { - write_test_import_another_object(args, writer).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn read(reader: &mut R) -> Result { - read_test_import_another_object(reader).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } } diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_another_object/serialization.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_another_object/serialization.rs deleted file mode 100644 index 43d97eb245..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_another_object/serialization.rs +++ /dev/null @@ -1,68 +0,0 @@ -use std::convert::TryFrom; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Context, - DecodeError, - EncodeError, - Read, - ReadDecoder, - Write, - WriteEncoder, - JSON, -}; -use crate::TestImportAnotherObject; - -pub fn serialize_test_import_another_object(args: &TestImportAnotherObject) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) imported object-type: TestImportAnotherObject".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_test_import_another_object(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_test_import_another_object(args: &TestImportAnotherObject, writer: &mut W) -> Result<(), EncodeError> { - writer.write_map_length(&1)?; - writer.context().push("prop", "String", "writing property"); - writer.write_string("prop")?; - writer.write_string(&args.prop)?; - writer.context().pop(); - Ok(()) -} - -pub fn deserialize_test_import_another_object(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing imported object-type: TestImportAnotherObject".to_string(); - let mut reader = ReadDecoder::new(args, context); - read_test_import_another_object(&mut reader) -} - -pub fn read_test_import_another_object(reader: &mut R) -> Result { - let mut num_of_fields = reader.read_map_length()?; - - let mut _prop: String = String::new(); - let mut _prop_set = false; - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - "prop" => { - reader.context().push(&field, "String", "type found, reading property"); - _prop = reader.read_string()?; - _prop_set = true; - reader.context().pop(); - } - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - if !_prop_set { - return Err(DecodeError::MissingField("prop: String.".to_string())); - } - - Ok(TestImportAnotherObject { - prop: _prop, - }) -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_enum/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_enum/mod.rs index e0426d64f1..4a22dd0029 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_enum/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_enum/mod.rs @@ -4,7 +4,9 @@ use std::convert::TryFrom; #[derive(Clone, Copy, Debug, Deserialize, Serialize)] pub enum TestImportEnum { + #[serde(rename = "STRING")] STRING, + #[serde(rename = "BYTES")] BYTES, _MAX_ } diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_enum_return/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_enum_return/mod.rs index 137826420b..8d668d2910 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_enum_return/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_enum_return/mod.rs @@ -4,7 +4,9 @@ use std::convert::TryFrom; #[derive(Clone, Copy, Debug, Deserialize, Serialize)] pub enum TestImportEnumReturn { + #[serde(rename = "STRING")] STRING, + #[serde(rename = "BYTES")] BYTES, _MAX_ } diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_env/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_env/mod.rs index 993de8d519..ea2dfd1b40 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_env/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_env/mod.rs @@ -1,22 +1,14 @@ use serde::{Serialize, Deserialize}; -pub mod serialization; +use polywrap_msgpack_serde::{ + wrappers::polywrap_json::JSONString, + wrappers::polywrap_bigint::BigIntWrapper +}; use polywrap_wasm_rs::{ BigInt, BigNumber, Map, - DecodeError, - EncodeError, - Read, - Write, - JSON, -}; -pub use serialization::{ - deserialize_test_import_env, - read_test_import_env, - serialize_test_import_env, - write_test_import_env + JSON }; - use crate::TestImportAnotherObject; use crate::TestImportEnum; @@ -37,30 +29,14 @@ impl TestImportEnv { pub fn new() -> TestImportEnv { TestImportEnv { - object: TestImportAnotherObject::new(), + object: Option::new(), opt_object: None, object_array: vec![], opt_object_array: None, - en: TestImportEnum::_MAX_, + en: Option::_MAX_, opt_enum: None, enum_array: vec![], opt_enum_array: None, } } - - pub fn to_buffer(args: &TestImportEnv) -> Result, EncodeError> { - serialize_test_import_env(args).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn from_buffer(args: &[u8]) -> Result { - deserialize_test_import_env(args).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } - - pub fn write(args: &TestImportEnv, writer: &mut W) -> Result<(), EncodeError> { - write_test_import_env(args, writer).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn read(reader: &mut R) -> Result { - read_test_import_env(reader).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } } diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_env/serialization.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_env/serialization.rs deleted file mode 100644 index 6de6ef69d3..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_env/serialization.rs +++ /dev/null @@ -1,241 +0,0 @@ -use std::convert::TryFrom; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Context, - DecodeError, - EncodeError, - Read, - ReadDecoder, - Write, - WriteEncoder, - JSON, -}; -use crate::TestImportEnv; - -use crate::TestImportAnotherObject; -use crate::{ - TestImportEnum, - get_test_import_enum_value, - sanitize_test_import_enum_value -}; - -pub fn serialize_test_import_env(args: &TestImportEnv) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) imported env-type: TestImportEnv".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_test_import_env(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_test_import_env(args: &TestImportEnv, writer: &mut W) -> Result<(), EncodeError> { - writer.write_map_length(&8)?; - writer.context().push("object", "TestImportAnotherObject", "writing property"); - writer.write_string("object")?; - TestImportAnotherObject::write(&args.object, writer)?; - writer.context().pop(); - writer.context().push("optObject", "Option", "writing property"); - writer.write_string("optObject")?; - if args.opt_object.is_some() { - TestImportAnotherObject::write(args.opt_object.as_ref().as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - writer.context().pop(); - writer.context().push("objectArray", "Vec", "writing property"); - writer.write_string("objectArray")?; - writer.write_array(&args.object_array, |writer, item| { - TestImportAnotherObject::write(item, writer) - })?; - writer.context().pop(); - writer.context().push("optObjectArray", "Option>>", "writing property"); - writer.write_string("optObjectArray")?; - writer.write_optional_array(&args.opt_object_array, |writer, item| { - if item.is_some() { - TestImportAnotherObject::write(item.as_ref().as_ref().unwrap(), writer) - } else { - writer.write_nil() - } - })?; - writer.context().pop(); - writer.context().push("en", "TestImportEnum", "writing property"); - writer.write_string("en")?; - writer.write_i32(&(args.en as i32))?; - writer.context().pop(); - writer.context().push("optEnum", "Option", "writing property"); - writer.write_string("optEnum")?; - writer.write_optional_i32(&args.opt_enum.map(|f| f as i32))?; - writer.context().pop(); - writer.context().push("enumArray", "Vec", "writing property"); - writer.write_string("enumArray")?; - writer.write_array(&args.enum_array, |writer, item| { - writer.write_i32(&(*item as i32)) - })?; - writer.context().pop(); - writer.context().push("optEnumArray", "Option>>", "writing property"); - writer.write_string("optEnumArray")?; - writer.write_optional_array(&args.opt_enum_array, |writer, item| { - writer.write_optional_i32(&item.map(|f| f as i32)) - })?; - writer.context().pop(); - Ok(()) -} - -pub fn deserialize_test_import_env(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing imported env-type: TestImportEnv".to_string(); - let mut reader = ReadDecoder::new(args, context); - read_test_import_env(&mut reader) -} - -pub fn read_test_import_env(reader: &mut R) -> Result { - let mut num_of_fields = reader.read_map_length()?; - - let mut _object: TestImportAnotherObject = TestImportAnotherObject::new(); - let mut _object_set = false; - let mut _opt_object: Option = None; - let mut _object_array: Vec = vec![]; - let mut _object_array_set = false; - let mut _opt_object_array: Option>> = None; - let mut _en: TestImportEnum = TestImportEnum::_MAX_; - let mut _en_set = false; - let mut _opt_enum: Option = None; - let mut _enum_array: Vec = vec![]; - let mut _enum_array_set = false; - let mut _opt_enum_array: Option>> = None; - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - "object" => { - reader.context().push(&field, "TestImportAnotherObject", "type found, reading property"); - let object = TestImportAnotherObject::read(reader)?; - _object = object; - _object_set = true; - reader.context().pop(); - } - "optObject" => { - reader.context().push(&field, "Option", "type found, reading property"); - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(TestImportAnotherObject::read(reader)?); - } else { - object = None; - } - _opt_object = object; - reader.context().pop(); - } - "objectArray" => { - reader.context().push(&field, "Vec", "type found, reading property"); - _object_array = reader.read_array(|reader| { - let object = TestImportAnotherObject::read(reader)?; - Ok(object) - })?; - _object_array_set = true; - reader.context().pop(); - } - "optObjectArray" => { - reader.context().push(&field, "Option>>", "type found, reading property"); - _opt_object_array = reader.read_optional_array(|reader| { - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(TestImportAnotherObject::read(reader)?); - } else { - object = None; - } - Ok(object) - })?; - reader.context().pop(); - } - "en" => { - reader.context().push(&field, "TestImportEnum", "type found, reading property"); - let mut value: TestImportEnum = TestImportEnum::_MAX_; - if reader.is_next_string()? { - value = get_test_import_enum_value(&reader.read_string()?)?; - } else { - value = TestImportEnum::try_from(reader.read_i32()?)?; - sanitize_test_import_enum_value(value as i32)?; - } - _en = value; - _en_set = true; - reader.context().pop(); - } - "optEnum" => { - reader.context().push(&field, "Option", "type found, reading property"); - let mut value: Option = None; - if !reader.is_next_nil()? { - if reader.is_next_string()? { - value = Some(get_test_import_enum_value(&reader.read_string()?)?); - } else { - value = Some(TestImportEnum::try_from(reader.read_i32()?)?); - sanitize_test_import_enum_value(value.unwrap() as i32)?; - } - } else { - value = None; - } - _opt_enum = value; - reader.context().pop(); - } - "enumArray" => { - reader.context().push(&field, "Vec", "type found, reading property"); - _enum_array = reader.read_array(|reader| { - let mut value: TestImportEnum = TestImportEnum::_MAX_; - if reader.is_next_string()? { - value = get_test_import_enum_value(&reader.read_string()?)?; - } else { - value = TestImportEnum::try_from(reader.read_i32()?)?; - sanitize_test_import_enum_value(value as i32)?; - } - Ok(value) - })?; - _enum_array_set = true; - reader.context().pop(); - } - "optEnumArray" => { - reader.context().push(&field, "Option>>", "type found, reading property"); - _opt_enum_array = reader.read_optional_array(|reader| { - let mut value: Option = None; - if !reader.is_next_nil()? { - if reader.is_next_string()? { - value = Some(get_test_import_enum_value(&reader.read_string()?)?); - } else { - value = Some(TestImportEnum::try_from(reader.read_i32()?)?); - sanitize_test_import_enum_value(value.unwrap() as i32)?; - } - } else { - value = None; - } - Ok(value) - })?; - reader.context().pop(); - } - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - if !_object_set { - return Err(DecodeError::MissingField("object: TestImport_AnotherObject.".to_string())); - } - if !_object_array_set { - return Err(DecodeError::MissingField("objectArray: [TestImport_AnotherObject].".to_string())); - } - if !_en_set { - return Err(DecodeError::MissingField("en: TestImport_Enum.".to_string())); - } - if !_enum_array_set { - return Err(DecodeError::MissingField("enumArray: [TestImport_Enum].".to_string())); - } - - Ok(TestImportEnv { - object: _object, - opt_object: _opt_object, - object_array: _object_array, - opt_object_array: _opt_object_array, - en: _en, - opt_enum: _opt_enum, - enum_array: _enum_array, - opt_enum_array: _opt_enum_array, - }) -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_module/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_module/mod.rs index d265f90a57..873e07c430 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_module/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_module/mod.rs @@ -1,30 +1,57 @@ use serde::{Serialize, Deserialize}; +use polywrap_msgpack_serde::{ + from_slice, + to_vec, + wrappers::polywrap_json::JSONString, + wrappers::polywrap_bigint::BigIntWrapper +}; use polywrap_wasm_rs::{ BigInt, BigNumber, Map, - Read, - Write, JSON, - subinvoke, -}; -pub mod serialization; -pub use serialization::{ - deserialize_imported_method_result, - serialize_imported_method_args, - ArgsImportedMethod, - deserialize_another_method_result, - serialize_another_method_args, - ArgsAnotherMethod, - deserialize_returns_array_of_enums_result, - serialize_returns_array_of_enums_args, - ArgsReturnsArrayOfEnums + subinvoke }; - use crate::TestImportObject; use crate::TestImportEnum; use crate::TestImportEnumReturn; +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ArgsImportedMethod { + pub str: String, + #[serde(rename = "optStr")] + pub opt_str: Option, + pub u: u32, + #[serde(rename = "optU")] + pub opt_u: Option, + #[serde(rename = "uArrayArray")] + pub u_array_array: Vec>>>, + pub object: TestImportObject, + #[serde(rename = "optObject")] + pub opt_object: Option, + #[serde(rename = "objectArray")] + pub object_array: Vec, + #[serde(rename = "optObjectArray")] + pub opt_object_array: Option>>, + pub en: TestImportEnum, + #[serde(rename = "optEnum")] + pub opt_enum: Option, + #[serde(rename = "enumArray")] + pub enum_array: Vec, + #[serde(rename = "optEnumArray")] + pub opt_enum_array: Option>>, +} + +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ArgsAnotherMethod { + pub arg: Vec, +} + +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ArgsReturnsArrayOfEnums { + pub arg: String, +} + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct TestImportModule { uri: String @@ -39,34 +66,34 @@ impl TestImportModule { pub fn imported_method(&self, args: &ArgsImportedMethod) -> Result, String> { let ref uri = self.uri; - let args = serialize_imported_method_args(args).map_err(|e| e.to_string())?; + let args = to_vec(args).map_err(|e| e.to_string())?; let result = subinvoke::wrap_subinvoke( uri.as_str(), "importedMethod", args, )?; - deserialize_imported_method_result(result.as_slice()).map_err(|e| e.to_string()) + from_slice(result.as_slice()).map_err(|e| e.to_string()) } pub fn another_method(&self, args: &ArgsAnotherMethod) -> Result { let ref uri = self.uri; - let args = serialize_another_method_args(args).map_err(|e| e.to_string())?; + let args = to_vec(args).map_err(|e| e.to_string())?; let result = subinvoke::wrap_subinvoke( uri.as_str(), "anotherMethod", args, )?; - deserialize_another_method_result(result.as_slice()).map_err(|e| e.to_string()) + from_slice(result.as_slice()).map_err(|e| e.to_string()) } pub fn returns_array_of_enums(&self, args: &ArgsReturnsArrayOfEnums) -> Result>, String> { let ref uri = self.uri; - let args = serialize_returns_array_of_enums_args(args).map_err(|e| e.to_string())?; + let args = to_vec(args).map_err(|e| e.to_string())?; let result = subinvoke::wrap_subinvoke( uri.as_str(), "returnsArrayOfEnums", args, )?; - deserialize_returns_array_of_enums_result(result.as_slice()).map_err(|e| e.to_string()) + from_slice(result.as_slice()).map_err(|e| e.to_string()) } } diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_module/serialization.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_module/serialization.rs deleted file mode 100644 index 92ed22e3ed..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_module/serialization.rs +++ /dev/null @@ -1,554 +0,0 @@ -use serde::{Serialize, Deserialize}; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Context, - DecodeError, - EncodeError, - Read, - ReadDecoder, - Write, - WriteEncoder, - JSON, -}; - -use crate::TestImportObject; -use crate::{ - TestImportEnum, - get_test_import_enum_value, - sanitize_test_import_enum_value -}; -use crate::{ - TestImportEnumReturn, - get_test_import_enum_return_value, - sanitize_test_import_enum_return_value -}; - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsImportedMethod { - pub str: String, - pub opt_str: Option, - pub u: u32, - pub opt_u: Option, - pub u_array_array: Vec>>>, - pub object: TestImportObject, - pub opt_object: Option, - pub object_array: Vec, - pub opt_object_array: Option>>, - pub en: TestImportEnum, - pub opt_enum: Option, - pub enum_array: Vec, - pub opt_enum_array: Option>>, -} - -pub fn deserialize_imported_method_args(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing imported module-type: imported_method Args".to_string(); - - let mut reader = ReadDecoder::new(args, context); - let mut num_of_fields = reader.read_map_length()?; - - let mut _str: String = String::new(); - let mut _str_set = false; - let mut _opt_str: Option = None; - let mut _u: u32 = 0; - let mut _u_set = false; - let mut _opt_u: Option = None; - let mut _u_array_array: Vec>>> = vec![]; - let mut _u_array_array_set = false; - let mut _object: TestImportObject = TestImportObject::new(); - let mut _object_set = false; - let mut _opt_object: Option = None; - let mut _object_array: Vec = vec![]; - let mut _object_array_set = false; - let mut _opt_object_array: Option>> = None; - let mut _en: TestImportEnum = TestImportEnum::_MAX_; - let mut _en_set = false; - let mut _opt_enum: Option = None; - let mut _enum_array: Vec = vec![]; - let mut _enum_array_set = false; - let mut _opt_enum_array: Option>> = None; - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - "str" => { - reader.context().push(&field, "String", "type found, reading argument"); - _str = reader.read_string()?; - _str_set = true; - reader.context().pop(); - } - "optStr" => { - reader.context().push(&field, "Option", "type found, reading argument"); - _opt_str = reader.read_optional_string()?; - reader.context().pop(); - } - "u" => { - reader.context().push(&field, "u32", "type found, reading argument"); - _u = reader.read_u32()?; - _u_set = true; - reader.context().pop(); - } - "optU" => { - reader.context().push(&field, "Option", "type found, reading argument"); - _opt_u = reader.read_optional_u32()?; - reader.context().pop(); - } - "uArrayArray" => { - reader.context().push(&field, "Vec>>>", "type found, reading argument"); - _u_array_array = reader.read_array(|reader| { - reader.read_optional_array(|reader| { - reader.read_optional_u32() - }) - })?; - _u_array_array_set = true; - reader.context().pop(); - } - "object" => { - reader.context().push(&field, "TestImportObject", "type found, reading argument"); - let object = TestImportObject::read(&mut reader)?; - _object = object; - _object_set = true; - reader.context().pop(); - } - "optObject" => { - reader.context().push(&field, "Option", "type found, reading argument"); - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(TestImportObject::read(&mut reader)?); - } else { - object = None; - } - _opt_object = object; - reader.context().pop(); - } - "objectArray" => { - reader.context().push(&field, "Vec", "type found, reading argument"); - _object_array = reader.read_array(|reader| { - let object = TestImportObject::read(reader)?; - Ok(object) - })?; - _object_array_set = true; - reader.context().pop(); - } - "optObjectArray" => { - reader.context().push(&field, "Option>>", "type found, reading argument"); - _opt_object_array = reader.read_optional_array(|reader| { - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(TestImportObject::read(reader)?); - } else { - object = None; - } - Ok(object) - })?; - reader.context().pop(); - } - "en" => { - reader.context().push(&field, "TestImportEnum", "type found, reading argument"); - let mut value: TestImportEnum = TestImportEnum::_MAX_; - if reader.is_next_string()? { - value = get_test_import_enum_value(&reader.read_string()?)?; - } else { - value = TestImportEnum::try_from(reader.read_i32()?)?; - sanitize_test_import_enum_value(value as i32)?; - } - _en = value; - _en_set = true; - reader.context().pop(); - } - "optEnum" => { - reader.context().push(&field, "Option", "type found, reading argument"); - let mut value: Option = None; - if !reader.is_next_nil()? { - if reader.is_next_string()? { - value = Some(get_test_import_enum_value(&reader.read_string()?)?); - } else { - value = Some(TestImportEnum::try_from(reader.read_i32()?)?); - sanitize_test_import_enum_value(value.unwrap() as i32)?; - } - } else { - value = None; - } - _opt_enum = value; - reader.context().pop(); - } - "enumArray" => { - reader.context().push(&field, "Vec", "type found, reading argument"); - _enum_array = reader.read_array(|reader| { - let mut value: TestImportEnum = TestImportEnum::_MAX_; - if reader.is_next_string()? { - value = get_test_import_enum_value(&reader.read_string()?)?; - } else { - value = TestImportEnum::try_from(reader.read_i32()?)?; - sanitize_test_import_enum_value(value as i32)?; - } - Ok(value) - })?; - _enum_array_set = true; - reader.context().pop(); - } - "optEnumArray" => { - reader.context().push(&field, "Option>>", "type found, reading argument"); - _opt_enum_array = reader.read_optional_array(|reader| { - let mut value: Option = None; - if !reader.is_next_nil()? { - if reader.is_next_string()? { - value = Some(get_test_import_enum_value(&reader.read_string()?)?); - } else { - value = Some(TestImportEnum::try_from(reader.read_i32()?)?); - sanitize_test_import_enum_value(value.unwrap() as i32)?; - } - } else { - value = None; - } - Ok(value) - })?; - reader.context().pop(); - } - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - if !_str_set { - return Err(DecodeError::MissingField("str: String.".to_string())); - } - if !_u_set { - return Err(DecodeError::MissingField("u: UInt.".to_string())); - } - if !_u_array_array_set { - return Err(DecodeError::MissingField("uArrayArray: [[UInt]].".to_string())); - } - if !_object_set { - return Err(DecodeError::MissingField("object: TestImport_Object.".to_string())); - } - if !_object_array_set { - return Err(DecodeError::MissingField("objectArray: [TestImport_Object].".to_string())); - } - if !_en_set { - return Err(DecodeError::MissingField("en: TestImport_Enum.".to_string())); - } - if !_enum_array_set { - return Err(DecodeError::MissingField("enumArray: [TestImport_Enum].".to_string())); - } - - Ok(ArgsImportedMethod { - str: _str, - opt_str: _opt_str, - u: _u, - opt_u: _opt_u, - u_array_array: _u_array_array, - object: _object, - opt_object: _opt_object, - object_array: _object_array, - opt_object_array: _opt_object_array, - en: _en, - opt_enum: _opt_enum, - enum_array: _enum_array, - opt_enum_array: _opt_enum_array, - }) -} - -pub fn serialize_imported_method_args(args: &ArgsImportedMethod) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) imported module-type: imported_method Args".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_imported_method_args(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_imported_method_args(args: &ArgsImportedMethod, writer: &mut W) -> Result<(), EncodeError> { - writer.write_map_length(&13)?; - writer.context().push("str", "String", "writing property"); - writer.write_string("str")?; - writer.write_string(&args.str)?; - writer.context().pop(); - writer.context().push("optStr", "Option", "writing property"); - writer.write_string("optStr")?; - writer.write_optional_string(&args.opt_str)?; - writer.context().pop(); - writer.context().push("u", "u32", "writing property"); - writer.write_string("u")?; - writer.write_u32(&args.u)?; - writer.context().pop(); - writer.context().push("optU", "Option", "writing property"); - writer.write_string("optU")?; - writer.write_optional_u32(&args.opt_u)?; - writer.context().pop(); - writer.context().push("uArrayArray", "Vec>>>", "writing property"); - writer.write_string("uArrayArray")?; - writer.write_array(&args.u_array_array, |writer, item| { - writer.write_optional_array(item, |writer, item| { - writer.write_optional_u32(item) - }) - })?; - writer.context().pop(); - writer.context().push("object", "TestImportObject", "writing property"); - writer.write_string("object")?; - TestImportObject::write(&args.object, writer)?; - writer.context().pop(); - writer.context().push("optObject", "Option", "writing property"); - writer.write_string("optObject")?; - if args.opt_object.is_some() { - TestImportObject::write(args.opt_object.as_ref().as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - writer.context().pop(); - writer.context().push("objectArray", "Vec", "writing property"); - writer.write_string("objectArray")?; - writer.write_array(&args.object_array, |writer, item| { - TestImportObject::write(item, writer) - })?; - writer.context().pop(); - writer.context().push("optObjectArray", "Option>>", "writing property"); - writer.write_string("optObjectArray")?; - writer.write_optional_array(&args.opt_object_array, |writer, item| { - if item.is_some() { - TestImportObject::write(item.as_ref().as_ref().unwrap(), writer) - } else { - writer.write_nil() - } - })?; - writer.context().pop(); - writer.context().push("en", "TestImportEnum", "writing property"); - writer.write_string("en")?; - writer.write_i32(&(args.en as i32))?; - writer.context().pop(); - writer.context().push("optEnum", "Option", "writing property"); - writer.write_string("optEnum")?; - writer.write_optional_i32(&args.opt_enum.map(|f| f as i32))?; - writer.context().pop(); - writer.context().push("enumArray", "Vec", "writing property"); - writer.write_string("enumArray")?; - writer.write_array(&args.enum_array, |writer, item| { - writer.write_i32(&(*item as i32)) - })?; - writer.context().pop(); - writer.context().push("optEnumArray", "Option>>", "writing property"); - writer.write_string("optEnumArray")?; - writer.write_optional_array(&args.opt_enum_array, |writer, item| { - writer.write_optional_i32(&item.map(|f| f as i32)) - })?; - writer.context().pop(); - Ok(()) -} - -pub fn serialize_imported_method_result(result: &Option) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) imported module-type: imported_method Result".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_imported_method_result(result, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_imported_method_result(result: &Option, writer: &mut W) -> Result<(), EncodeError> { - writer.context().push("importedMethod", "Option", "writing result"); - if result.is_some() { - TestImportObject::write(result.as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - writer.context().pop(); - Ok(()) -} - -pub fn deserialize_imported_method_result(result: &[u8]) -> Result, DecodeError> { - let mut context = Context::new(); - context.description = "Deserializing imported module-type: imported_method Result".to_string(); - let mut reader = ReadDecoder::new(result, context); - - reader.context().push("importedMethod", "Option", "reading function output"); - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(TestImportObject::read(&mut reader)?); - } else { - object = None; - } - let res = object; - reader.context().pop(); - Ok(res) -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsAnotherMethod { - pub arg: Vec, -} - -pub fn deserialize_another_method_args(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing imported module-type: another_method Args".to_string(); - - let mut reader = ReadDecoder::new(args, context); - let mut num_of_fields = reader.read_map_length()?; - - let mut _arg: Vec = vec![]; - let mut _arg_set = false; - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - "arg" => { - reader.context().push(&field, "Vec", "type found, reading argument"); - _arg = reader.read_array(|reader| { - reader.read_string() - })?; - _arg_set = true; - reader.context().pop(); - } - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - if !_arg_set { - return Err(DecodeError::MissingField("arg: [String].".to_string())); - } - - Ok(ArgsAnotherMethod { - arg: _arg, - }) -} - -pub fn serialize_another_method_args(args: &ArgsAnotherMethod) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) imported module-type: another_method Args".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_another_method_args(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_another_method_args(args: &ArgsAnotherMethod, writer: &mut W) -> Result<(), EncodeError> { - writer.write_map_length(&1)?; - writer.context().push("arg", "Vec", "writing property"); - writer.write_string("arg")?; - writer.write_array(&args.arg, |writer, item| { - writer.write_string(item) - })?; - writer.context().pop(); - Ok(()) -} - -pub fn serialize_another_method_result(result: &i32) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) imported module-type: another_method Result".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_another_method_result(result, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_another_method_result(result: &i32, writer: &mut W) -> Result<(), EncodeError> { - writer.context().push("anotherMethod", "i32", "writing result"); - writer.write_i32(result)?; - writer.context().pop(); - Ok(()) -} - -pub fn deserialize_another_method_result(result: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing imported module-type: another_method Result".to_string(); - let mut reader = ReadDecoder::new(result, context); - - reader.context().push("anotherMethod", "i32", "reading function output"); - let res = reader.read_i32()?; - reader.context().pop(); - Ok(res) -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsReturnsArrayOfEnums { - pub arg: String, -} - -pub fn deserialize_returns_array_of_enums_args(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing imported module-type: returns_array_of_enums Args".to_string(); - - let mut reader = ReadDecoder::new(args, context); - let mut num_of_fields = reader.read_map_length()?; - - let mut _arg: String = String::new(); - let mut _arg_set = false; - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - "arg" => { - reader.context().push(&field, "String", "type found, reading argument"); - _arg = reader.read_string()?; - _arg_set = true; - reader.context().pop(); - } - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - if !_arg_set { - return Err(DecodeError::MissingField("arg: String.".to_string())); - } - - Ok(ArgsReturnsArrayOfEnums { - arg: _arg, - }) -} - -pub fn serialize_returns_array_of_enums_args(args: &ArgsReturnsArrayOfEnums) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) imported module-type: returns_array_of_enums Args".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_returns_array_of_enums_args(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_returns_array_of_enums_args(args: &ArgsReturnsArrayOfEnums, writer: &mut W) -> Result<(), EncodeError> { - writer.write_map_length(&1)?; - writer.context().push("arg", "String", "writing property"); - writer.write_string("arg")?; - writer.write_string(&args.arg)?; - writer.context().pop(); - Ok(()) -} - -pub fn serialize_returns_array_of_enums_result(result: &Vec>) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) imported module-type: returns_array_of_enums Result".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_returns_array_of_enums_result(result, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_returns_array_of_enums_result(result: &Vec>, writer: &mut W) -> Result<(), EncodeError> { - writer.context().push("returnsArrayOfEnums", "Vec>", "writing result"); - writer.write_array(&result, |writer, item| { - writer.write_optional_i32(&item.map(|f| f as i32)) - })?; - writer.context().pop(); - Ok(()) -} - -pub fn deserialize_returns_array_of_enums_result(result: &[u8]) -> Result>, DecodeError> { - let mut context = Context::new(); - context.description = "Deserializing imported module-type: returns_array_of_enums Result".to_string(); - let mut reader = ReadDecoder::new(result, context); - - reader.context().push("returnsArrayOfEnums", "Vec>", "reading function output"); - let res = reader.read_array(|reader| { - let mut value: Option = None; - if !reader.is_next_nil()? { - if reader.is_next_string()? { - value = Some(get_test_import_enum_return_value(&reader.read_string()?)?); - } else { - value = Some(TestImportEnumReturn::try_from(reader.read_i32()?)?); - sanitize_test_import_enum_return_value(value.unwrap() as i32)?; - } - } else { - value = None; - } - Ok(value) - })?; - reader.context().pop(); - Ok(res) -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_object/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_object/mod.rs index ab9c3cf3c4..b40e4db32d 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_object/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_object/mod.rs @@ -1,34 +1,32 @@ use serde::{Serialize, Deserialize}; -pub mod serialization; +use polywrap_msgpack_serde::{ + wrappers::polywrap_json::JSONString, + wrappers::polywrap_bigint::BigIntWrapper +}; use polywrap_wasm_rs::{ BigInt, BigNumber, Map, - DecodeError, - EncodeError, - Read, - Write, - JSON, -}; -pub use serialization::{ - deserialize_test_import_object, - read_test_import_object, - serialize_test_import_object, - write_test_import_object + JSON }; - use crate::TestImportAnotherObject; use crate::TestImportEnum; #[derive(Clone, Debug, Deserialize, Serialize)] pub struct TestImportObject { pub object: TestImportAnotherObject, + #[serde(rename = "optObject")] pub opt_object: Option, + #[serde(rename = "objectArray")] pub object_array: Vec, + #[serde(rename = "optObjectArray")] pub opt_object_array: Option>>, pub en: TestImportEnum, + #[serde(rename = "optEnum")] pub opt_enum: Option, + #[serde(rename = "enumArray")] pub enum_array: Vec, + #[serde(rename = "optEnumArray")] pub opt_enum_array: Option>>, } @@ -37,30 +35,14 @@ impl TestImportObject { pub fn new() -> TestImportObject { TestImportObject { - object: TestImportAnotherObject::new(), + object: Option::new(), opt_object: None, object_array: vec![], opt_object_array: None, - en: TestImportEnum::_MAX_, + en: Option::_MAX_, opt_enum: None, enum_array: vec![], opt_enum_array: None, } } - - pub fn to_buffer(args: &TestImportObject) -> Result, EncodeError> { - serialize_test_import_object(args).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn from_buffer(args: &[u8]) -> Result { - deserialize_test_import_object(args).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } - - pub fn write(args: &TestImportObject, writer: &mut W) -> Result<(), EncodeError> { - write_test_import_object(args, writer).map_err(|e| EncodeError::TypeWriteError(e.to_string())) - } - - pub fn read(reader: &mut R) -> Result { - read_test_import_object(reader).map_err(|e| DecodeError::TypeReadError(e.to_string())) - } } diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_object/serialization.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_object/serialization.rs deleted file mode 100644 index 691cf5d323..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_object/serialization.rs +++ /dev/null @@ -1,241 +0,0 @@ -use std::convert::TryFrom; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Context, - DecodeError, - EncodeError, - Read, - ReadDecoder, - Write, - WriteEncoder, - JSON, -}; -use crate::TestImportObject; - -use crate::TestImportAnotherObject; -use crate::{ - TestImportEnum, - get_test_import_enum_value, - sanitize_test_import_enum_value -}; - -pub fn serialize_test_import_object(args: &TestImportObject) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) imported object-type: TestImportObject".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_test_import_object(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_test_import_object(args: &TestImportObject, writer: &mut W) -> Result<(), EncodeError> { - writer.write_map_length(&8)?; - writer.context().push("object", "TestImportAnotherObject", "writing property"); - writer.write_string("object")?; - TestImportAnotherObject::write(&args.object, writer)?; - writer.context().pop(); - writer.context().push("optObject", "Option", "writing property"); - writer.write_string("optObject")?; - if args.opt_object.is_some() { - TestImportAnotherObject::write(args.opt_object.as_ref().as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - writer.context().pop(); - writer.context().push("objectArray", "Vec", "writing property"); - writer.write_string("objectArray")?; - writer.write_array(&args.object_array, |writer, item| { - TestImportAnotherObject::write(item, writer) - })?; - writer.context().pop(); - writer.context().push("optObjectArray", "Option>>", "writing property"); - writer.write_string("optObjectArray")?; - writer.write_optional_array(&args.opt_object_array, |writer, item| { - if item.is_some() { - TestImportAnotherObject::write(item.as_ref().as_ref().unwrap(), writer) - } else { - writer.write_nil() - } - })?; - writer.context().pop(); - writer.context().push("en", "TestImportEnum", "writing property"); - writer.write_string("en")?; - writer.write_i32(&(args.en as i32))?; - writer.context().pop(); - writer.context().push("optEnum", "Option", "writing property"); - writer.write_string("optEnum")?; - writer.write_optional_i32(&args.opt_enum.map(|f| f as i32))?; - writer.context().pop(); - writer.context().push("enumArray", "Vec", "writing property"); - writer.write_string("enumArray")?; - writer.write_array(&args.enum_array, |writer, item| { - writer.write_i32(&(*item as i32)) - })?; - writer.context().pop(); - writer.context().push("optEnumArray", "Option>>", "writing property"); - writer.write_string("optEnumArray")?; - writer.write_optional_array(&args.opt_enum_array, |writer, item| { - writer.write_optional_i32(&item.map(|f| f as i32)) - })?; - writer.context().pop(); - Ok(()) -} - -pub fn deserialize_test_import_object(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing imported object-type: TestImportObject".to_string(); - let mut reader = ReadDecoder::new(args, context); - read_test_import_object(&mut reader) -} - -pub fn read_test_import_object(reader: &mut R) -> Result { - let mut num_of_fields = reader.read_map_length()?; - - let mut _object: TestImportAnotherObject = TestImportAnotherObject::new(); - let mut _object_set = false; - let mut _opt_object: Option = None; - let mut _object_array: Vec = vec![]; - let mut _object_array_set = false; - let mut _opt_object_array: Option>> = None; - let mut _en: TestImportEnum = TestImportEnum::_MAX_; - let mut _en_set = false; - let mut _opt_enum: Option = None; - let mut _enum_array: Vec = vec![]; - let mut _enum_array_set = false; - let mut _opt_enum_array: Option>> = None; - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - "object" => { - reader.context().push(&field, "TestImportAnotherObject", "type found, reading property"); - let object = TestImportAnotherObject::read(reader)?; - _object = object; - _object_set = true; - reader.context().pop(); - } - "optObject" => { - reader.context().push(&field, "Option", "type found, reading property"); - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(TestImportAnotherObject::read(reader)?); - } else { - object = None; - } - _opt_object = object; - reader.context().pop(); - } - "objectArray" => { - reader.context().push(&field, "Vec", "type found, reading property"); - _object_array = reader.read_array(|reader| { - let object = TestImportAnotherObject::read(reader)?; - Ok(object) - })?; - _object_array_set = true; - reader.context().pop(); - } - "optObjectArray" => { - reader.context().push(&field, "Option>>", "type found, reading property"); - _opt_object_array = reader.read_optional_array(|reader| { - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(TestImportAnotherObject::read(reader)?); - } else { - object = None; - } - Ok(object) - })?; - reader.context().pop(); - } - "en" => { - reader.context().push(&field, "TestImportEnum", "type found, reading property"); - let mut value: TestImportEnum = TestImportEnum::_MAX_; - if reader.is_next_string()? { - value = get_test_import_enum_value(&reader.read_string()?)?; - } else { - value = TestImportEnum::try_from(reader.read_i32()?)?; - sanitize_test_import_enum_value(value as i32)?; - } - _en = value; - _en_set = true; - reader.context().pop(); - } - "optEnum" => { - reader.context().push(&field, "Option", "type found, reading property"); - let mut value: Option = None; - if !reader.is_next_nil()? { - if reader.is_next_string()? { - value = Some(get_test_import_enum_value(&reader.read_string()?)?); - } else { - value = Some(TestImportEnum::try_from(reader.read_i32()?)?); - sanitize_test_import_enum_value(value.unwrap() as i32)?; - } - } else { - value = None; - } - _opt_enum = value; - reader.context().pop(); - } - "enumArray" => { - reader.context().push(&field, "Vec", "type found, reading property"); - _enum_array = reader.read_array(|reader| { - let mut value: TestImportEnum = TestImportEnum::_MAX_; - if reader.is_next_string()? { - value = get_test_import_enum_value(&reader.read_string()?)?; - } else { - value = TestImportEnum::try_from(reader.read_i32()?)?; - sanitize_test_import_enum_value(value as i32)?; - } - Ok(value) - })?; - _enum_array_set = true; - reader.context().pop(); - } - "optEnumArray" => { - reader.context().push(&field, "Option>>", "type found, reading property"); - _opt_enum_array = reader.read_optional_array(|reader| { - let mut value: Option = None; - if !reader.is_next_nil()? { - if reader.is_next_string()? { - value = Some(get_test_import_enum_value(&reader.read_string()?)?); - } else { - value = Some(TestImportEnum::try_from(reader.read_i32()?)?); - sanitize_test_import_enum_value(value.unwrap() as i32)?; - } - } else { - value = None; - } - Ok(value) - })?; - reader.context().pop(); - } - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - if !_object_set { - return Err(DecodeError::MissingField("object: TestImport_AnotherObject.".to_string())); - } - if !_object_array_set { - return Err(DecodeError::MissingField("objectArray: [TestImport_AnotherObject].".to_string())); - } - if !_en_set { - return Err(DecodeError::MissingField("en: TestImport_Enum.".to_string())); - } - if !_enum_array_set { - return Err(DecodeError::MissingField("enumArray: [TestImport_Enum].".to_string())); - } - - Ok(TestImportObject { - object: _object, - opt_object: _opt_object, - object_array: _object_array, - opt_object_array: _opt_object_array, - en: _en, - opt_enum: _opt_enum, - enum_array: _enum_array, - opt_enum_array: _opt_enum_array, - }) -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/mod.rs index d5a8b8e1e8..5fa8c40b25 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/mod.rs @@ -24,6 +24,7 @@ pub use _while::{ pub mod env; pub use env::Env; pub mod imported; + pub use imported::test_import_object::TestImportObject; pub use imported::test_import_another_object::TestImportAnotherObject; pub use imported::test_import_enum::{ @@ -46,20 +47,12 @@ pub mod module; pub use module::{ Module, ModuleTrait, - deserialize_module_method_args, - serialize_module_method_result, module_method_wrapped, ArgsModuleMethod, - deserialize_object_method_args, - serialize_object_method_result, object_method_wrapped, ArgsObjectMethod, - deserialize_optional_env_method_args, - serialize_optional_env_method_result, optional_env_method_wrapped, ArgsOptionalEnvMethod, - deserialize_if_args, - serialize_if_result, if_wrapped, ArgsIf }; diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/mod.rs index 7823ef5b88..1216287feb 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/mod.rs @@ -1,23 +1,12 @@ pub mod wrapped; pub use wrapped::{ module_method_wrapped, - object_method_wrapped, - optional_env_method_wrapped, - if_wrapped -}; -pub mod serialization; -pub use serialization::{ - deserialize_module_method_args, - serialize_module_method_result, ArgsModuleMethod, - deserialize_object_method_args, - serialize_object_method_result, + object_method_wrapped, ArgsObjectMethod, - deserialize_optional_env_method_args, - serialize_optional_env_method_result, + optional_env_method_wrapped, ArgsOptionalEnvMethod, - deserialize_if_args, - serialize_if_result, + if_wrapped, ArgsIf }; diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/module.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/module.rs index f0fbdf1bcb..e5cf0918fb 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/module.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/module.rs @@ -1,22 +1,23 @@ -use crate::{ - ArgsModuleMethod, - ArgsObjectMethod, - ArgsOptionalEnvMethod, - ArgsIf, +use polywrap_msgpack_serde::{ + wrappers::polywrap_json::JSONString, + wrappers::polywrap_bigint::BigIntWrapper }; use polywrap_wasm_rs::{ BigInt, BigNumber, Map, - JSON, + JSON }; - -use crate::Env; use crate::{ - CustomEnum, + ArgsModuleMethod, + ArgsObjectMethod, + ArgsOptionalEnvMethod, + ArgsIf, }; +use crate::CustomEnum; use crate::AnotherType; use crate::Else; +use crate::env::Env; pub struct Module; diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/serialization.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/serialization.rs deleted file mode 100644 index f4146f90b0..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/serialization.rs +++ /dev/null @@ -1,770 +0,0 @@ -use serde::{Serialize, Deserialize}; -use std::convert::TryFrom; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - Context, - DecodeError, - EncodeError, - Read, - ReadDecoder, - Write, - WriteEncoder, - JSON, -}; - -use crate::Env; -use crate::{ - CustomEnum, - get_custom_enum_value, - sanitize_custom_enum_value -}; -use crate::AnotherType; -use crate::Else; - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsModuleMethod { - pub str: String, - pub opt_str: Option, - pub en: CustomEnum, - pub opt_enum: Option, - pub enum_array: Vec, - pub opt_enum_array: Option>>, - pub map: Map, - pub map_of_arr: Map>, - pub map_of_map: Map>, - pub map_of_obj: Map, - pub map_of_arr_of_obj: Map>, -} - -pub fn deserialize_module_method_args(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing module-type: module_method Args".to_string(); - - let mut reader = ReadDecoder::new(args, context); - let mut num_of_fields = reader.read_map_length()?; - - let mut _str: String = String::new(); - let mut _str_set = false; - let mut _opt_str: Option = None; - let mut _en: CustomEnum = CustomEnum::_MAX_; - let mut _en_set = false; - let mut _opt_enum: Option = None; - let mut _enum_array: Vec = vec![]; - let mut _enum_array_set = false; - let mut _opt_enum_array: Option>> = None; - let mut _map: Map = Map::::new(); - let mut _map_set = false; - let mut _map_of_arr: Map> = Map::>::new(); - let mut _map_of_arr_set = false; - let mut _map_of_map: Map> = Map::>::new(); - let mut _map_of_map_set = false; - let mut _map_of_obj: Map = Map::::new(); - let mut _map_of_obj_set = false; - let mut _map_of_arr_of_obj: Map> = Map::>::new(); - let mut _map_of_arr_of_obj_set = false; - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - "str" => { - reader.context().push(&field, "String", "type found, reading argument"); - _str = reader.read_string()?; - _str_set = true; - reader.context().pop(); - } - "optStr" => { - reader.context().push(&field, "Option", "type found, reading argument"); - _opt_str = reader.read_optional_string()?; - reader.context().pop(); - } - "en" => { - reader.context().push(&field, "CustomEnum", "type found, reading argument"); - let mut value: CustomEnum = CustomEnum::_MAX_; - if reader.is_next_string()? { - value = get_custom_enum_value(&reader.read_string()?)?; - } else { - value = CustomEnum::try_from(reader.read_i32()?)?; - sanitize_custom_enum_value(value as i32)?; - } - _en = value; - _en_set = true; - reader.context().pop(); - } - "optEnum" => { - reader.context().push(&field, "Option", "type found, reading argument"); - let mut value: Option = None; - if !reader.is_next_nil()? { - if reader.is_next_string()? { - value = Some(get_custom_enum_value(&reader.read_string()?)?); - } else { - value = Some(CustomEnum::try_from(reader.read_i32()?)?); - sanitize_custom_enum_value(value.unwrap() as i32)?; - } - } else { - value = None; - } - _opt_enum = value; - reader.context().pop(); - } - "enumArray" => { - reader.context().push(&field, "Vec", "type found, reading argument"); - _enum_array = reader.read_array(|reader| { - let mut value: CustomEnum = CustomEnum::_MAX_; - if reader.is_next_string()? { - value = get_custom_enum_value(&reader.read_string()?)?; - } else { - value = CustomEnum::try_from(reader.read_i32()?)?; - sanitize_custom_enum_value(value as i32)?; - } - Ok(value) - })?; - _enum_array_set = true; - reader.context().pop(); - } - "optEnumArray" => { - reader.context().push(&field, "Option>>", "type found, reading argument"); - _opt_enum_array = reader.read_optional_array(|reader| { - let mut value: Option = None; - if !reader.is_next_nil()? { - if reader.is_next_string()? { - value = Some(get_custom_enum_value(&reader.read_string()?)?); - } else { - value = Some(CustomEnum::try_from(reader.read_i32()?)?); - sanitize_custom_enum_value(value.unwrap() as i32)?; - } - } else { - value = None; - } - Ok(value) - })?; - reader.context().pop(); - } - "map" => { - reader.context().push(&field, "Map", "type found, reading argument"); - _map = reader.read_ext_generic_map(|reader| { - reader.read_string() - }, |reader| { - reader.read_i32() - })?; - _map_set = true; - reader.context().pop(); - } - "mapOfArr" => { - reader.context().push(&field, "Map>", "type found, reading argument"); - _map_of_arr = reader.read_ext_generic_map(|reader| { - reader.read_string() - }, |reader| { - reader.read_array(|reader| { - reader.read_i32() - }) - })?; - _map_of_arr_set = true; - reader.context().pop(); - } - "mapOfMap" => { - reader.context().push(&field, "Map>", "type found, reading argument"); - _map_of_map = reader.read_ext_generic_map(|reader| { - reader.read_string() - }, |reader| { - reader.read_ext_generic_map(|reader| { - reader.read_string() - }, |reader| { - reader.read_i32() - }) - })?; - _map_of_map_set = true; - reader.context().pop(); - } - "mapOfObj" => { - reader.context().push(&field, "Map", "type found, reading argument"); - _map_of_obj = reader.read_ext_generic_map(|reader| { - reader.read_string() - }, |reader| { - let object = AnotherType::read(reader)?; - Ok(object) - })?; - _map_of_obj_set = true; - reader.context().pop(); - } - "mapOfArrOfObj" => { - reader.context().push(&field, "Map>", "type found, reading argument"); - _map_of_arr_of_obj = reader.read_ext_generic_map(|reader| { - reader.read_string() - }, |reader| { - reader.read_array(|reader| { - let object = AnotherType::read(reader)?; - Ok(object) - }) - })?; - _map_of_arr_of_obj_set = true; - reader.context().pop(); - } - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - if !_str_set { - return Err(DecodeError::MissingField("str: String.".to_string())); - } - if !_en_set { - return Err(DecodeError::MissingField("en: CustomEnum.".to_string())); - } - if !_enum_array_set { - return Err(DecodeError::MissingField("enumArray: [CustomEnum].".to_string())); - } - if !_map_set { - return Err(DecodeError::MissingField("map: Map.".to_string())); - } - if !_map_of_arr_set { - return Err(DecodeError::MissingField("mapOfArr: Map.".to_string())); - } - if !_map_of_map_set { - return Err(DecodeError::MissingField("mapOfMap: Map>.".to_string())); - } - if !_map_of_obj_set { - return Err(DecodeError::MissingField("mapOfObj: Map.".to_string())); - } - if !_map_of_arr_of_obj_set { - return Err(DecodeError::MissingField("mapOfArrOfObj: Map.".to_string())); - } - - Ok(ArgsModuleMethod { - str: _str, - opt_str: _opt_str, - en: _en, - opt_enum: _opt_enum, - enum_array: _enum_array, - opt_enum_array: _opt_enum_array, - map: _map, - map_of_arr: _map_of_arr, - map_of_map: _map_of_map, - map_of_obj: _map_of_obj, - map_of_arr_of_obj: _map_of_arr_of_obj, - }) -} - -pub fn serialize_module_method_args(args: &ArgsModuleMethod) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) module-type: module_method Args".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_module_method_args(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_module_method_args(args: &ArgsModuleMethod, writer: &mut W) -> Result<(), EncodeError> { - writer.write_map_length(&11)?; - writer.context().push("str", "String", "writing property"); - writer.write_string("str")?; - writer.write_string(&args.str)?; - writer.context().pop(); - writer.context().push("optStr", "Option", "writing property"); - writer.write_string("optStr")?; - writer.write_optional_string(&args.opt_str)?; - writer.context().pop(); - writer.context().push("en", "CustomEnum", "writing property"); - writer.write_string("en")?; - writer.write_i32(&(args.en as i32))?; - writer.context().pop(); - writer.context().push("optEnum", "Option", "writing property"); - writer.write_string("optEnum")?; - writer.write_optional_i32(&args.opt_enum.map(|f| f as i32))?; - writer.context().pop(); - writer.context().push("enumArray", "Vec", "writing property"); - writer.write_string("enumArray")?; - writer.write_array(&args.enum_array, |writer, item| { - writer.write_i32(&(*item as i32)) - })?; - writer.context().pop(); - writer.context().push("optEnumArray", "Option>>", "writing property"); - writer.write_string("optEnumArray")?; - writer.write_optional_array(&args.opt_enum_array, |writer, item| { - writer.write_optional_i32(&item.map(|f| f as i32)) - })?; - writer.context().pop(); - writer.context().push("map", "Map", "writing property"); - writer.write_string("map")?; - writer.write_ext_generic_map(&args.map, |writer, key| { - writer.write_string(key) - }, |writer, value| { - writer.write_i32(value) - })?; - writer.context().pop(); - writer.context().push("mapOfArr", "Map>", "writing property"); - writer.write_string("mapOfArr")?; - writer.write_ext_generic_map(&args.map_of_arr, |writer, key| { - writer.write_string(key) - }, |writer, value| { - writer.write_array(value, |writer, item| { - writer.write_i32(item) - }) - })?; - writer.context().pop(); - writer.context().push("mapOfMap", "Map>", "writing property"); - writer.write_string("mapOfMap")?; - writer.write_ext_generic_map(&args.map_of_map, |writer, key| { - writer.write_string(key) - }, |writer, value| { - writer.write_ext_generic_map(value, |writer, key| { - writer.write_string(key) - }, |writer, value| { - writer.write_i32(value) - }) - })?; - writer.context().pop(); - writer.context().push("mapOfObj", "Map", "writing property"); - writer.write_string("mapOfObj")?; - writer.write_ext_generic_map(&args.map_of_obj, |writer, key| { - writer.write_string(key) - }, |writer, value| { - AnotherType::write(value, writer) - })?; - writer.context().pop(); - writer.context().push("mapOfArrOfObj", "Map>", "writing property"); - writer.write_string("mapOfArrOfObj")?; - writer.write_ext_generic_map(&args.map_of_arr_of_obj, |writer, key| { - writer.write_string(key) - }, |writer, value| { - writer.write_array(value, |writer, item| { - AnotherType::write(item, writer) - }) - })?; - writer.context().pop(); - Ok(()) -} - -pub fn serialize_module_method_result(result: &i32) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) module-type: module_method Result".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_module_method_result(result, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_module_method_result(result: &i32, writer: &mut W) -> Result<(), EncodeError> { - writer.context().push("moduleMethod", "i32", "writing result"); - writer.write_i32(result)?; - writer.context().pop(); - Ok(()) -} - -pub fn deserialize_module_method_result(result: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing module-type: module_method Result".to_string(); - let mut reader = ReadDecoder::new(result, context); - - reader.context().push("moduleMethod", "i32", "reading function output"); - let res = reader.read_i32()?; - reader.context().pop(); - Ok(res) -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsObjectMethod { - pub object: AnotherType, - pub opt_object: Option, - pub object_array: Vec, - pub opt_object_array: Option>>, -} - -pub fn deserialize_object_method_args(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing module-type: object_method Args".to_string(); - - let mut reader = ReadDecoder::new(args, context); - let mut num_of_fields = reader.read_map_length()?; - - let mut _object: AnotherType = AnotherType::new(); - let mut _object_set = false; - let mut _opt_object: Option = None; - let mut _object_array: Vec = vec![]; - let mut _object_array_set = false; - let mut _opt_object_array: Option>> = None; - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - "object" => { - reader.context().push(&field, "AnotherType", "type found, reading argument"); - let object = AnotherType::read(&mut reader)?; - _object = object; - _object_set = true; - reader.context().pop(); - } - "optObject" => { - reader.context().push(&field, "Option", "type found, reading argument"); - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(AnotherType::read(&mut reader)?); - } else { - object = None; - } - _opt_object = object; - reader.context().pop(); - } - "objectArray" => { - reader.context().push(&field, "Vec", "type found, reading argument"); - _object_array = reader.read_array(|reader| { - let object = AnotherType::read(reader)?; - Ok(object) - })?; - _object_array_set = true; - reader.context().pop(); - } - "optObjectArray" => { - reader.context().push(&field, "Option>>", "type found, reading argument"); - _opt_object_array = reader.read_optional_array(|reader| { - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(AnotherType::read(reader)?); - } else { - object = None; - } - Ok(object) - })?; - reader.context().pop(); - } - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - if !_object_set { - return Err(DecodeError::MissingField("object: AnotherType.".to_string())); - } - if !_object_array_set { - return Err(DecodeError::MissingField("objectArray: [AnotherType].".to_string())); - } - - Ok(ArgsObjectMethod { - object: _object, - opt_object: _opt_object, - object_array: _object_array, - opt_object_array: _opt_object_array, - }) -} - -pub fn serialize_object_method_args(args: &ArgsObjectMethod) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) module-type: object_method Args".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_object_method_args(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_object_method_args(args: &ArgsObjectMethod, writer: &mut W) -> Result<(), EncodeError> { - writer.write_map_length(&4)?; - writer.context().push("object", "AnotherType", "writing property"); - writer.write_string("object")?; - AnotherType::write(&args.object, writer)?; - writer.context().pop(); - writer.context().push("optObject", "Option", "writing property"); - writer.write_string("optObject")?; - if args.opt_object.is_some() { - AnotherType::write(args.opt_object.as_ref().as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - writer.context().pop(); - writer.context().push("objectArray", "Vec", "writing property"); - writer.write_string("objectArray")?; - writer.write_array(&args.object_array, |writer, item| { - AnotherType::write(item, writer) - })?; - writer.context().pop(); - writer.context().push("optObjectArray", "Option>>", "writing property"); - writer.write_string("optObjectArray")?; - writer.write_optional_array(&args.opt_object_array, |writer, item| { - if item.is_some() { - AnotherType::write(item.as_ref().as_ref().unwrap(), writer) - } else { - writer.write_nil() - } - })?; - writer.context().pop(); - Ok(()) -} - -pub fn serialize_object_method_result(result: &Option) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) module-type: object_method Result".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_object_method_result(result, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_object_method_result(result: &Option, writer: &mut W) -> Result<(), EncodeError> { - writer.context().push("objectMethod", "Option", "writing result"); - if result.is_some() { - AnotherType::write(result.as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - writer.context().pop(); - Ok(()) -} - -pub fn deserialize_object_method_result(result: &[u8]) -> Result, DecodeError> { - let mut context = Context::new(); - context.description = "Deserializing module-type: object_method Result".to_string(); - let mut reader = ReadDecoder::new(result, context); - - reader.context().push("objectMethod", "Option", "reading function output"); - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(AnotherType::read(&mut reader)?); - } else { - object = None; - } - let res = object; - reader.context().pop(); - Ok(res) -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsOptionalEnvMethod { - pub object: AnotherType, - pub opt_object: Option, - pub object_array: Vec, - pub opt_object_array: Option>>, -} - -pub fn deserialize_optional_env_method_args(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing module-type: optional_env_method Args".to_string(); - - let mut reader = ReadDecoder::new(args, context); - let mut num_of_fields = reader.read_map_length()?; - - let mut _object: AnotherType = AnotherType::new(); - let mut _object_set = false; - let mut _opt_object: Option = None; - let mut _object_array: Vec = vec![]; - let mut _object_array_set = false; - let mut _opt_object_array: Option>> = None; - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - "object" => { - reader.context().push(&field, "AnotherType", "type found, reading argument"); - let object = AnotherType::read(&mut reader)?; - _object = object; - _object_set = true; - reader.context().pop(); - } - "optObject" => { - reader.context().push(&field, "Option", "type found, reading argument"); - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(AnotherType::read(&mut reader)?); - } else { - object = None; - } - _opt_object = object; - reader.context().pop(); - } - "objectArray" => { - reader.context().push(&field, "Vec", "type found, reading argument"); - _object_array = reader.read_array(|reader| { - let object = AnotherType::read(reader)?; - Ok(object) - })?; - _object_array_set = true; - reader.context().pop(); - } - "optObjectArray" => { - reader.context().push(&field, "Option>>", "type found, reading argument"); - _opt_object_array = reader.read_optional_array(|reader| { - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(AnotherType::read(reader)?); - } else { - object = None; - } - Ok(object) - })?; - reader.context().pop(); - } - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - if !_object_set { - return Err(DecodeError::MissingField("object: AnotherType.".to_string())); - } - if !_object_array_set { - return Err(DecodeError::MissingField("objectArray: [AnotherType].".to_string())); - } - - Ok(ArgsOptionalEnvMethod { - object: _object, - opt_object: _opt_object, - object_array: _object_array, - opt_object_array: _opt_object_array, - }) -} - -pub fn serialize_optional_env_method_args(args: &ArgsOptionalEnvMethod) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) module-type: optional_env_method Args".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_optional_env_method_args(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_optional_env_method_args(args: &ArgsOptionalEnvMethod, writer: &mut W) -> Result<(), EncodeError> { - writer.write_map_length(&4)?; - writer.context().push("object", "AnotherType", "writing property"); - writer.write_string("object")?; - AnotherType::write(&args.object, writer)?; - writer.context().pop(); - writer.context().push("optObject", "Option", "writing property"); - writer.write_string("optObject")?; - if args.opt_object.is_some() { - AnotherType::write(args.opt_object.as_ref().as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - writer.context().pop(); - writer.context().push("objectArray", "Vec", "writing property"); - writer.write_string("objectArray")?; - writer.write_array(&args.object_array, |writer, item| { - AnotherType::write(item, writer) - })?; - writer.context().pop(); - writer.context().push("optObjectArray", "Option>>", "writing property"); - writer.write_string("optObjectArray")?; - writer.write_optional_array(&args.opt_object_array, |writer, item| { - if item.is_some() { - AnotherType::write(item.as_ref().as_ref().unwrap(), writer) - } else { - writer.write_nil() - } - })?; - writer.context().pop(); - Ok(()) -} - -pub fn serialize_optional_env_method_result(result: &Option) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) module-type: optional_env_method Result".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_optional_env_method_result(result, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_optional_env_method_result(result: &Option, writer: &mut W) -> Result<(), EncodeError> { - writer.context().push("optionalEnvMethod", "Option", "writing result"); - if result.is_some() { - AnotherType::write(result.as_ref().unwrap(), writer)?; - } else { - writer.write_nil()?; - } - writer.context().pop(); - Ok(()) -} - -pub fn deserialize_optional_env_method_result(result: &[u8]) -> Result, DecodeError> { - let mut context = Context::new(); - context.description = "Deserializing module-type: optional_env_method Result".to_string(); - let mut reader = ReadDecoder::new(result, context); - - reader.context().push("optionalEnvMethod", "Option", "reading function output"); - let mut object: Option = None; - if !reader.is_next_nil()? { - object = Some(AnotherType::read(&mut reader)?); - } else { - object = None; - } - let res = object; - reader.context().pop(); - Ok(res) -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsIf { - #[serde(rename = "if")] - pub _if: Else, -} - -pub fn deserialize_if_args(args: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing module-type: if Args".to_string(); - - let mut reader = ReadDecoder::new(args, context); - let mut num_of_fields = reader.read_map_length()?; - - let mut _if: Else = Else::new(); - let mut _if_set = false; - - while num_of_fields > 0 { - num_of_fields -= 1; - let field = reader.read_string()?; - - match field.as_str() { - "if" => { - reader.context().push(&field, "Else", "type found, reading argument"); - let object = Else::read(&mut reader)?; - _if = object; - _if_set = true; - reader.context().pop(); - } - err => return Err(DecodeError::UnknownFieldName(err.to_string())), - } - } - if !_if_set { - return Err(DecodeError::MissingField("if: else.".to_string())); - } - - Ok(ArgsIf { - _if: _if, - }) -} - -pub fn serialize_if_args(args: &ArgsIf) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) module-type: if Args".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_if_args(args, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_if_args(args: &ArgsIf, writer: &mut W) -> Result<(), EncodeError> { - writer.write_map_length(&1)?; - writer.context().push("if", "Else", "writing property"); - writer.write_string("if")?; - Else::write(&args._if, writer)?; - writer.context().pop(); - Ok(()) -} - -pub fn serialize_if_result(result: &Else) -> Result, EncodeError> { - let mut encoder_context = Context::new(); - encoder_context.description = "Serializing (encoding) module-type: if Result".to_string(); - let mut encoder = WriteEncoder::new(&[], encoder_context); - write_if_result(result, &mut encoder)?; - Ok(encoder.get_buffer()) -} - -pub fn write_if_result(result: &Else, writer: &mut W) -> Result<(), EncodeError> { - writer.context().push("if", "Else", "writing result"); - Else::write(&result, writer)?; - writer.context().pop(); - Ok(()) -} - -pub fn deserialize_if_result(result: &[u8]) -> Result { - let mut context = Context::new(); - context.description = "Deserializing module-type: if Result".to_string(); - let mut reader = ReadDecoder::new(result, context); - - reader.context().push("if", "Else", "reading function output"); - let object = Else::read(&mut reader)?; - let res = object; - reader.context().pop(); - Ok(res) -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/wrapped.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/wrapped.rs index e9316ed244..16da48c5ba 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/wrapped.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/wrapped.rs @@ -1,27 +1,48 @@ -use polywrap_wasm_rs::{ - wrap_load_env +use serde::{Deserialize, Serialize}; +use polywrap_msgpack_serde::{ + from_slice, + to_vec, + wrappers::polywrap_json::JSONString, + wrappers::polywrap_bigint::BigIntWrapper }; - -use crate::{ - ArgsModuleMethod, - deserialize_module_method_args, - serialize_module_method_result, - ArgsObjectMethod, - deserialize_object_method_args, - serialize_object_method_result, - ArgsOptionalEnvMethod, - deserialize_optional_env_method_args, - serialize_optional_env_method_result, - ArgsIf, - deserialize_if_args, - serialize_if_result +use polywrap_wasm_rs::{ + BigInt, + BigNumber, + Map, + JSON, + wrap_load_env }; - use crate::module::{ModuleTrait, Module}; +use crate::CustomEnum; +use crate::AnotherType; +use crate::Else; use crate::Env; +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ArgsModuleMethod { + pub str: String, + #[serde(rename = "optStr")] + pub opt_str: Option, + pub en: CustomEnum, + #[serde(rename = "optEnum")] + pub opt_enum: Option, + #[serde(rename = "enumArray")] + pub enum_array: Vec, + #[serde(rename = "optEnumArray")] + pub opt_enum_array: Option>>, + pub map: Map, + #[serde(rename = "mapOfArr")] + pub map_of_arr: Map>, + #[serde(rename = "mapOfMap")] + pub map_of_map: Map>, + #[serde(rename = "mapOfObj")] + pub map_of_obj: Map, + #[serde(rename = "mapOfArrOfObj")] + pub map_of_arr_of_obj: Map>, +} + pub fn module_method_wrapped(args: &[u8], env_size: u32) -> Vec { - match deserialize_module_method_args(args) { + match from_slice::(args) { Ok(args) => { let result = Module::module_method(ArgsModuleMethod { str: args.str, @@ -38,7 +59,7 @@ pub fn module_method_wrapped(args: &[u8], env_size: u32) -> Vec { }); match result { Ok(res) => { - serialize_module_method_result(&res).unwrap() + to_vec(&res).unwrap() } Err(e) => { panic!("{}", e.to_string()) @@ -51,6 +72,17 @@ pub fn module_method_wrapped(args: &[u8], env_size: u32) -> Vec { } } +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ArgsObjectMethod { + pub object: AnotherType, + #[serde(rename = "optObject")] + pub opt_object: Option, + #[serde(rename = "objectArray")] + pub object_array: Vec, + #[serde(rename = "optObjectArray")] + pub opt_object_array: Option>>, +} + pub fn object_method_wrapped(args: &[u8], env_size: u32) -> Vec { if env_size == 0 { panic!("Environment is not set, and it is required by method 'objectMethod'"); @@ -59,7 +91,7 @@ pub fn object_method_wrapped(args: &[u8], env_size: u32) -> Vec { let env_buf = wrap_load_env(env_size); let env = Env::from_buffer(&env_buf).unwrap(); - match deserialize_object_method_args(args) { + match from_slice::(args) { Ok(args) => { let result = Module::object_method(ArgsObjectMethod { object: args.object, @@ -69,7 +101,7 @@ pub fn object_method_wrapped(args: &[u8], env_size: u32) -> Vec { }, env); match result { Ok(res) => { - serialize_object_method_result(&res).unwrap() + to_vec(&res).unwrap() } Err(e) => { panic!("{}", e.to_string()) @@ -82,6 +114,17 @@ pub fn object_method_wrapped(args: &[u8], env_size: u32) -> Vec { } } +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ArgsOptionalEnvMethod { + pub object: AnotherType, + #[serde(rename = "optObject")] + pub opt_object: Option, + #[serde(rename = "objectArray")] + pub object_array: Vec, + #[serde(rename = "optObjectArray")] + pub opt_object_array: Option>>, +} + pub fn optional_env_method_wrapped(args: &[u8], env_size: u32) -> Vec { let mut env: Option = None; if env_size > 0 { @@ -89,7 +132,7 @@ pub fn optional_env_method_wrapped(args: &[u8], env_size: u32) -> Vec { env = Some(Env::from_buffer(&env_buf).unwrap()); } - match deserialize_optional_env_method_args(args) { + match from_slice::(args) { Ok(args) => { let result = Module::optional_env_method(ArgsOptionalEnvMethod { object: args.object, @@ -99,7 +142,7 @@ pub fn optional_env_method_wrapped(args: &[u8], env_size: u32) -> Vec { }, env); match result { Ok(res) => { - serialize_optional_env_method_result(&res).unwrap() + to_vec(&res).unwrap() } Err(e) => { panic!("{}", e.to_string()) @@ -112,15 +155,21 @@ pub fn optional_env_method_wrapped(args: &[u8], env_size: u32) -> Vec { } } +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ArgsIf { + #[serde(rename = "if")] + pub _if: Else, +} + pub fn if_wrapped(args: &[u8], env_size: u32) -> Vec { - match deserialize_if_args(args) { + match from_slice::(args) { Ok(args) => { let result = Module::_if(ArgsIf { _if: args._if, }); match result { Ok(res) => { - serialize_if_result(&res).unwrap() + to_vec(&res).unwrap() } Err(e) => { panic!("{}", e.to_string()) diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/test_import/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/test_import/mod.rs index 7cae6addae..e50df13ba6 100644 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/test_import/mod.rs +++ b/packages/test-cases/cases/bind/sanity/output/wrap-rs/test_import/mod.rs @@ -8,4 +8,4 @@ impl TestImport { pub fn get_implementations() -> Vec { wrap_get_implementations(Self::uri) } -} \ No newline at end of file +} From 8716e2fa698510218aceda23a7c9bd4c10e0db3b Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Sun, 16 Jul 2023 14:37:54 -0400 Subject: [PATCH 04/19] chore: remove debug logging --- .../wasm/golang/module/__tests__/e2e/integration.spec.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/templates/wasm/golang/module/__tests__/e2e/integration.spec.ts b/packages/templates/wasm/golang/module/__tests__/e2e/integration.spec.ts index 48be5b64d8..55913c174a 100644 --- a/packages/templates/wasm/golang/module/__tests__/e2e/integration.spec.ts +++ b/packages/templates/wasm/golang/module/__tests__/e2e/integration.spec.ts @@ -24,8 +24,6 @@ describe("Template Wrapper End to End Tests", () => { args: { arg: expected } }); - console.log(result); - expect(result.ok).toBeTruthy(); if (!result.ok) return; expect(result.value.result).toEqual(expected); From a99bea19dabf732eeff81b0b1bd24b0f6a56a5b8 Mon Sep 17 00:00:00 2001 From: Cesar Date: Tue, 18 Jul 2023 21:13:04 +0200 Subject: [PATCH 05/19] chore: update wrap test harness branch --- WRAP_TEST_HARNESS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WRAP_TEST_HARNESS b/WRAP_TEST_HARNESS index 8b25206ff9..650c38f2e9 100644 --- a/WRAP_TEST_HARNESS +++ b/WRAP_TEST_HARNESS @@ -1 +1 @@ -master \ No newline at end of file +chore/latest-rust-wrap-bindings \ No newline at end of file From 78a8e0418fc1a0af13f00bcc4fcfe34363f91ff7 Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Wed, 19 Jul 2023 00:31:02 +0200 Subject: [PATCH 06/19] chore: fix rust builds --- packages/templates/wasm/rust/Cargo.toml | 3 +- .../build-cmd/wasm/rust/001-sanity/Cargo.toml | 1 + yarn.lock | 74 +++++++++++++------ 3 files changed, 55 insertions(+), 23 deletions(-) diff --git a/packages/templates/wasm/rust/Cargo.toml b/packages/templates/wasm/rust/Cargo.toml index a9c46a250c..fa09362006 100644 --- a/packages/templates/wasm/rust/Cargo.toml +++ b/packages/templates/wasm/rust/Cargo.toml @@ -8,7 +8,8 @@ license = "MIT" edition = "2021" [dependencies] -polywrap-wasm-rs = { version = "0.11.0-pre.0" } +polywrap-wasm-rs = { version = "0.11.0-pre.4" } +polywrap_msgpack_serde = "0.0.2-beta.4" serde = { version = "1.0", features = ["derive"] } [lib] diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/rust/001-sanity/Cargo.toml b/packages/test-cases/cases/cli/build-cmd/wasm/rust/001-sanity/Cargo.toml index 0604b9b1a7..1187466f98 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/rust/001-sanity/Cargo.toml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/rust/001-sanity/Cargo.toml @@ -12,6 +12,7 @@ edition = "2021" [dependencies] polywrap-wasm-rs = { path = "../../../../../../../wasm/rs" } +polywrap_msgpack_serde = "0.0.2-beta.4" serde = { version = "1.0", features = ["derive"] } [lib] diff --git a/yarn.lock b/yarn.lock index 2415cf732f..6ab94ecb8c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3232,6 +3232,18 @@ array.prototype.reduce@^1.0.5: es-array-method-boxes-properly "^1.0.0" is-string "^1.0.7" +arraybuffer.prototype.slice@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz#9b5ea3868a6eebc30273da577eb888381c0044bb" + integrity sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.2" + define-properties "^1.2.0" + get-intrinsic "^1.2.1" + is-array-buffer "^3.0.2" + is-shared-array-buffer "^1.0.2" + arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -3661,9 +3673,9 @@ camelcase@^6.0.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001503: - version "1.0.30001515" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001515.tgz#418aefeed9d024cd3129bfae0ccc782d4cb8f12b" - integrity sha512-eEFDwUOZbE24sb+Ecsx3+OvNETqjWIdabMy52oOkIgcUtAsQifjUG9q4U9dgTHJM2mfk4uEPxc0+xuFdJ629QA== + version "1.0.30001516" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001516.tgz#621b1be7d85a8843ee7d210fd9d87b52e3daab3a" + integrity sha512-Wmec9pCBY8CWbmI4HsjBeQLqDTqV91nFVR83DnZpYyRnPI1wePDsTg0bGLPC5VU/3OIZV1fmxEea1b+tFKe86g== capture-exit@^2.0.0: version "2.0.0" @@ -4438,9 +4450,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" electron-to-chromium@^1.4.431: - version "1.4.460" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.460.tgz#f360a5059c039c4a5fb4dfa99680ad8129dd9f84" - integrity sha512-kKiHnbrHME7z8E6AYaw0ehyxY5+hdaRmeUbjBO22LZMdqTYCO29EvF0T1cQ3pJ1RN5fyMcHl1Lmcsdt9WWJpJQ== + version "1.4.464" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.464.tgz#2f94bad78dff34e527aacbfc5d0b1a33cf046507" + integrity sha512-guZ84yoou4+ILNdj0XEbmGs6DEWj6zpVOWYpY09GU66yEb0DSYvP/biBPzHn0GuW/3RC/pnaYNUWlQE1fJYtgA== elliptic@6.5.4: version "6.5.4" @@ -4514,11 +4526,12 @@ error-ex@^1.2.0, error-ex@^1.3.1: is-arrayish "^0.2.1" es-abstract@^1.19.0, es-abstract@^1.20.4, es-abstract@^1.21.2: - version "1.21.3" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.21.3.tgz#8aaa0ffc080e8a6fef6ace72631dc1ec5d47bf94" - integrity sha512-ZU4miiY1j3sGPFLJ34VJXEqhpmL+HGByCinGHv4HC+Fxl2fI2Z4yR6tl0mORnDr6PA8eihWo4LmSWDbvhALckg== + version "1.22.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.1.tgz#8b4e5fc5cefd7f1660f0f8e1a52900dfbc9d9ccc" + integrity sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw== dependencies: array-buffer-byte-length "^1.0.0" + arraybuffer.prototype.slice "^1.0.1" available-typed-arrays "^1.0.5" call-bind "^1.0.2" es-set-tostringtag "^2.0.1" @@ -4545,10 +4558,13 @@ es-abstract@^1.19.0, es-abstract@^1.20.4, es-abstract@^1.21.2: object-keys "^1.1.1" object.assign "^4.1.4" regexp.prototype.flags "^1.5.0" + safe-array-concat "^1.0.0" safe-regex-test "^1.0.0" string.prototype.trim "^1.2.7" string.prototype.trimend "^1.0.6" string.prototype.trimstart "^1.0.6" + typed-array-buffer "^1.0.0" + typed-array-byte-length "^1.0.0" typed-array-byte-offset "^1.0.0" typed-array-length "^1.0.4" unbox-primitive "^1.0.2" @@ -6158,15 +6174,11 @@ is-text-path@^1.0.1: text-extensions "^1.0.0" is-typed-array@^1.1.10, is-typed-array@^1.1.9: - version "1.1.10" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.10.tgz#36a5b5cb4189b575d1a3e4b08536bfb485801e3f" - integrity sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A== + version "1.1.12" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" + integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" - for-each "^0.3.3" - gopd "^1.0.1" - has-tostringtag "^1.0.0" + which-typed-array "^1.1.11" is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" @@ -9732,6 +9744,25 @@ type@^2.7.2: resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== +typed-array-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz#18de3e7ed7974b0a729d3feecb94338d1472cd60" + integrity sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + is-typed-array "^1.1.10" + +typed-array-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz#d787a24a995711611fb2b87a4052799517b230d0" + integrity sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + typed-array-byte-offset@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz#cbbe89b51fdef9cd6aaf07ad4707340abbc4ea0b" @@ -10091,17 +10122,16 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409" integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ== -which-typed-array@^1.1.10: - version "1.1.10" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.10.tgz#74baa2789991905c2076abb317103b866c64e69e" - integrity sha512-uxoA5vLUfRPdjCuJ1h5LlYdmTLbYfums398v3WLkM+i/Wltl2/XyZpQWKbN++ck5L64SR/grOHqtXCUKmlZPNA== +which-typed-array@^1.1.10, which-typed-array@^1.1.11: + version "1.1.11" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.11.tgz#99d691f23c72aab6768680805a271b69761ed61a" + integrity sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew== dependencies: available-typed-arrays "^1.0.5" call-bind "^1.0.2" for-each "^0.3.3" gopd "^1.0.1" has-tostringtag "^1.0.0" - is-typed-array "^1.1.10" which@^1.2.9, which@^1.3.1: version "1.3.1" From 8a714bc09e0c8a3920c64030048ca982310b38ef Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Wed, 19 Jul 2023 00:59:19 +0200 Subject: [PATCH 07/19] chore: add back rust plugin template tests --- packages/templates/plugin/rust/Cargo.toml | 2 +- packages/templates/tests.spec.ts | 4 ++-- packages/templates/wasm/rust/Cargo.toml | 4 ++-- .../cases/cli/build-cmd/wasm/rust/001-sanity/Cargo.toml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/templates/plugin/rust/Cargo.toml b/packages/templates/plugin/rust/Cargo.toml index 347cd75813..79b0b23af8 100644 --- a/packages/templates/plugin/rust/Cargo.toml +++ b/packages/templates/plugin/rust/Cargo.toml @@ -14,7 +14,7 @@ include = [ polywrap_core = { version = "~0.1.6-beta.1" } polywrap_plugin = { version = "~0.1.6-beta.1" } polywrap_msgpack = { version = "~0.1.6-beta.1" } -polywrap_msgpack_serde = { version = "~0.0.2-beta.1" } +polywrap_msgpack_serde = { version = "~0.0.2-beta.5" } wrap_manifest_schemas = { version = "~0.1.6-beta.1" } serde = {version = "1.0.145", features = ["derive"]} diff --git a/packages/templates/tests.spec.ts b/packages/templates/tests.spec.ts index eb5b8d3937..395fb12314 100644 --- a/packages/templates/tests.spec.ts +++ b/packages/templates/tests.spec.ts @@ -36,8 +36,8 @@ describe("Templates", () => { }, "plugin/rust": { codegen: "npx polywrap codegen", - /*build: "cargo build", - test: "cargo test",*/ + build: "cargo build", + test: "cargo test", }, interface: { build: "npx polywrap build" }, }; diff --git a/packages/templates/wasm/rust/Cargo.toml b/packages/templates/wasm/rust/Cargo.toml index fa09362006..b5e4af31ea 100644 --- a/packages/templates/wasm/rust/Cargo.toml +++ b/packages/templates/wasm/rust/Cargo.toml @@ -8,8 +8,8 @@ license = "MIT" edition = "2021" [dependencies] -polywrap-wasm-rs = { version = "0.11.0-pre.4" } -polywrap_msgpack_serde = "0.0.2-beta.4" +polywrap-wasm-rs = { version = "~0.11.0-pre.4" } +polywrap_msgpack_serde = "~0.0.2-beta.5" serde = { version = "1.0", features = ["derive"] } [lib] diff --git a/packages/test-cases/cases/cli/build-cmd/wasm/rust/001-sanity/Cargo.toml b/packages/test-cases/cases/cli/build-cmd/wasm/rust/001-sanity/Cargo.toml index 1187466f98..0f0fc6300b 100644 --- a/packages/test-cases/cases/cli/build-cmd/wasm/rust/001-sanity/Cargo.toml +++ b/packages/test-cases/cases/cli/build-cmd/wasm/rust/001-sanity/Cargo.toml @@ -12,7 +12,7 @@ edition = "2021" [dependencies] polywrap-wasm-rs = { path = "../../../../../../../wasm/rs" } -polywrap_msgpack_serde = "0.0.2-beta.4" +polywrap_msgpack_serde = "~0.0.2-beta.5" serde = { version = "1.0", features = ["derive"] } [lib] From 90b3f1bd9469753b08b0f2d4e3877e2c25a4c741 Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Wed, 19 Jul 2023 01:20:14 +0200 Subject: [PATCH 08/19] chore: remove bind test-case output --- packages/schema/bind/src/__tests__/index.ts | 30 +- .../bind/src/__tests__/test-cases.spec.ts | 40 +- packages/schema/bind/src/types.ts | 23 +- .../cases/bind/sanity/output/app-ts/index.ts | 1 - .../cases/bind/sanity/output/app-ts/types.ts | 224 -- .../bind/sanity/output/plugin-kt/module.kt | 142 - .../bind/sanity/output/plugin-kt/types.kt | 223 -- .../bind/sanity/output/plugin-kt/wrap.info.kt | 17 - .../bind/sanity/output/plugin-py/__init__.py | 6 - .../bind/sanity/output/plugin-py/module.py | 94 - .../bind/sanity/output/plugin-py/types.py | 244 -- .../bind/sanity/output/plugin-py/wrap_info.py | 2441 ----------------- .../cases/bind/sanity/output/plugin-rs/mod.rs | 7 - .../bind/sanity/output/plugin-rs/module.rs | 69 - .../bind/sanity/output/plugin-rs/types.rs | 289 -- .../bind/sanity/output/plugin-rs/wrap.info.rs | 2436 ---------------- .../bind/sanity/output/plugin-ts/index.ts | 8 - .../bind/sanity/output/plugin-ts/module.ts | 67 - .../bind/sanity/output/plugin-ts/types.ts | 257 -- .../bind/sanity/output/plugin-ts/wrap.info.ts | 2433 ---------------- .../output/wrap-as/AnotherType/index.ts | 37 - .../wrap-as/AnotherType/serialization.ts | 93 - .../sanity/output/wrap-as/CustomEnum/index.ts | 34 - .../output/wrap-as/CustomMapValue/index.ts | 35 - .../wrap-as/CustomMapValue/serialization.ts | 68 - .../sanity/output/wrap-as/CustomType/index.ts | 76 - .../wrap-as/CustomType/serialization.ts | 845 ------ .../bind/sanity/output/wrap-as/Env/index.ts | 37 - .../output/wrap-as/Env/serialization.ts | 98 - .../sanity/output/wrap-as/Module/index.ts | 14 - .../sanity/output/wrap-as/Module/module.ts | 28 - .../output/wrap-as/Module/serialization.ts | 770 ------ .../sanity/output/wrap-as/Module/wrapped.ts | 86 - .../sanity/output/wrap-as/TestImport/index.ts | 11 - .../bind/sanity/output/wrap-as/else/index.ts | 35 - .../output/wrap-as/else/serialization.ts | 68 - .../cases/bind/sanity/output/wrap-as/entry.ts | 59 - .../TestImport_AnotherObject/index.ts | 38 - .../TestImport_AnotherObject/serialization.ts | 68 - .../wrap-as/imported/TestImport_Enum/index.ts | 34 - .../imported/TestImport_Enum_Return/index.ts | 34 - .../wrap-as/imported/TestImport_Env/index.ts | 46 - .../imported/TestImport_Env/serialization.ts | 238 -- .../imported/TestImport_Module/index.ts | 98 - .../TestImport_Module/serialization.ts | 559 ---- .../imported/TestImport_Object/index.ts | 45 - .../TestImport_Object/serialization.ts | 238 -- .../sanity/output/wrap-as/imported/index.ts | 6 - .../cases/bind/sanity/output/wrap-as/index.ts | 47 - .../bind/sanity/output/wrap-as/while/index.ts | 34 - .../bind/sanity/output/wrap-rs/_else/mod.rs | 25 - .../bind/sanity/output/wrap-rs/_while/mod.rs | 53 - .../sanity/output/wrap-rs/another_type/mod.rs | 30 - .../sanity/output/wrap-rs/custom_enum/mod.rs | 53 - .../output/wrap-rs/custom_map_value/mod.rs | 24 - .../sanity/output/wrap-rs/custom_type/mod.rs | 135 - .../cases/bind/sanity/output/wrap-rs/entry.rs | 41 - .../bind/sanity/output/wrap-rs/env/mod.rs | 30 - .../sanity/output/wrap-rs/imported/mod.rs | 12 - .../test_import_another_object/mod.rs | 26 - .../wrap-rs/imported/test_import_enum/mod.rs | 53 - .../imported/test_import_enum_return/mod.rs | 53 - .../wrap-rs/imported/test_import_env/mod.rs | 42 - .../imported/test_import_module/mod.rs | 99 - .../imported/test_import_object/mod.rs | 48 - .../cases/bind/sanity/output/wrap-rs/mod.rs | 64 - .../bind/sanity/output/wrap-rs/module/mod.rs | 14 - .../sanity/output/wrap-rs/module/module.rs | 32 - .../sanity/output/wrap-rs/module/wrapped.rs | 183 -- .../sanity/output/wrap-rs/test_import/mod.rs | 11 - 70 files changed, 48 insertions(+), 13910 deletions(-) delete mode 100644 packages/test-cases/cases/bind/sanity/output/app-ts/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/app-ts/types.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-kt/module.kt delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-kt/types.kt delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-kt/wrap.info.kt delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-py/__init__.py delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-py/module.py delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-py/types.py delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-py/wrap_info.py delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-rs/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-rs/wrap.info.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-ts/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-ts/module.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-ts/wrap.info.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/AnotherType/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/AnotherType/serialization.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/CustomEnum/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/CustomMapValue/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/CustomMapValue/serialization.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/CustomType/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/CustomType/serialization.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/Env/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/Env/serialization.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/Module/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/Module/module.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/Module/serialization.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/Module/wrapped.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/TestImport/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/else/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/else/serialization.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/entry.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_AnotherObject/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_AnotherObject/serialization.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Enum/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Enum_Return/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Env/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Env/serialization.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Module/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Module/serialization.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Object/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Object/serialization.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/imported/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-as/while/index.ts delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/_else/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/_while/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/another_type/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_enum/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_map_value/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_type/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/entry.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/env/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_another_object/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_enum/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_enum_return/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_env/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_module/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_object/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/module/mod.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/module/module.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/module/wrapped.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/wrap-rs/test_import/mod.rs diff --git a/packages/schema/bind/src/__tests__/index.ts b/packages/schema/bind/src/__tests__/index.ts index 43e2574058..1b2dd4bcd3 100644 --- a/packages/schema/bind/src/__tests__/index.ts +++ b/packages/schema/bind/src/__tests__/index.ts @@ -1,4 +1,4 @@ -import { BindOptions, BindLanguage } from "../"; +import { BindOptions, BindLanguage, bindLanguage } from "../"; import fs from "fs"; import path from "path"; @@ -14,7 +14,7 @@ export type TestCase = { input: BindOptions; outputLanguages: { language: string; - directory: string; + directory?: string; }[]; }; @@ -25,6 +25,7 @@ export type TestCases = { export function fetchTestCases(): TestCases { const cases: TestCases = []; + const bindLanguages = Object.keys(bindLanguage); const fetchIfExists = (file: string): string | undefined => { if (fs.existsSync(file)) { @@ -61,15 +62,22 @@ export function fetchTestCases(): TestCases { // Fetch each language's expected output const outputDir = path.join(root, dirent.name, "output"); - const outputLanguages = fs - .readdirSync(outputDir, { withFileTypes: true }) - .filter((item: fs.Dirent) => item.isDirectory()) - .map((item: fs.Dirent) => { - return { - language: item.name, - directory: path.join(outputDir, item.name) - }; - }); + const outputLanguages: { + language: string; + directory?: string; + }[] = []; + + for (const language of bindLanguages) { + const outputLanguageDir = path.join(outputDir, language); + if (fs.existsSync(outputLanguageDir)) { + outputLanguages.push({ + language, + directory: outputLanguageDir + }); + } else { + outputLanguages.push({ language }); + } + } // Parse the input schema into the Abi structure const abi = parseSchema(schema); diff --git a/packages/schema/bind/src/__tests__/test-cases.spec.ts b/packages/schema/bind/src/__tests__/test-cases.spec.ts index 0e4a9188e1..08768073a6 100644 --- a/packages/schema/bind/src/__tests__/test-cases.spec.ts +++ b/packages/schema/bind/src/__tests__/test-cases.spec.ts @@ -37,12 +37,6 @@ describe("Polywrap Binding Test Suite", () => { // Verify it binds correctly const { language, directory } = outputLanguage; - // Read the expected output directories - let expectedOutput: BindOutput = { - output: readDirectorySync(directory), - outputDirAbs: testCase.input.outputDirAbs, - }; - const bindOptions: BindOptions = { ...deepCopy(testCase.input), wrapInfo: { @@ -61,6 +55,12 @@ describe("Polywrap Binding Test Suite", () => { const output = await bindSchema(bindOptions); + // Read the expected output directories + let expectedOutput: BindOutput | undefined = !directory ? undefined : { + output: readDirectorySync(directory), + outputDirAbs: testCase.input.outputDirAbs, + }; + const sort = (array: OutputEntry[]): OutputEntry[] => { array.forEach((entry) => { if (typeof entry.data !== "string") entry.data = sort(entry.data); @@ -70,7 +70,10 @@ describe("Polywrap Binding Test Suite", () => { }; output.output.entries = sort(output.output.entries); - expectedOutput.output.entries = sort(expectedOutput.output.entries); + + if (expectedOutput) { + expectedOutput.output.entries = sort(expectedOutput.output.entries); + } const testResultDir = path.join(__dirname, "/test-results/", language); @@ -78,24 +81,8 @@ describe("Polywrap Binding Test Suite", () => { fs.mkdirSync(testResultDir, { recursive: true }); } - writeFileSync( - path.join( - testResultDir, - `${language}-output.json` - ), - JSON.stringify(output, null, 2), - ); - writeFileSync( - path.join( - testResultDir, - `${language}-expected.json` - ), - JSON.stringify(expectedOutput, null, 2), - ); - const paths: string[] = []; - const outputDirectoryEntry = (root: string, entry: OutputEntry) => { const entryPath = path.join(root, entry.name); paths.push(entryPath); @@ -128,8 +115,11 @@ describe("Polywrap Binding Test Suite", () => { outputDirectoryEntry(testResultDir, entry); } - - expect(output).toMatchObject(expectedOutput); + if (expectedOutput) { + expect(output).toMatchObject(expectedOutput); + } else { + expect(output.output.entries.length).toBeGreaterThan(0); + } } }); } diff --git a/packages/schema/bind/src/types.ts b/packages/schema/bind/src/types.ts index cb92c63d1f..93a0402f0d 100644 --- a/packages/schema/bind/src/types.ts +++ b/packages/schema/bind/src/types.ts @@ -1,15 +1,20 @@ import { OutputDirectory } from "@polywrap/os-js"; import { WrapManifest } from "@polywrap/wrap-manifest-types-js"; -export type BindLanguage = - | "wrap-as" - | "wrap-rs" - | "wrap-go" - | "plugin-ts" - | "plugin-rs" - | "plugin-py" - | "plugin-kt" - | "app-ts"; +export const bindLanguage = { + "wrap-as": "wrap-as", + "wrap-rs": "wrap-rs", + "wrap-go": "wrap-go", + "plugin-ts": "plugin-ts", + "plugin-rs": "plugin-rs", + "plugin-py": "plugin-py", + "plugin-kt": "plugin-kt", + "app-ts": "app-ts", +}; + +export type BindLanguages = typeof bindLanguage; + +export type BindLanguage = keyof BindLanguages; export interface BindOutput { output: OutputDirectory; diff --git a/packages/test-cases/cases/bind/sanity/output/app-ts/index.ts b/packages/test-cases/cases/bind/sanity/output/app-ts/index.ts deleted file mode 100644 index eea524d655..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/app-ts/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./types"; diff --git a/packages/test-cases/cases/bind/sanity/output/app-ts/types.ts b/packages/test-cases/cases/bind/sanity/output/app-ts/types.ts deleted file mode 100644 index 63cbd9c017..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/app-ts/types.ts +++ /dev/null @@ -1,224 +0,0 @@ -// @ts-ignore -import * as Types from "./"; - -// @ts-ignore -import { - CoreClient, - InvokeResult, - Uri, -} from "@polywrap/core-js"; - -export type UInt = number; -export type UInt8 = number; -export type UInt16 = number; -export type UInt32 = number; -export type Int = number; -export type Int8 = number; -export type Int16 = number; -export type Int32 = number; -export type Bytes = Uint8Array; -export type BigInt = string; -export type BigNumber = string; -export type Json = string; -export type String = string; -export type Boolean = boolean; - -export interface CustomType { - str: Types.String; - optStr?: Types.String | null; - u: Types.UInt; - optU?: Types.UInt | null; - u8: Types.UInt8; - u16: Types.UInt16; - u32: Types.UInt32; - i: Types.Int; - i8: Types.Int8; - i16: Types.Int16; - i32: Types.Int32; - bigint: Types.BigInt; - optBigint?: Types.BigInt | null; - bignumber: Types.BigNumber; - optBignumber?: Types.BigNumber | null; - json: Types.Json; - optJson?: Types.Json | null; - bytes: Types.Bytes; - optBytes?: Types.Bytes | null; - boolean: Types.Boolean; - optBoolean?: Types.Boolean | null; - u_array: Array; - uOpt_array?: Array | null; - _opt_uOptArray?: Array | null; - optStrOptArray?: Array | null; - uArrayArray: Array>; - uOptArrayOptArray: Array | null>; - uArrayOptArrayArray: Array> | null>; - crazyArray?: Array | null>> | null> | null; - object: Types.AnotherType; - optObject?: Types.AnotherType | null; - objectArray: Array; - optObjectArray?: Array | null; - en: Types.CustomEnum; - optEnum?: Types.CustomEnum | null; - enumArray: Array; - optEnumArray?: Array | null; - map: Map; - mapOfArr: Map>; - mapOfObj: Map; - mapOfArrOfObj: Map>; - mapCustomValue: Map; -} - -export interface AnotherType { - prop?: Types.String | null; - circular?: Types.CustomType | null; - const?: Types.String | null; -} - -export interface CustomMapValue { - foo: Types.String; -} - -export interface _else { - else: Types.String; -} - -export enum CustomEnumEnum { - STRING, - BYTES, -} - -export type CustomEnumString = - | "STRING" - | "BYTES" - -export type CustomEnum = CustomEnumEnum | CustomEnumString; - -export enum whileEnum { - for, - in, -} - -export type whileString = - | "for" - | "in" - -export type _while = whileEnum | whileString; - -/// Imported Objects START /// - -/* URI: "testimport.uri.eth" */ -export interface TestImport_Object { - object: Types.TestImport_AnotherObject; - optObject?: Types.TestImport_AnotherObject | null; - objectArray: Array; - optObjectArray?: Array | null; - en: Types.TestImport_Enum; - optEnum?: Types.TestImport_Enum | null; - enumArray: Array; - optEnumArray?: Array | null; -} - -/* URI: "testimport.uri.eth" */ -export interface TestImport_AnotherObject { - prop: Types.String; -} - -/// Imported Objects END /// - -/// Imported Enums START /// - -/* URI: "testimport.uri.eth" */ -export enum TestImport_EnumEnum { - STRING, - BYTES, -} - -export type TestImport_EnumString = - | "STRING" - | "BYTES" - -export type TestImport_Enum = TestImport_EnumEnum | TestImport_EnumString; - -/* URI: "testimport.uri.eth" */ -export enum TestImport_Enum_ReturnEnum { - STRING, - BYTES, -} - -export type TestImport_Enum_ReturnString = - | "STRING" - | "BYTES" - -export type TestImport_Enum_Return = TestImport_Enum_ReturnEnum | TestImport_Enum_ReturnString; - -/// Imported Enums END /// - -/// Imported Modules START /// - -/* URI: "testimport.uri.eth" */ -export interface TestImport_Module_Args_importedMethod { - str: Types.String; - optStr?: Types.String | null; - u: Types.UInt; - optU?: Types.UInt | null; - uArrayArray: Array | null>; - object: Types.TestImport_Object; - optObject?: Types.TestImport_Object | null; - objectArray: Array; - optObjectArray?: Array | null; - en: Types.TestImport_Enum; - optEnum?: Types.TestImport_Enum | null; - enumArray: Array; - optEnumArray?: Array | null; -} - -/* URI: "testimport.uri.eth" */ -export interface TestImport_Module_Args_anotherMethod { - arg: Array; -} - -/* URI: "testimport.uri.eth" */ -export interface TestImport_Module_Args_returnsArrayOfEnums { - arg: Types.String; -} - -/* URI: "testimport.uri.eth" */ -export const TestImport_Module = { - importedMethod: async ( - args: TestImport_Module_Args_importedMethod, - client: CoreClient, - uri: string = "testimport.uri.eth" - ): Promise> => { - return client.invoke({ - uri: Uri.from(uri), - method: "importedMethod", - args: (args as unknown) as Record, - }); - }, - - anotherMethod: async ( - args: TestImport_Module_Args_anotherMethod, - client: CoreClient, - uri: string = "testimport.uri.eth" - ): Promise> => { - return client.invoke({ - uri: Uri.from(uri), - method: "anotherMethod", - args: (args as unknown) as Record, - }); - }, - - returnsArrayOfEnums: async ( - args: TestImport_Module_Args_returnsArrayOfEnums, - client: CoreClient, - uri: string = "testimport.uri.eth" - ): Promise>> => { - return client.invoke>({ - uri: Uri.from(uri), - method: "returnsArrayOfEnums", - args: (args as unknown) as Record, - }); - } -}; - -/// Imported Modules END /// diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-kt/module.kt b/packages/test-cases/cases/bind/sanity/output/plugin-kt/module.kt deleted file mode 100644 index c230059e30..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-kt/module.kt +++ /dev/null @@ -1,142 +0,0 @@ -/// NOTE: This is an auto-generated file. -/// All modifications will be overwritten. - -package test.wrap - -import io.polywrap.core.Invoker -import io.polywrap.core.msgpack.msgPackDecode -import io.polywrap.core.msgpack.msgPackEncode -import io.polywrap.core.msgpack.MsgPackMap -import io.polywrap.plugin.PluginMethod -import io.polywrap.plugin.PluginModule -import kotlinx.serialization.Serializable -import kotlinx.serialization.serializer - -@Serializable -data class ArgsModuleMethod( - val str: String, - val optStr: String? = null, - val en: CustomEnum, - val optEnum: CustomEnum? = null, - val enumArray: List, - val optEnumArray: List? = null, - val map: MsgPackMap, - val mapOfArr: MsgPackMap>, - val mapOfMap: MsgPackMap>, - val mapOfObj: MsgPackMap, - val mapOfArrOfObj: MsgPackMap>, -) - -@Serializable -data class ArgsObjectMethod( - val _object: AnotherType, - val optObject: AnotherType? = null, - val objectArray: List, - val optObjectArray: List? = null, -) - -@Serializable -data class ArgsOptionalEnvMethod( - val _object: AnotherType, - val optObject: AnotherType? = null, - val objectArray: List, - val optObjectArray: List? = null, -) - -@Serializable -data class ArgsIf( - val _if: Else, -) - -@Suppress("UNUSED_PARAMETER", "FunctionName") -abstract class Module(config: TConfig) : PluginModule(config) { - - final override val methods: Map = mapOf( - "moduleMethod" to ::__moduleMethod, - "objectMethod" to ::__objectMethod, - "optionalEnvMethod" to ::__optionalEnvMethod, - "if" to ::__if, - ) - - abstract suspend fun moduleMethod( - args: ArgsModuleMethod, - invoker: Invoker - ): Int - - abstract suspend fun objectMethod( - args: ArgsObjectMethod, - env: Env, - invoker: Invoker - ): AnotherType? - - abstract suspend fun optionalEnvMethod( - args: ArgsOptionalEnvMethod, - env: Env? = null, - invoker: Invoker - ): AnotherType? - - abstract suspend fun _if( - args: ArgsIf, - invoker: Invoker - ): Else - - private suspend fun __moduleMethod( - encodedArgs: ByteArray?, - encodedEnv: ByteArray?, - invoker: Invoker - ): ByteArray { - val args: ArgsModuleMethod = encodedArgs?.let { - msgPackDecode(ArgsModuleMethod.serializer(), it).getOrNull() - ?: throw Exception("Failed to decode args in invocation to plugin method 'moduleMethod'") - } ?: throw Exception("Missing args in invocation to plugin method 'moduleMethod'") - val response = moduleMethod(args, invoker) - return msgPackEncode(serializer(), response) - } - - private suspend fun __objectMethod( - encodedArgs: ByteArray?, - encodedEnv: ByteArray?, - invoker: Invoker - ): ByteArray { - val args: ArgsObjectMethod = encodedArgs?.let { - msgPackDecode(ArgsObjectMethod.serializer(), it).getOrNull() - ?: throw Exception("Failed to decode args in invocation to plugin method 'objectMethod'") - } ?: throw Exception("Missing args in invocation to plugin method 'objectMethod'") - val env: Env = encodedEnv?.let { - msgPackDecode(Env.serializer(), it).getOrNull() - ?: throw Exception("Failed to decode env in invocation to plugin method 'objectMethod'") - } ?: throw Exception("Missing env in invocation to plugin method 'objectMethod'") - val response = objectMethod(args, env, invoker) - return msgPackEncode(serializer(), response) - } - - private suspend fun __optionalEnvMethod( - encodedArgs: ByteArray?, - encodedEnv: ByteArray?, - invoker: Invoker - ): ByteArray { - val args: ArgsOptionalEnvMethod = encodedArgs?.let { - msgPackDecode(ArgsOptionalEnvMethod.serializer(), it).getOrNull() - ?: throw Exception("Failed to decode args in invocation to plugin method 'optionalEnvMethod'") - } ?: throw Exception("Missing args in invocation to plugin method 'optionalEnvMethod'") - val env: Env? = encodedEnv?.let { - msgPackDecode(Env.serializer(), it).getOrNull() - ?: throw Exception("Failed to decode env in invocation to plugin method 'optionalEnvMethod'") - } - val response = optionalEnvMethod(args, env, invoker) - return msgPackEncode(serializer(), response) - } - - private suspend fun __if( - encodedArgs: ByteArray?, - encodedEnv: ByteArray?, - invoker: Invoker - ): ByteArray { - val args: ArgsIf = encodedArgs?.let { - msgPackDecode(ArgsIf.serializer(), it).getOrNull() - ?: throw Exception("Failed to decode args in invocation to plugin method 'if'") - } ?: throw Exception("Missing args in invocation to plugin method 'if'") - val response = _if(args, invoker) - return msgPackEncode(serializer(), response) - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-kt/types.kt b/packages/test-cases/cases/bind/sanity/output/plugin-kt/types.kt deleted file mode 100644 index 639ab3bc55..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-kt/types.kt +++ /dev/null @@ -1,223 +0,0 @@ -/// NOTE: This is an auto-generated file. -/// All modifications will be overwritten. - -package test.wrap - -import io.polywrap.core.Invoker -import io.polywrap.core.InvokeResult -import io.polywrap.core.resolution.Uri -import io.polywrap.core.msgpack.MsgPackMap -import kotlinx.serialization.Serializable - -typealias BigInt = String -typealias BigNumber = String -typealias Json = String - -/// Env START /// -@Serializable -data class Env( - val prop: String, - val optProp: String? = null, - val optMap: MsgPackMap? = null, -) -/// Env END /// - -/// Objects START /// -@Serializable -data class CustomType( - val str: String, - val optStr: String? = null, - val u: UInt, - val optU: UInt? = null, - val u8: UByte, - val u16: UShort, - val u32: UInt, - val i: Int, - val i8: Byte, - val i16: Short, - val i32: Int, - val bigint: BigInt, - val optBigint: BigInt? = null, - val bignumber: BigNumber, - val optBignumber: BigNumber? = null, - val json: Json, - val optJson: Json? = null, - val bytes: ByteArray, - val optBytes: ByteArray? = null, - val boolean: Boolean, - val optBoolean: Boolean? = null, - val u_array: List, - val uOpt_array: List? = null, - val _opt_uOptArray: List? = null, - val optStrOptArray: List? = null, - val uArrayArray: List>, - val uOptArrayOptArray: List?>, - val uArrayOptArrayArray: List>?>, - val crazyArray: List?>>?>? = null, - val _object: AnotherType, - val optObject: AnotherType? = null, - val objectArray: List, - val optObjectArray: List? = null, - val en: CustomEnum, - val optEnum: CustomEnum? = null, - val enumArray: List, - val optEnumArray: List? = null, - val map: MsgPackMap, - val mapOfArr: MsgPackMap>, - val mapOfObj: MsgPackMap, - val mapOfArrOfObj: MsgPackMap>, - val mapCustomValue: MsgPackMap, -) - -@Serializable -data class AnotherType( - val prop: String? = null, - val circular: CustomType? = null, - val const: String? = null, -) - -@Serializable -data class CustomMapValue( - val foo: String, -) - -@Serializable -data class Else( - val _else: String, -) - -/// Objects END /// - -/// Enums START /// -@Serializable -enum class CustomEnum { - STRING, - BYTES -} - -@Serializable -enum class While { - _for, - _in -} - -/// Enums END /// - -/// Imported Objects START /// -/* URI: "testimport.uri.eth" */ -@Serializable -data class TestImportObject( - val _object: TestImportAnotherObject, - val optObject: TestImportAnotherObject? = null, - val objectArray: List, - val optObjectArray: List? = null, - val en: TestImportEnum, - val optEnum: TestImportEnum? = null, - val enumArray: List, - val optEnumArray: List? = null, -) - -/* URI: "testimport.uri.eth" */ -@Serializable -data class TestImportAnotherObject( - val prop: String, -) - -/* URI: "testimport.uri.eth" */ -@Serializable -enum class TestImportEnum { - STRING, - BYTES -} - -/* URI: "testimport.uri.eth" */ -@Serializable -enum class TestImportEnumReturn { - STRING, - BYTES -} - -/// Imported Objects END /// - -/// Imported Modules START /// -/* URI: "testimport.uri.eth" */ -@Serializable -data class TestImportModuleArgsImportedMethod( - val str: String, - val optStr: String? = null, - val u: UInt, - val optU: UInt? = null, - val uArrayArray: List?>, - val _object: TestImportObject, - val optObject: TestImportObject? = null, - val objectArray: List, - val optObjectArray: List? = null, - val en: TestImportEnum, - val optEnum: TestImportEnum? = null, - val enumArray: List, - val optEnumArray: List? = null, -) - -/* URI: "testimport.uri.eth" */ -@Serializable -data class TestImportModuleArgsAnotherMethod( - val arg: List, -) - -/* URI: "testimport.uri.eth" */ -@Serializable -data class TestImportModuleArgsReturnsArrayOfEnums( - val arg: String, -) - -/* URI: "testimport.uri.eth" */ -class TestImportModule(uri: String) { - companion object { - val interfaceUri: String = "testimport.uri.eth" - } - - val uri: Uri = Uri(uri) - - suspend fun importedMethod( - args: TestImportModuleArgsImportedMethod, - invoker: Invoker - ): InvokeResult { - return invoker.invoke( - uri = this.uri, - method = "importedMethod", - args = args - ); - } - - suspend fun anotherMethod( - args: TestImportModuleArgsAnotherMethod, - invoker: Invoker - ): InvokeResult { - return invoker.invoke( - uri = this.uri, - method = "anotherMethod", - args = args - ); - } - - suspend fun returnsArrayOfEnums( - args: TestImportModuleArgsReturnsArrayOfEnums, - invoker: Invoker - ): InvokeResult> { - return invoker.invoke( - uri = this.uri, - method = "returnsArrayOfEnums", - args = args - ); - } -} - -/// Imported Modules END /// - -object TestImport { - val uri: Uri = Uri("testimport.uri.eth"); - - suspend fun getImplementations(invoker: Invoker): Result> { - return invoker.getImplementations(this.uri) - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-kt/wrap.info.kt b/packages/test-cases/cases/bind/sanity/output/plugin-kt/wrap.info.kt deleted file mode 100644 index 803d28343d..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-kt/wrap.info.kt +++ /dev/null @@ -1,17 +0,0 @@ -/// NOTE: This is an auto-generated file. -/// All modifications will be overwritten. - -package test.wrap - -import io.polywrap.core.wrap.WrapManifest -import io.polywrap.core.wrap.formats.wrap01.abi.Abi01 -import io.polywrap.core.msgpack.msgPackDecode - -val manifest = WrapManifest( - name = "Test", - type = "plugin", - version = "0.1", - abi = msgPackDecode(Abi01.serializer(), byteArrayOf( - 200.toByte(),89.toByte(),48.toByte(),1.toByte(),138.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),115.toByte(),146.toByte(),199.toByte(),47.toByte(),1.toByte(),131.toByte(),169.toByte(),99.toByte(),111.toByte(),110.toByte(),115.toByte(),116.toByte(),97.toByte(),110.toByte(),116.toByte(),115.toByte(),146.toByte(),166.toByte(),83.toByte(),84.toByte(),82.toByte(),73.toByte(),78.toByte(),71.toByte(),165.toByte(),66.toByte(),89.toByte(),84.toByte(),69.toByte(),83.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),8.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),36.toByte(),1.toByte(),131.toByte(),169.toByte(),99.toByte(),111.toByte(),110.toByte(),115.toByte(),116.toByte(),97.toByte(),110.toByte(),116.toByte(),115.toByte(),146.toByte(),163.toByte(),102.toByte(),111.toByte(),114.toByte(),162.toByte(),105.toByte(),110.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),8.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),119.toByte(),104.toByte(),105.toByte(),108.toByte(),101.toByte(),167.toByte(),101.toByte(),110.toByte(),118.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),200.toByte(),1.toByte(),163.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),206.toByte(),0.toByte(),1.toByte(),0.toByte(),0.toByte(),170.toByte(),112.toByte(),114.toByte(),111.toByte(),112.toByte(),101.toByte(),114.toByte(),116.toByte(),105.toByte(),101.toByte(),115.toByte(),147.toByte(),199.toByte(),88.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),164.toByte(),112.toByte(),114.toByte(),111.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),39.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),164.toByte(),112.toByte(),114.toByte(),111.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),199.toByte(),74.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),111.toByte(),112.toByte(),116.toByte(),80.toByte(),114.toByte(),111.toByte(),112.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),32.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),111.toByte(),112.toByte(),116.toByte(),80.toByte(),114.toByte(),111.toByte(),112.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),199.toByte(),216.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),199.toByte(),168.toByte(),1.toByte(),134.toByte(),163.toByte(),107.toByte(),101.toByte(),121.toByte(),199.toByte(),41.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),112.toByte(),116.toByte(),77.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),206.toByte(),0.toByte(),4.toByte(),0.toByte(),2.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),112.toByte(),116.toByte(),77.toByte(),97.toByte(),112.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),28.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),112.toByte(),116.toByte(),77.toByte(),97.toByte(),112.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),176.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),73.toByte(),110.toByte(),116.toByte(),62.toByte(),165.toByte(),118.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),199.toByte(),28.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),112.toByte(),116.toByte(),77.toByte(),97.toByte(),112.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),112.toByte(),116.toByte(),77.toByte(),97.toByte(),112.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),176.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),73.toByte(),110.toByte(),116.toByte(),62.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),69.toByte(),110.toByte(),118.toByte(),177.toByte(),105.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),101.toByte(),100.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),115.toByte(),146.toByte(),199.toByte(),114.toByte(),1.toByte(),134.toByte(),169.toByte(),99.toByte(),111.toByte(),110.toByte(),115.toByte(),116.toByte(),97.toByte(),110.toByte(),116.toByte(),115.toByte(),146.toByte(),166.toByte(),83.toByte(),84.toByte(),82.toByte(),73.toByte(),78.toByte(),71.toByte(),165.toByte(),66.toByte(),89.toByte(),84.toByte(),69.toByte(),83.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),2.toByte(),8.toByte(),169.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),115.toByte(),112.toByte(),97.toByte(),99.toByte(),101.toByte(),170.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),170.toByte(),110.toByte(),97.toByte(),116.toByte(),105.toByte(),118.toByte(),101.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),163.toByte(),117.toByte(),114.toByte(),105.toByte(),178.toByte(),116.toByte(),101.toByte(),115.toByte(),116.toByte(),105.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),46.toByte(),117.toByte(),114.toByte(),105.toByte(),46.toByte(),101.toByte(),116.toByte(),104.toByte(),199.toByte(),121.toByte(),1.toByte(),134.toByte(),169.toByte(),99.toByte(),111.toByte(),110.toByte(),115.toByte(),116.toByte(),97.toByte(),110.toByte(),116.toByte(),115.toByte(),146.toByte(),166.toByte(),83.toByte(),84.toByte(),82.toByte(),73.toByte(),78.toByte(),71.toByte(),165.toByte(),66.toByte(),89.toByte(),84.toByte(),69.toByte(),83.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),2.toByte(),8.toByte(),169.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),115.toByte(),112.toByte(),97.toByte(),99.toByte(),101.toByte(),170.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),170.toByte(),110.toByte(),97.toByte(),116.toByte(),105.toByte(),118.toByte(),101.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),182.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),95.toByte(),82.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),163.toByte(),117.toByte(),114.toByte(),105.toByte(),178.toByte(),116.toByte(),101.toByte(),115.toByte(),116.toByte(),105.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),46.toByte(),117.toByte(),114.toByte(),105.toByte(),46.toByte(),101.toByte(),116.toByte(),104.toByte(),176.toByte(),105.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),101.toByte(),100.toByte(),69.toByte(),110.toByte(),118.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),115.toByte(),145.toByte(),200.toByte(),6.toByte(),48.toByte(),1.toByte(),134.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),206.toByte(),0.toByte(),8.toByte(),0.toByte(),0.toByte(),169.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),115.toByte(),112.toByte(),97.toByte(),99.toByte(),101.toByte(),170.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),170.toByte(),110.toByte(),97.toByte(),116.toByte(),105.toByte(),118.toByte(),101.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),69.toByte(),110.toByte(),118.toByte(),170.toByte(),112.toByte(),114.toByte(),111.toByte(),112.toByte(),101.toByte(),114.toByte(),116.toByte(),105.toByte(),101.toByte(),115.toByte(),152.toByte(),199.toByte(),130.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),61.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),116.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),54.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),200.toByte(),1.toByte(),35.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),216.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),66.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),66.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),186.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),186.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),93.toByte(),200.toByte(),1.toByte(),7.toByte(),1.toByte(),132.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),195.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),59.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),59.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),186.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),186.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),93.toByte(),199.toByte(),102.toByte(),1.toByte(),133.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),48.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),101.toByte(),110.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),101.toByte(),110.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),92.toByte(),1.toByte(),132.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),43.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),245.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),181.toByte(),1.toByte(),134.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),55.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),55.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),199.toByte(),217.toByte(),1.toByte(),132.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),160.toByte(),1.toByte(),133.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),48.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),48.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),174.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),118.toByte(),163.toByte(),117.toByte(),114.toByte(),105.toByte(),178.toByte(),116.toByte(),101.toByte(),115.toByte(),116.toByte(),105.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),46.toByte(),117.toByte(),114.toByte(),105.toByte(),46.toByte(),101.toByte(),116.toByte(),104.toByte(),179.toByte(),105.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),101.toByte(),100.toByte(),77.toByte(),111.toByte(),100.toByte(),117.toByte(),108.toByte(),101.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),115.toByte(),145.toByte(),200.toByte(),12.toByte(),153.toByte(),1.toByte(),135.toByte(),171.toByte(),105.toByte(),115.toByte(),73.toByte(),110.toByte(),116.toByte(),101.toByte(),114.toByte(),102.toByte(),97.toByte(),99.toByte(),101.toByte(),195.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),1.toByte(),0.toByte(),167.toByte(),109.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),115.toByte(),147.toByte(),200.toByte(),8.toByte(),232.toByte(),1.toByte(),135.toByte(),169.toByte(),97.toByte(),114.toByte(),103.toByte(),117.toByte(),109.toByte(),101.toByte(),110.toByte(),116.toByte(),115.toByte(),157.toByte(),199.toByte(),86.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),115.toByte(),116.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),38.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),115.toByte(),116.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),199.toByte(),72.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),112.toByte(),116.toByte(),83.toByte(),116.toByte(),114.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),31.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),112.toByte(),116.toByte(),83.toByte(),116.toByte(),114.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),199.toByte(),78.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),161.toByte(),117.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),34.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),161.toByte(),117.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),199.toByte(),64.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),164.toByte(),111.toByte(),112.toByte(),116.toByte(),85.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),27.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),164.toByte(),111.toByte(),112.toByte(),116.toByte(),85.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),200.toByte(),1.toByte(),111.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),200.toByte(),1.toByte(),53.toByte(),1.toByte(),134.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),122.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),34.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),34.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),122.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),34.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),34.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),93.toByte(),199.toByte(),116.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),54.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),102.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),47.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),200.toByte(),1.toByte(),7.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),195.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),59.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),59.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),179.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),179.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),93.toByte(),199.toByte(),235.toByte(),1.toByte(),132.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),174.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),52.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),52.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),179.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),179.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),93.toByte(),199.toByte(),102.toByte(),1.toByte(),133.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),48.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),101.toByte(),110.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),101.toByte(),110.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),92.toByte(),1.toByte(),132.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),43.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),245.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),181.toByte(),1.toByte(),134.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),55.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),55.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),199.toByte(),217.toByte(),1.toByte(),132.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),160.toByte(),1.toByte(),133.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),48.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),48.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),163.toByte(),101.toByte(),110.toByte(),118.toByte(),199.toByte(),11.toByte(),1.toByte(),129.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),64.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),105.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),101.toByte(),100.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),114.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),199.toByte(),112.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),105.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),101.toByte(),100.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),52.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),105.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),101.toByte(),100.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),200.toByte(),1.toByte(),103.toByte(),1.toByte(),134.toByte(),169.toByte(),97.toByte(),114.toByte(),103.toByte(),117.toByte(),109.toByte(),101.toByte(),110.toByte(),116.toByte(),115.toByte(),145.toByte(),199.toByte(),183.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),134.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),38.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),97.toByte(),114.toByte(),103.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),97.toByte(),114.toByte(),103.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),38.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),97.toByte(),114.toByte(),103.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),97.toByte(),114.toByte(),103.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),64.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),97.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),114.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),199.toByte(),104.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),97.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),47.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),97.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),200.toByte(),1.toByte(),202.toByte(),1.toByte(),134.toByte(),169.toByte(),97.toByte(),114.toByte(),103.toByte(),117.toByte(),109.toByte(),101.toByte(),110.toByte(),116.toByte(),115.toByte(),145.toByte(),199.toByte(),86.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),97.toByte(),114.toByte(),103.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),38.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),97.toByte(),114.toByte(),103.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),64.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),114.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),115.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),102.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),115.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),114.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),200.toByte(),1.toByte(),37.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),212.toByte(),1.toByte(),134.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),62.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),114.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),115.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),102.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),115.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),182.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),95.toByte(),82.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),62.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),114.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),115.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),102.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),115.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),182.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),95.toByte(),82.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),114.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),115.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),102.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),115.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),95.toByte(),82.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),114.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),115.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),102.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),115.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),95.toByte(),82.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),93.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),169.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),115.toByte(),112.toByte(),97.toByte(),99.toByte(),101.toByte(),170.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),170.toByte(),110.toByte(),97.toByte(),116.toByte(),105.toByte(),118.toByte(),101.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),77.toByte(),111.toByte(),100.toByte(),117.toByte(),108.toByte(),101.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),77.toByte(),111.toByte(),100.toByte(),117.toByte(),108.toByte(),101.toByte(),163.toByte(),117.toByte(),114.toByte(),105.toByte(),178.toByte(),116.toByte(),101.toByte(),115.toByte(),116.toByte(),105.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),46.toByte(),117.toByte(),114.toByte(),105.toByte(),46.toByte(),101.toByte(),116.toByte(),104.toByte(),179.toByte(),105.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),101.toByte(),100.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),115.toByte(),146.toByte(),200.toByte(),6.toByte(),52.toByte(),1.toByte(),134.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),4.toByte(),1.toByte(),169.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),115.toByte(),112.toByte(),97.toByte(),99.toByte(),101.toByte(),170.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),170.toByte(),110.toByte(),97.toByte(),116.toByte(),105.toByte(),118.toByte(),101.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),170.toByte(),112.toByte(),114.toByte(),111.toByte(),112.toByte(),101.toByte(),114.toByte(),116.toByte(),105.toByte(),101.toByte(),115.toByte(),152.toByte(),199.toByte(),130.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),61.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),116.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),54.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),200.toByte(),1.toByte(),35.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),216.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),66.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),66.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),186.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),186.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),93.toByte(),200.toByte(),1.toByte(),7.toByte(),1.toByte(),132.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),195.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),59.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),59.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),186.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),186.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),93.toByte(),199.toByte(),102.toByte(),1.toByte(),133.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),48.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),101.toByte(),110.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),101.toByte(),110.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),92.toByte(),1.toByte(),132.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),43.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),245.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),181.toByte(),1.toByte(),134.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),55.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),55.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),199.toByte(),217.toByte(),1.toByte(),132.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),160.toByte(),1.toByte(),133.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),48.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),48.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),91.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),163.toByte(),117.toByte(),114.toByte(),105.toByte(),178.toByte(),116.toByte(),101.toByte(),115.toByte(),116.toByte(),105.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),46.toByte(),117.toByte(),114.toByte(),105.toByte(),46.toByte(),101.toByte(),116.toByte(),104.toByte(),199.toByte(),211.toByte(),1.toByte(),134.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),4.toByte(),1.toByte(),169.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),115.toByte(),112.toByte(),97.toByte(),99.toByte(),101.toByte(),170.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),170.toByte(),110.toByte(),97.toByte(),116.toByte(),105.toByte(),118.toByte(),101.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),170.toByte(),112.toByte(),114.toByte(),111.toByte(),112.toByte(),101.toByte(),114.toByte(),116.toByte(),105.toByte(),101.toByte(),115.toByte(),145.toByte(),199.toByte(),88.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),164.toByte(),112.toByte(),114.toByte(),111.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),39.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),164.toByte(),112.toByte(),114.toByte(),111.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),163.toByte(),117.toByte(),114.toByte(),105.toByte(),178.toByte(),116.toByte(),101.toByte(),115.toByte(),116.toByte(),105.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),46.toByte(),117.toByte(),114.toByte(),105.toByte(),46.toByte(),101.toByte(),116.toByte(),104.toByte(),174.toByte(),105.toByte(),110.toByte(),116.toByte(),101.toByte(),114.toByte(),102.toByte(),97.toByte(),99.toByte(),101.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),115.toByte(),145.toByte(),199.toByte(),139.toByte(),1.toByte(),134.toByte(),172.toByte(),99.toByte(),97.toByte(),112.toByte(),97.toByte(),98.toByte(),105.toByte(),108.toByte(),105.toByte(),116.toByte(),105.toByte(),101.toByte(),115.toByte(),199.toByte(),33.toByte(),1.toByte(),129.toByte(),178.toByte(),103.toByte(),101.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),108.toByte(),101.toByte(),109.toByte(),101.toByte(),110.toByte(),116.toByte(),97.toByte(),116.toByte(),105.toByte(),111.toByte(),110.toByte(),115.toByte(),199.toByte(),10.toByte(),1.toByte(),129.toByte(),167.toByte(),101.toByte(),110.toByte(),97.toByte(),98.toByte(),108.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),128.toByte(),0.toByte(),169.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),115.toByte(),112.toByte(),97.toByte(),99.toByte(),101.toByte(),170.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),170.toByte(),110.toByte(),97.toByte(),116.toByte(),105.toByte(),118.toByte(),101.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),169.toByte(),73.toByte(),110.toByte(),116.toByte(),101.toByte(),114.toByte(),102.toByte(),97.toByte(),99.toByte(),101.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),163.toByte(),117.toByte(),114.toByte(),105.toByte(),178.toByte(),116.toByte(),101.toByte(),115.toByte(),116.toByte(),105.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),46.toByte(),117.toByte(),114.toByte(),105.toByte(),46.toByte(),101.toByte(),116.toByte(),104.toByte(),170.toByte(),109.toByte(),111.toByte(),100.toByte(),117.toByte(),108.toByte(),101.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),200.toByte(),20.toByte(),173.toByte(),1.toByte(),132.toByte(),167.toByte(),105.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),115.toByte(),149.toByte(),199.toByte(),24.toByte(),1.toByte(),129.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),77.toByte(),111.toByte(),100.toByte(),117.toByte(),108.toByte(),101.toByte(),199.toByte(),24.toByte(),1.toByte(),129.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),177.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),31.toByte(),1.toByte(),129.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),22.toByte(),1.toByte(),129.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),175.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),29.toByte(),1.toByte(),129.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),182.toByte(),84.toByte(),101.toByte(),115.toByte(),116.toByte(),73.toByte(),109.toByte(),112.toByte(),111.toByte(),114.toByte(),116.toByte(),95.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),95.toByte(),82.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),204.toByte(),128.toByte(),167.toByte(),109.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),115.toByte(),148.toByte(),200.toByte(),12.toByte(),107.toByte(),1.toByte(),134.toByte(),169.toByte(),97.toByte(),114.toByte(),103.toByte(),117.toByte(),109.toByte(),101.toByte(),110.toByte(),116.toByte(),115.toByte(),155.toByte(),199.toByte(),86.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),115.toByte(),116.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),38.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),115.toByte(),116.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),199.toByte(),72.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),112.toByte(),116.toByte(),83.toByte(),116.toByte(),114.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),31.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),112.toByte(),116.toByte(),83.toByte(),116.toByte(),114.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),199.toByte(),92.toByte(),1.toByte(),133.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),43.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),101.toByte(),110.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),101.toByte(),110.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),82.toByte(),1.toByte(),132.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),38.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),225.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),166.toByte(),1.toByte(),134.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),50.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),50.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),172.toByte(),91.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),172.toByte(),91.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),199.toByte(),197.toByte(),1.toByte(),132.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),145.toByte(),1.toByte(),133.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),43.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),43.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),172.toByte(),91.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),172.toByte(),91.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),199.toByte(),241.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),199.toByte(),186.toByte(),1.toByte(),135.toByte(),163.toByte(),107.toByte(),101.toByte(),121.toByte(),199.toByte(),38.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),206.toByte(),0.toByte(),4.toByte(),0.toByte(),2.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),35.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),176.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),73.toByte(),110.toByte(),116.toByte(),62.toByte(),165.toByte(),118.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),199.toByte(),35.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),176.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),73.toByte(),110.toByte(),116.toByte(),62.toByte(),200.toByte(),1.toByte(),214.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),200.toByte(),1.toByte(),151.toByte(),1.toByte(),135.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),140.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),40.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),40.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),91.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),163.toByte(),107.toByte(),101.toByte(),121.toByte(),199.toByte(),43.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),206.toByte(),0.toByte(),4.toByte(),0.toByte(),2.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),178.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),91.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),62.toByte(),165.toByte(),118.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),199.toByte(),140.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),40.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),40.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),91.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),178.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),91.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),62.toByte(),200.toByte(),2.toByte(),110.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),200.toByte(),2.toByte(),36.toByte(),1.toByte(),135.toByte(),163.toByte(),107.toByte(),101.toByte(),121.toByte(),199.toByte(),43.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),77.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),206.toByte(),0.toByte(),4.toByte(),0.toByte(),2.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),199.toByte(),206.toByte(),1.toByte(),135.toByte(),163.toByte(),107.toByte(),101.toByte(),121.toByte(),199.toByte(),43.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),77.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),206.toByte(),0.toByte(),4.toByte(),0.toByte(),2.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),77.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),40.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),77.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),176.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),73.toByte(),110.toByte(),116.toByte(),62.toByte(),165.toByte(),118.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),199.toByte(),40.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),77.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),77.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),189.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),73.toByte(),110.toByte(),116.toByte(),62.toByte(),62.toByte(),165.toByte(),118.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),199.toByte(),206.toByte(),1.toByte(),135.toByte(),163.toByte(),107.toByte(),101.toByte(),121.toByte(),199.toByte(),43.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),77.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),206.toByte(),0.toByte(),4.toByte(),0.toByte(),2.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),77.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),40.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),77.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),176.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),73.toByte(),110.toByte(),116.toByte(),62.toByte(),165.toByte(),118.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),199.toByte(),40.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),77.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),77.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),189.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),73.toByte(),110.toByte(),116.toByte(),62.toByte(),62.toByte(),200.toByte(),1.toByte(),46.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),199.toByte(),234.toByte(),1.toByte(),135.toByte(),163.toByte(),107.toByte(),101.toByte(),121.toByte(),199.toByte(),43.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),206.toByte(),0.toByte(),4.toByte(),0.toByte(),2.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),50.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),62.toByte(),165.toByte(),118.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),199.toByte(),50.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),62.toByte(),200.toByte(),2.toByte(),75.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),200.toByte(),1.toByte(),255.toByte(),1.toByte(),135.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),183.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),55.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),55.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),163.toByte(),107.toByte(),101.toByte(),121.toByte(),199.toByte(),48.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),206.toByte(),0.toByte(),4.toByte(),0.toByte(),2.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),186.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),62.toByte(),165.toByte(),118.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),199.toByte(),183.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),55.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),55.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),186.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),62.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),64.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),109.toByte(),111.toByte(),100.toByte(),117.toByte(),108.toByte(),101.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),114.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),199.toByte(),98.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),109.toByte(),111.toByte(),100.toByte(),117.toByte(),108.toByte(),101.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),44.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),109.toByte(),111.toByte(),100.toByte(),117.toByte(),108.toByte(),101.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),200.toByte(),3.toByte(),70.toByte(),1.toByte(),135.toByte(),169.toByte(),97.toByte(),114.toByte(),103.toByte(),117.toByte(),109.toByte(),101.toByte(),110.toByte(),116.toByte(),115.toByte(),148.toByte(),199.toByte(),104.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),48.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),199.toByte(),90.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),41.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),199.toByte(),239.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),177.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),53.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),53.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),199.toByte(),211.toByte(),1.toByte(),132.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),156.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),46.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),46.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),163.toByte(),101.toByte(),110.toByte(),118.toByte(),199.toByte(),11.toByte(),1.toByte(),129.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),64.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),114.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),199.toByte(),96.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),44.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),200.toByte(),3.toByte(),85.toByte(),1.toByte(),135.toByte(),169.toByte(),97.toByte(),114.toByte(),103.toByte(),117.toByte(),109.toByte(),101.toByte(),110.toByte(),116.toByte(),115.toByte(),148.toByte(),199.toByte(),104.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),48.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),199.toByte(),90.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),41.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),199.toByte(),239.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),177.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),53.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),53.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),199.toByte(),211.toByte(),1.toByte(),132.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),156.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),46.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),46.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),163.toByte(),101.toByte(),110.toByte(),118.toByte(),199.toByte(),11.toByte(),1.toByte(),129.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),194.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),64.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),177.toByte(),111.toByte(),112.toByte(),116.toByte(),105.toByte(),111.toByte(),110.toByte(),97.toByte(),108.toByte(),69.toByte(),110.toByte(),118.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),114.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),199.toByte(),106.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),177.toByte(),111.toByte(),112.toByte(),116.toByte(),105.toByte(),111.toByte(),110.toByte(),97.toByte(),108.toByte(),69.toByte(),110.toByte(),118.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),49.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),177.toByte(),111.toByte(),112.toByte(),116.toByte(),105.toByte(),111.toByte(),110.toByte(),97.toByte(),108.toByte(),69.toByte(),110.toByte(),118.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),199.toByte(),225.toByte(),1.toByte(),134.toByte(),169.toByte(),97.toByte(),114.toByte(),103.toByte(),117.toByte(),109.toByte(),101.toByte(),110.toByte(),116.toByte(),115.toByte(),145.toByte(),199.toByte(),82.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),105.toByte(),102.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),37.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),105.toByte(),102.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),101.toByte(),108.toByte(),115.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),101.toByte(),108.toByte(),115.toByte(),101.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),64.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),105.toByte(),102.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),114.toByte(),101.toByte(),116.toByte(),117.toByte(),114.toByte(),110.toByte(),199.toByte(),82.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),105.toByte(),102.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),37.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),105.toByte(),102.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),101.toByte(),108.toByte(),115.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),101.toByte(),108.toByte(),115.toByte(),101.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),77.toByte(),101.toByte(),116.toByte(),104.toByte(),111.toByte(),100.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),77.toByte(),111.toByte(),100.toByte(),117.toByte(),108.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),115.toByte(),148.toByte(),200.toByte(),36.toByte(),119.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),1.toByte(),170.toByte(),112.toByte(),114.toByte(),111.toByte(),112.toByte(),101.toByte(),114.toByte(),116.toByte(),105.toByte(),101.toByte(),115.toByte(),220.toByte(),0.toByte(),42.toByte(),199.toByte(),86.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),115.toByte(),116.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),38.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),115.toByte(),116.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),199.toByte(),72.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),112.toByte(),116.toByte(),83.toByte(),116.toByte(),114.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),31.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),112.toByte(),116.toByte(),83.toByte(),116.toByte(),114.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),199.toByte(),78.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),161.toByte(),117.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),34.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),161.toByte(),117.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),199.toByte(),64.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),164.toByte(),111.toByte(),112.toByte(),116.toByte(),85.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),27.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),164.toByte(),111.toByte(),112.toByte(),116.toByte(),85.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),199.toByte(),82.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),117.toByte(),56.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),36.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),117.toByte(),56.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),56.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),56.toByte(),199.toByte(),86.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),117.toByte(),49.toByte(),54.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),38.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),117.toByte(),49.toByte(),54.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),49.toByte(),54.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),49.toByte(),54.toByte(),199.toByte(),86.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),117.toByte(),51.toByte(),50.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),38.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),117.toByte(),51.toByte(),50.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),199.toByte(),76.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),161.toByte(),105.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),33.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),161.toByte(),105.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),199.toByte(),80.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),105.toByte(),56.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),35.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),105.toByte(),56.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),73.toByte(),110.toByte(),116.toByte(),56.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),73.toByte(),110.toByte(),116.toByte(),56.toByte(),199.toByte(),84.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),105.toByte(),49.toByte(),54.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),37.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),105.toByte(),49.toByte(),54.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),73.toByte(),110.toByte(),116.toByte(),49.toByte(),54.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),73.toByte(),110.toByte(),116.toByte(),49.toByte(),54.toByte(),199.toByte(),84.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),105.toByte(),51.toByte(),50.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),37.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),105.toByte(),51.toByte(),50.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),199.toByte(),92.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),98.toByte(),105.toByte(),103.toByte(),105.toByte(),110.toByte(),116.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),41.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),98.toByte(),105.toByte(),103.toByte(),105.toByte(),110.toByte(),116.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),66.toByte(),105.toByte(),103.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),66.toByte(),105.toByte(),103.toByte(),73.toByte(),110.toByte(),116.toByte(),199.toByte(),78.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),111.toByte(),112.toByte(),116.toByte(),66.toByte(),105.toByte(),103.toByte(),105.toByte(),110.toByte(),116.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),34.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),111.toByte(),112.toByte(),116.toByte(),66.toByte(),105.toByte(),103.toByte(),105.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),66.toByte(),105.toByte(),103.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),66.toByte(),105.toByte(),103.toByte(),73.toByte(),110.toByte(),116.toByte(),199.toByte(),104.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),98.toByte(),105.toByte(),103.toByte(),110.toByte(),117.toByte(),109.toByte(),98.toByte(),101.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),47.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),98.toByte(),105.toByte(),103.toByte(),110.toByte(),117.toByte(),109.toByte(),98.toByte(),101.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),169.toByte(),66.toByte(),105.toByte(),103.toByte(),78.toByte(),117.toByte(),109.toByte(),98.toByte(),101.toByte(),114.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),169.toByte(),66.toByte(),105.toByte(),103.toByte(),78.toByte(),117.toByte(),109.toByte(),98.toByte(),101.toByte(),114.toByte(),199.toByte(),90.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),66.toByte(),105.toByte(),103.toByte(),110.toByte(),117.toByte(),109.toByte(),98.toByte(),101.toByte(),114.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),40.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),66.toByte(),105.toByte(),103.toByte(),110.toByte(),117.toByte(),109.toByte(),98.toByte(),101.toByte(),114.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),169.toByte(),66.toByte(),105.toByte(),103.toByte(),78.toByte(),117.toByte(),109.toByte(),98.toByte(),101.toByte(),114.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),169.toByte(),66.toByte(),105.toByte(),103.toByte(),78.toByte(),117.toByte(),109.toByte(),98.toByte(),101.toByte(),114.toByte(),199.toByte(),84.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),164.toByte(),106.toByte(),115.toByte(),111.toByte(),110.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),37.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),164.toByte(),106.toByte(),115.toByte(),111.toByte(),110.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),74.toByte(),83.toByte(),79.toByte(),78.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),74.toByte(),83.toByte(),79.toByte(),78.toByte(),199.toByte(),70.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),111.toByte(),112.toByte(),116.toByte(),74.toByte(),115.toByte(),111.toByte(),110.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),30.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),111.toByte(),112.toByte(),116.toByte(),74.toByte(),115.toByte(),111.toByte(),110.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),74.toByte(),83.toByte(),79.toByte(),78.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),74.toByte(),83.toByte(),79.toByte(),78.toByte(),199.toByte(),88.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),165.toByte(),98.toByte(),121.toByte(),116.toByte(),101.toByte(),115.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),39.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),165.toByte(),98.toByte(),121.toByte(),116.toByte(),101.toByte(),115.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),66.toByte(),121.toByte(),116.toByte(),101.toByte(),115.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),66.toByte(),121.toByte(),116.toByte(),101.toByte(),115.toByte(),199.toByte(),74.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),111.toByte(),112.toByte(),116.toByte(),66.toByte(),121.toByte(),116.toByte(),101.toByte(),115.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),32.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),111.toByte(),112.toByte(),116.toByte(),66.toByte(),121.toByte(),116.toByte(),101.toByte(),115.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),66.toByte(),121.toByte(),116.toByte(),101.toByte(),115.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),66.toByte(),121.toByte(),116.toByte(),101.toByte(),115.toByte(),199.toByte(),96.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),98.toByte(),111.toByte(),111.toByte(),108.toByte(),101.toByte(),97.toByte(),110.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),43.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),98.toByte(),111.toByte(),111.toByte(),108.toByte(),101.toByte(),97.toByte(),110.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),167.toByte(),66.toByte(),111.toByte(),111.toByte(),108.toByte(),101.toByte(),97.toByte(),110.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),167.toByte(),66.toByte(),111.toByte(),111.toByte(),108.toByte(),101.toByte(),97.toByte(),110.toByte(),199.toByte(),82.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),111.toByte(),112.toByte(),116.toByte(),66.toByte(),111.toByte(),111.toByte(),108.toByte(),101.toByte(),97.toByte(),110.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),36.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),111.toByte(),112.toByte(),116.toByte(),66.toByte(),111.toByte(),111.toByte(),108.toByte(),101.toByte(),97.toByte(),110.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),167.toByte(),66.toByte(),111.toByte(),111.toByte(),108.toByte(),101.toByte(),97.toByte(),110.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),167.toByte(),66.toByte(),111.toByte(),111.toByte(),108.toByte(),101.toByte(),97.toByte(),110.toByte(),199.toByte(),191.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),140.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),40.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),117.toByte(),95.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),117.toByte(),95.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),40.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),117.toByte(),95.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),117.toByte(),95.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),199.toByte(),183.toByte(),1.toByte(),132.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),139.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),43.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),117.toByte(),79.toByte(),112.toByte(),116.toByte(),95.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),117.toByte(),79.toByte(),112.toByte(),116.toByte(),95.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),43.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),117.toByte(),79.toByte(),112.toByte(),116.toByte(),95.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),117.toByte(),79.toByte(),112.toByte(),116.toByte(),95.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),199.toByte(),179.toByte(),1.toByte(),132.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),131.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),37.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),95.toByte(),111.toByte(),112.toByte(),116.toByte(),95.toByte(),117.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),95.toByte(),111.toByte(),112.toByte(),116.toByte(),95.toByte(),117.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),37.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),95.toByte(),111.toByte(),112.toByte(),116.toByte(),95.toByte(),117.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),95.toByte(),111.toByte(),112.toByte(),116.toByte(),95.toByte(),117.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),199.toByte(),187.toByte(),1.toByte(),132.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),137.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),39.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),83.toByte(),116.toByte(),114.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),83.toByte(),116.toByte(),114.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),39.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),83.toByte(),116.toByte(),114.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),83.toByte(),116.toByte(),114.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),93.toByte(),200.toByte(),1.toByte(),171.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),200.toByte(),1.toByte(),113.toByte(),1.toByte(),134.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),152.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),44.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),44.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),152.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),44.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),44.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),93.toByte(),200.toByte(),1.toByte(),175.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),200.toByte(),1.toByte(),109.toByte(),1.toByte(),134.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),146.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),42.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),177.toByte(),117.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),177.toByte(),117.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),42.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),177.toByte(),117.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),146.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),42.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),177.toByte(),117.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),177.toByte(),117.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),42.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),177.toByte(),117.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),177.toByte(),117.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),177.toByte(),117.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),93.toByte(),200.toByte(),3.toByte(),239.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),200.toByte(),3.toByte(),169.toByte(),1.toByte(),134.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),200.toByte(),1.toByte(),173.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),182.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),54.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),54.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),182.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),54.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),54.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),93.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),200.toByte(),1.toByte(),173.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),182.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),54.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),54.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),182.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),54.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),54.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),172.toByte(),91.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),93.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),179.toByte(),117.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),79.toByte(),112.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),172.toByte(),91.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),93.toByte(),93.toByte(),200.toByte(),6.toByte(),123.toByte(),1.toByte(),132.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),200.toByte(),6.toByte(),70.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),200.toByte(),3.toByte(),4.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),200.toByte(),1.toByte(),100.toByte(),1.toByte(),134.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),145.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),45.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),45.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),145.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),45.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),45.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),93.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),200.toByte(),1.toByte(),100.toByte(),1.toByte(),134.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),145.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),45.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),45.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),145.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),45.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),45.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),172.toByte(),91.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),93.toByte(),93.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),200.toByte(),3.toByte(),4.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),200.toByte(),1.toByte(),100.toByte(),1.toByte(),134.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),145.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),45.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),45.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),145.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),45.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),45.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),93.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),200.toByte(),1.toByte(),100.toByte(),1.toByte(),134.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),145.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),45.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),45.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),145.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),45.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),45.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),172.toByte(),91.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),93.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),174.toByte(),91.toByte(),91.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),93.toByte(),93.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),170.toByte(),99.toByte(),114.toByte(),97.toByte(),122.toByte(),121.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),174.toByte(),91.toByte(),91.toByte(),91.toByte(),91.toByte(),85.toByte(),73.toByte(),110.toByte(),116.toByte(),51.toByte(),50.toByte(),93.toByte(),93.toByte(),93.toByte(),93.toByte(),199.toByte(),104.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),48.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),199.toByte(),90.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),41.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),199.toByte(),239.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),177.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),53.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),53.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),171.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),199.toByte(),211.toByte(),1.toByte(),132.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),156.toByte(),1.toByte(),133.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),46.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),46.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),111.toByte(),112.toByte(),116.toByte(),79.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),199.toByte(),92.toByte(),1.toByte(),133.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),43.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),101.toByte(),110.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),162.toByte(),101.toByte(),110.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),82.toByte(),1.toByte(),132.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),38.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),167.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),225.toByte(),1.toByte(),133.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),166.toByte(),1.toByte(),134.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),50.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),50.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),172.toByte(),91.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),169.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),172.toByte(),91.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),199.toByte(),197.toByte(),1.toByte(),132.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),145.toByte(),1.toByte(),133.toByte(),164.toByte(),101.toByte(),110.toByte(),117.toByte(),109.toByte(),199.toByte(),43.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),43.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),64.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),172.toByte(),91.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),172.toByte(),111.toByte(),112.toByte(),116.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),65.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),172.toByte(),91.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),69.toByte(),110.toByte(),117.toByte(),109.toByte(),93.toByte(),199.toByte(),241.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),199.toByte(),186.toByte(),1.toByte(),135.toByte(),163.toByte(),107.toByte(),101.toByte(),121.toByte(),199.toByte(),38.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),206.toByte(),0.toByte(),4.toByte(),0.toByte(),2.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),35.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),176.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),73.toByte(),110.toByte(),116.toByte(),62.toByte(),165.toByte(),118.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),199.toByte(),35.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),176.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),73.toByte(),110.toByte(),116.toByte(),62.toByte(),200.toByte(),1.toByte(),214.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),200.toByte(),1.toByte(),151.toByte(),1.toByte(),135.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),140.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),40.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),40.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),91.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),163.toByte(),107.toByte(),101.toByte(),121.toByte(),199.toByte(),43.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),206.toByte(),0.toByte(),4.toByte(),0.toByte(),2.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),178.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),91.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),62.toByte(),165.toByte(),118.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),199.toByte(),140.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),40.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),40.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),163.toByte(),73.toByte(),110.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),165.toByte(),91.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),178.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),91.toByte(),73.toByte(),110.toByte(),116.toByte(),93.toByte(),62.toByte(),200.toByte(),1.toByte(),46.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),199.toByte(),234.toByte(),1.toByte(),135.toByte(),163.toByte(),107.toByte(),101.toByte(),121.toByte(),199.toByte(),43.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),206.toByte(),0.toByte(),4.toByte(),0.toByte(),2.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),50.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),62.toByte(),165.toByte(),118.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),199.toByte(),50.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),184.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),62.toByte(),200.toByte(),2.toByte(),75.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),200.toByte(),1.toByte(),255.toByte(),1.toByte(),135.toByte(),165.toByte(),97.toByte(),114.toByte(),114.toByte(),97.toByte(),121.toByte(),199.toByte(),183.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),55.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),55.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),163.toByte(),107.toByte(),101.toByte(),121.toByte(),199.toByte(),48.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),206.toByte(),0.toByte(),4.toByte(),0.toByte(),2.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),186.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),62.toByte(),165.toByte(),118.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),199.toByte(),183.toByte(),1.toByte(),134.toByte(),164.toByte(),105.toByte(),116.toByte(),101.toByte(),109.toByte(),199.toByte(),55.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),18.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),55.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),173.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),173.toByte(),109.toByte(),97.toByte(),112.toByte(),79.toByte(),102.toByte(),65.toByte(),114.toByte(),114.toByte(),79.toByte(),102.toByte(),79.toByte(),98.toByte(),106.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),186.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),91.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),93.toByte(),62.toByte(),200.toByte(),1.toByte(),68.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),163.toByte(),109.toByte(),97.toByte(),112.toByte(),199.toByte(),247.toByte(),1.toByte(),135.toByte(),163.toByte(),107.toByte(),101.toByte(),121.toByte(),199.toByte(),49.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),109.toByte(),97.toByte(),112.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),86.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),206.toByte(),0.toByte(),4.toByte(),0.toByte(),2.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),109.toByte(),97.toByte(),112.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),86.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),49.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),109.toByte(),97.toByte(),112.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),86.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),174.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),77.toByte(),97.toByte(),112.toByte(),86.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),187.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),77.toByte(),97.toByte(),112.toByte(),86.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),62.toByte(),165.toByte(),118.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),199.toByte(),49.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),109.toByte(),97.toByte(),112.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),86.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),174.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),77.toByte(),97.toByte(),112.toByte(),86.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),174.toByte(),109.toByte(),97.toByte(),112.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),86.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),187.toByte(),77.toByte(),97.toByte(),112.toByte(),60.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),44.toByte(),32.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),77.toByte(),97.toByte(),112.toByte(),86.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),62.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),200.toByte(),1.toByte(),13.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),1.toByte(),170.toByte(),112.toByte(),114.toByte(),111.toByte(),112.toByte(),101.toByte(),114.toByte(),116.toByte(),105.toByte(),101.toByte(),115.toByte(),147.toByte(),199.toByte(),68.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),164.toByte(),112.toByte(),114.toByte(),111.toByte(),112.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),29.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),164.toByte(),112.toByte(),114.toByte(),111.toByte(),112.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),199.toByte(),86.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),99.toByte(),105.toByte(),114.toByte(),99.toByte(),117.toByte(),108.toByte(),97.toByte(),114.toByte(),166.toByte(),111.toByte(),98.toByte(),106.toByte(),101.toByte(),99.toByte(),116.toByte(),199.toByte(),39.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),205.toByte(),32.toByte(),0.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),168.toByte(),99.toByte(),105.toByte(),114.toByte(),99.toByte(),117.toByte(),108.toByte(),97.toByte(),114.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),170.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),199.toByte(),70.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),165.toByte(),99.toByte(),111.toByte(),110.toByte(),115.toByte(),116.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),30.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),165.toByte(),99.toByte(),111.toByte(),110.toByte(),115.toByte(),116.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),171.toByte(),65.toByte(),110.toByte(),111.toByte(),116.toByte(),104.toByte(),101.toByte(),114.toByte(),84.toByte(),121.toByte(),112.toByte(),101.toByte(),199.toByte(),128.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),1.toByte(),170.toByte(),112.toByte(),114.toByte(),111.toByte(),112.toByte(),101.toByte(),114.toByte(),116.toByte(),105.toByte(),101.toByte(),115.toByte(),145.toByte(),199.toByte(),86.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),102.toByte(),111.toByte(),111.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),38.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),163.toByte(),102.toByte(),111.toByte(),111.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),174.toByte(),67.toByte(),117.toByte(),115.toByte(),116.toByte(),111.toByte(),109.toByte(),77.toByte(),97.toByte(),112.toByte(),86.toByte(),97.toByte(),108.toByte(),117.toByte(),101.toByte(),199.toByte(),120.toByte(),1.toByte(),131.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),1.toByte(),170.toByte(),112.toByte(),114.toByte(),111.toByte(),112.toByte(),101.toByte(),114.toByte(),116.toByte(),105.toByte(),101.toByte(),115.toByte(),145.toByte(),199.toByte(),88.toByte(),1.toByte(),133.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),34.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),164.toByte(),101.toByte(),108.toByte(),115.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),166.toByte(),115.toByte(),99.toByte(),97.toByte(),108.toByte(),97.toByte(),114.toByte(),199.toByte(),39.toByte(),1.toByte(),132.toByte(),164.toByte(),107.toByte(),105.toByte(),110.toByte(),100.toByte(),4.toByte(),164.toByte(),110.toByte(),97.toByte(),109.toByte(),101.toByte(),164.toByte(),101.toByte(),108.toByte(),115.toByte(),101.toByte(),168.toByte(),114.toByte(),101.toByte(),113.toByte(),117.toByte(),105.toByte(),114.toByte(),101.toByte(),100.toByte(),195.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),166.toByte(),83.toByte(),116.toByte(),114.toByte(),105.toByte(),110.toByte(),103.toByte(),164.toByte(),116.toByte(),121.toByte(),112.toByte(),101.toByte(),164.toByte(),101.toByte(),108.toByte(),115.toByte(),101.toByte(),167.toByte(),118.toByte(),101.toByte(),114.toByte(),115.toByte(),105.toByte(),111.toByte(),110.toByte(),163.toByte(),48.toByte(),46.toByte(),49.toByte() - )).getOrThrow() - ) diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-py/__init__.py b/packages/test-cases/cases/bind/sanity/output/plugin-py/__init__.py deleted file mode 100644 index d2ad6b3725..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-py/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# NOTE: This is an auto-generated file. All modifications will be overwritten. -# type: ignore - -from .types import * -from .module import * -from .wrap_info import * diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-py/module.py b/packages/test-cases/cases/bind/sanity/output/plugin-py/module.py deleted file mode 100644 index 836ffbc767..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-py/module.py +++ /dev/null @@ -1,94 +0,0 @@ -# NOTE: This is an auto-generated file. All modifications will be overwritten. -# type: ignore -from __future__ import annotations - -from abc import abstractmethod -from typing import TypeVar, Generic, TypedDict, Optional - -from .types import * - -from polywrap_core import InvokerClient -from polywrap_plugin import PluginModule -from polywrap_msgpack import GenericMap - -TConfig = TypeVar("TConfig") - - -ArgsModuleMethod = TypedDict("ArgsModuleMethod", { - "str": str, - "optStr": Optional[str], - "en": "CustomEnum", - "optEnum": Optional["CustomEnum"], - "enumArray": list["CustomEnum"], - "optEnumArray": Optional[list[Optional["CustomEnum"]]], - "map": GenericMap[str, int], - "mapOfArr": GenericMap[str, list[int]], - "mapOfMap": GenericMap[str, GenericMap[str, int]], - "mapOfObj": GenericMap[str, "AnotherType"], - "mapOfArrOfObj": GenericMap[str, list["AnotherType"]] -}) - -ArgsObjectMethod = TypedDict("ArgsObjectMethod", { - "object": "AnotherType", - "optObject": Optional["AnotherType"], - "objectArray": list["AnotherType"], - "optObjectArray": Optional[list[Optional["AnotherType"]]] -}) - -ArgsOptionalEnvMethod = TypedDict("ArgsOptionalEnvMethod", { - "object": "AnotherType", - "optObject": Optional["AnotherType"], - "objectArray": list["AnotherType"], - "optObjectArray": Optional[list[Optional["AnotherType"]]] -}) - -ArgsIf = TypedDict("ArgsIf", { - "if": "Else" -}) - - -class Module(Generic[TConfig], PluginModule[TConfig]): - def __new__(cls, *args, **kwargs): - # NOTE: This is used to dynamically add WRAP ABI compatible methods to the class - instance = super().__new__(cls) - setattr(instance, "moduleMethod", instance.module_method) - setattr(instance, "objectMethod", instance.object_method) - setattr(instance, "optionalEnvMethod", instance.optional_env_method) - setattr(instance, "if", instance.r_if) - return instance - - @abstractmethod - def module_method( - self, - args: ArgsModuleMethod, - client: InvokerClient, - env: None - ) -> int: - pass - - @abstractmethod - def object_method( - self, - args: ArgsObjectMethod, - client: InvokerClient, - env: Env - ) -> Optional["AnotherType"]: - pass - - @abstractmethod - def optional_env_method( - self, - args: ArgsOptionalEnvMethod, - client: InvokerClient, - env: Optional[Env] = None - ) -> Optional["AnotherType"]: - pass - - @abstractmethod - def r_if( - self, - args: ArgsIf, - client: InvokerClient, - env: None - ) -> "Else": - pass diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-py/types.py b/packages/test-cases/cases/bind/sanity/output/plugin-py/types.py deleted file mode 100644 index fa5d31f1a3..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-py/types.py +++ /dev/null @@ -1,244 +0,0 @@ -# NOTE: This is an auto-generated file. All modifications will be overwritten. -# type: ignore -from __future__ import annotations - -from typing import TypedDict, Optional -from enum import IntEnum - -from polywrap_core import InvokerClient, Uri -from polywrap_msgpack import GenericMap - - -### Env START ### - -Env = TypedDict("Env", { - "prop": str, - "optProp": Optional[str], - "optMap": Optional[GenericMap[str, Optional[int]]], -}) - -### Env END ### - -### Objects START ### - -CustomType = TypedDict("CustomType", { - "str": str, - "optStr": Optional[str], - "u": int, - "optU": Optional[int], - "u8": int, - "u16": int, - "u32": int, - "i": int, - "i8": int, - "i16": int, - "i32": int, - "bigint": str, - "optBigint": Optional[str], - "bignumber": str, - "optBignumber": Optional[str], - "json": str, - "optJson": Optional[str], - "bytes": bytes, - "optBytes": Optional[bytes], - "boolean": bool, - "optBoolean": Optional[bool], - "u_array": list[int], - "uOpt_array": Optional[list[int]], - "_opt_uOptArray": Optional[list[Optional[int]]], - "optStrOptArray": Optional[list[Optional[str]]], - "uArrayArray": list[list[int]], - "uOptArrayOptArray": list[Optional[list[Optional[int]]]], - "uArrayOptArrayArray": list[Optional[list[list[int]]]], - "crazyArray": Optional[list[Optional[list[list[Optional[list[int]]]]]]], - "object": "AnotherType", - "optObject": Optional["AnotherType"], - "objectArray": list["AnotherType"], - "optObjectArray": Optional[list[Optional["AnotherType"]]], - "en": "CustomEnum", - "optEnum": Optional["CustomEnum"], - "enumArray": list["CustomEnum"], - "optEnumArray": Optional[list[Optional["CustomEnum"]]], - "map": GenericMap[str, int], - "mapOfArr": GenericMap[str, list[int]], - "mapOfObj": GenericMap[str, "AnotherType"], - "mapOfArrOfObj": GenericMap[str, list["AnotherType"]], - "mapCustomValue": GenericMap[str, Optional["CustomMapValue"]], -}) - -AnotherType = TypedDict("AnotherType", { - "prop": Optional[str], - "circular": Optional["CustomType"], - "const": Optional[str], -}) - -CustomMapValue = TypedDict("CustomMapValue", { - "foo": str, -}) - -Else = TypedDict("Else", { - "else": str, -}) - -### Objects END ### - -### Enums START ### -class CustomEnum(IntEnum): - STRING = 0, "0", "STRING" - BYTES = 1, "1", "BYTES" - - def __new__(cls, value: int, *aliases: str): - obj = int.__new__(cls) - obj._value_ = value - for alias in aliases: - cls._value2member_map_[alias] = obj - return obj - -class While(IntEnum): - r_for = 0, "0", "for" - r_in = 1, "1", "in" - - def __new__(cls, value: int, *aliases: str): - obj = int.__new__(cls) - obj._value_ = value - for alias in aliases: - cls._value2member_map_[alias] = obj - return obj - -### Enums END ### - -### Imported Objects START ### - -# URI: "testimport.uri.eth" # -TestImportObject = TypedDict("TestImportObject", { - "object": "TestImportAnotherObject", - "optObject": Optional["TestImportAnotherObject"], - "objectArray": list["TestImportAnotherObject"], - "optObjectArray": Optional[list[Optional["TestImportAnotherObject"]]], - "en": "TestImportEnum", - "optEnum": Optional["TestImportEnum"], - "enumArray": list["TestImportEnum"], - "optEnumArray": Optional[list[Optional["TestImportEnum"]]], -}) - -# URI: "testimport.uri.eth" # -TestImportAnotherObject = TypedDict("TestImportAnotherObject", { - "prop": str, -}) - -### Imported Objects END ### - -### Imported Enums START ### - -# URI: "testimport.uri.eth" # -class TestImportEnum(IntEnum): - STRING = 0, "0", "STRING" - BYTES = 1, "1", "BYTES" - - def __new__(cls, value: int, *aliases: str): - obj = int.__new__(cls) - obj._value_ = value - for alias in aliases: - cls._value2member_map_[alias] = obj - return obj - -# URI: "testimport.uri.eth" # -class TestImportEnumReturn(IntEnum): - STRING = 0, "0", "STRING" - BYTES = 1, "1", "BYTES" - - def __new__(cls, value: int, *aliases: str): - obj = int.__new__(cls) - obj._value_ = value - for alias in aliases: - cls._value2member_map_[alias] = obj - return obj - - -### Imported Enums END ### - -### Imported Modules START ### - -# URI: "testimport.uri.eth" # -TestImportModuleArgsImportedMethod = TypedDict("TestImportModuleArgsImportedMethod", { - "str": str, - "optStr": Optional[str], - "u": int, - "optU": Optional[int], - "uArrayArray": list[Optional[list[Optional[int]]]], - "object": "TestImportObject", - "optObject": Optional["TestImportObject"], - "objectArray": list["TestImportObject"], - "optObjectArray": Optional[list[Optional["TestImportObject"]]], - "en": "TestImportEnum", - "optEnum": Optional["TestImportEnum"], - "enumArray": list["TestImportEnum"], - "optEnumArray": Optional[list[Optional["TestImportEnum"]]], -}) - -# URI: "testimport.uri.eth" # -TestImportModuleArgsAnotherMethod = TypedDict("TestImportModuleArgsAnotherMethod", { - "arg": list[str], -}) - -# URI: "testimport.uri.eth" # -TestImportModuleArgsReturnsArrayOfEnums = TypedDict("TestImportModuleArgsReturnsArrayOfEnums", { - "arg": str, -}) - -# URI: "testimport.uri.eth" # -class TestImportModule: - INTERFACE_URI: Uri = Uri.from_str("testimport.uri.eth") - uri: Uri - - def __init__(self, uri: Uri): - self.uri = uri - - def imported_method( - self, - args: TestImportModuleArgsImportedMethod, - client: InvokerClient - ) -> Optional["TestImportObject"]: - return client.invoke( - uri=self.uri, - method="importedMethod", - args=args, - ) - - def another_method( - self, - args: TestImportModuleArgsAnotherMethod, - client: InvokerClient - ) -> int: - return client.invoke( - uri=self.uri, - method="anotherMethod", - args=args, - ) - - def returns_array_of_enums( - self, - args: TestImportModuleArgsReturnsArrayOfEnums, - client: InvokerClient - ) -> list[Optional["TestImportEnumReturn"]]: - return client.invoke( - uri=self.uri, - method="returnsArrayOfEnums", - args=args, - ) - -### Imported Modules END ### - -### Interface START ### - - -class TestImport: - URI: Uri = Uri.from_str("testimport.uri.eth") - - def get_implementations( - client: InvokerClient - ) -> list[str]: - impls = client.getImplementations(self.uri) - return [impl.uri for impl in impls] - -### Interface END ### diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-py/wrap_info.py b/packages/test-cases/cases/bind/sanity/output/plugin-py/wrap_info.py deleted file mode 100644 index 7bf75c8e64..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-py/wrap_info.py +++ /dev/null @@ -1,2441 +0,0 @@ -# NOTE: This is an auto-generated file. All modifications will be overwritten. -# type: ignore -from __future__ import annotations - -import json - -from polywrap_manifest import WrapManifest - -abi = json.loads(""" -{ - "enumTypes": [ - { - "constants": [ - "STRING", - "BYTES" - ], - "kind": 8, - "type": "CustomEnum" - }, - { - "constants": [ - "for", - "in" - ], - "kind": 8, - "type": "while" - } - ], - "envType": { - "kind": 65536, - "properties": [ - { - "kind": 34, - "name": "prop", - "required": true, - "scalar": { - "kind": 4, - "name": "prop", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "optProp", - "scalar": { - "kind": 4, - "name": "optProp", - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "optMap", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "optMap", - "scalar": { - "kind": 4, - "name": "optMap", - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "optMap", - "type": "Int" - } - }, - "name": "optMap", - "type": "Map" - } - ], - "type": "Env" - }, - "importedEnumTypes": [ - { - "constants": [ - "STRING", - "BYTES" - ], - "kind": 520, - "namespace": "TestImport", - "nativeType": "Enum", - "type": "TestImport_Enum", - "uri": "testimport.uri.eth" - }, - { - "constants": [ - "STRING", - "BYTES" - ], - "kind": 520, - "namespace": "TestImport", - "nativeType": "Enum", - "type": "TestImport_Enum_Return", - "uri": "testimport.uri.eth" - } - ], - "importedEnvTypes": [ - { - "kind": 524288, - "namespace": "TestImport", - "nativeType": "Env", - "properties": [ - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "TestImport_AnotherObject" - }, - "required": true, - "type": "TestImport_AnotherObject" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "TestImport_AnotherObject" - }, - "type": "TestImport_AnotherObject" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_AnotherObject" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_AnotherObject" - }, - "required": true, - "type": "[TestImport_AnotherObject]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[TestImport_AnotherObject]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_AnotherObject" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_AnotherObject" - }, - "type": "[TestImport_AnotherObject]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[TestImport_AnotherObject]" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "optEnum", - "type": "TestImport_Enum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - } - ], - "type": "TestImport_Env", - "uri": "testimport.uri.eth" - } - ], - "importedModuleTypes": [ - { - "isInterface": true, - "kind": 256, - "methods": [ - { - "arguments": [ - { - "kind": 34, - "name": "str", - "required": true, - "scalar": { - "kind": 4, - "name": "str", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "optStr", - "scalar": { - "kind": 4, - "name": "optStr", - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "u", - "required": true, - "scalar": { - "kind": 4, - "name": "u", - "required": true, - "type": "UInt" - }, - "type": "UInt" - }, - { - "kind": 34, - "name": "optU", - "scalar": { - "kind": 4, - "name": "optU", - "type": "UInt" - }, - "type": "UInt" - }, - { - "array": { - "array": { - "item": { - "kind": 4, - "name": "uArrayArray", - "type": "UInt" - }, - "kind": 18, - "name": "uArrayArray", - "scalar": { - "kind": 4, - "name": "uArrayArray", - "type": "UInt" - }, - "type": "[UInt]" - }, - "item": { - "item": { - "kind": 4, - "name": "uArrayArray", - "type": "UInt" - }, - "kind": 18, - "name": "uArrayArray", - "scalar": { - "kind": 4, - "name": "uArrayArray", - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 18, - "name": "uArrayArray", - "required": true, - "type": "[[UInt]]" - }, - "kind": 34, - "name": "uArrayArray", - "required": true, - "type": "[[UInt]]" - }, - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "TestImport_Object" - }, - "required": true, - "type": "TestImport_Object" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "TestImport_Object" - }, - "type": "TestImport_Object" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_Object" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_Object" - }, - "required": true, - "type": "[TestImport_Object]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[TestImport_Object]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_Object" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_Object" - }, - "type": "[TestImport_Object]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[TestImport_Object]" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "optEnum", - "type": "TestImport_Enum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - } - ], - "env": { - "required": true - }, - "kind": 64, - "name": "importedMethod", - "required": true, - "return": { - "kind": 34, - "name": "importedMethod", - "object": { - "kind": 8192, - "name": "importedMethod", - "type": "TestImport_Object" - }, - "type": "TestImport_Object" - }, - "type": "Method" - }, - { - "arguments": [ - { - "array": { - "item": { - "kind": 4, - "name": "arg", - "required": true, - "type": "String" - }, - "kind": 18, - "name": "arg", - "required": true, - "scalar": { - "kind": 4, - "name": "arg", - "required": true, - "type": "String" - }, - "type": "[String]" - }, - "kind": 34, - "name": "arg", - "required": true, - "type": "[String]" - } - ], - "kind": 64, - "name": "anotherMethod", - "required": true, - "return": { - "kind": 34, - "name": "anotherMethod", - "required": true, - "scalar": { - "kind": 4, - "name": "anotherMethod", - "required": true, - "type": "Int32" - }, - "type": "Int32" - }, - "type": "Method" - }, - { - "arguments": [ - { - "kind": 34, - "name": "arg", - "required": true, - "scalar": { - "kind": 4, - "name": "arg", - "required": true, - "type": "String" - }, - "type": "String" - } - ], - "kind": 64, - "name": "returnsArrayOfEnums", - "required": true, - "return": { - "array": { - "enum": { - "kind": 16384, - "name": "returnsArrayOfEnums", - "type": "TestImport_Enum_Return" - }, - "item": { - "kind": 16384, - "name": "returnsArrayOfEnums", - "type": "TestImport_Enum_Return" - }, - "kind": 18, - "name": "returnsArrayOfEnums", - "required": true, - "type": "[TestImport_Enum_Return]" - }, - "kind": 34, - "name": "returnsArrayOfEnums", - "required": true, - "type": "[TestImport_Enum_Return]" - }, - "type": "Method" - } - ], - "namespace": "TestImport", - "nativeType": "Module", - "type": "TestImport_Module", - "uri": "testimport.uri.eth" - } - ], - "importedObjectTypes": [ - { - "kind": 1025, - "namespace": "TestImport", - "nativeType": "Object", - "properties": [ - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "TestImport_AnotherObject" - }, - "required": true, - "type": "TestImport_AnotherObject" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "TestImport_AnotherObject" - }, - "type": "TestImport_AnotherObject" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_AnotherObject" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_AnotherObject" - }, - "required": true, - "type": "[TestImport_AnotherObject]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[TestImport_AnotherObject]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_AnotherObject" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_AnotherObject" - }, - "type": "[TestImport_AnotherObject]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[TestImport_AnotherObject]" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "optEnum", - "type": "TestImport_Enum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - } - ], - "type": "TestImport_Object", - "uri": "testimport.uri.eth" - }, - { - "kind": 1025, - "namespace": "TestImport", - "nativeType": "AnotherObject", - "properties": [ - { - "kind": 34, - "name": "prop", - "required": true, - "scalar": { - "kind": 4, - "name": "prop", - "required": true, - "type": "String" - }, - "type": "String" - } - ], - "type": "TestImport_AnotherObject", - "uri": "testimport.uri.eth" - } - ], - "interfaceTypes": [ - { - "capabilities": { - "getImplementations": { - "enabled": true - } - }, - "kind": 32768, - "namespace": "TestImport", - "nativeType": "Interface", - "type": "TestImport", - "uri": "testimport.uri.eth" - } - ], - "moduleType": { - "imports": [ - { - "type": "TestImport_Module" - }, - { - "type": "TestImport_Object" - }, - { - "type": "TestImport_AnotherObject" - }, - { - "type": "TestImport_Enum" - }, - { - "type": "TestImport_Enum_Return" - } - ], - "kind": 128, - "methods": [ - { - "arguments": [ - { - "kind": 34, - "name": "str", - "required": true, - "scalar": { - "kind": 4, - "name": "str", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "optStr", - "scalar": { - "kind": 4, - "name": "optStr", - "type": "String" - }, - "type": "String" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "CustomEnum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "CustomEnum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "CustomEnum" - }, - "kind": 34, - "name": "optEnum", - "type": "CustomEnum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "CustomEnum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "CustomEnum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[CustomEnum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[CustomEnum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "CustomEnum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "CustomEnum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[CustomEnum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[CustomEnum]" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "map", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "map", - "required": true, - "scalar": { - "kind": 4, - "name": "map", - "required": true, - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "map", - "required": true, - "type": "Int" - } - }, - "name": "map", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "array": { - "item": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "kind": 18, - "name": "mapOfArr", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "type": "[Int]" - }, - "key": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfArr", - "required": true, - "type": "Map", - "value": { - "item": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "kind": 18, - "name": "mapOfArr", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "type": "[Int]" - } - }, - "name": "mapOfArr", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "String" - }, - "kind": 262146, - "map": { - "key": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfMap", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "Int" - } - }, - "name": "mapOfMap", - "required": true, - "type": "Map>", - "value": { - "key": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfMap", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "Int" - } - } - }, - "name": "mapOfMap", - "required": true, - "type": "Map>" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "mapOfObj", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfObj", - "object": { - "kind": 8192, - "name": "mapOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "Map", - "value": { - "kind": 8192, - "name": "mapOfObj", - "required": true, - "type": "AnotherType" - } - }, - "name": "mapOfObj", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "array": { - "item": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "mapOfArrOfObj", - "object": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "key": { - "kind": 4, - "name": "mapOfArrOfObj", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfArrOfObj", - "required": true, - "type": "Map", - "value": { - "item": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "mapOfArrOfObj", - "object": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - } - }, - "name": "mapOfArrOfObj", - "required": true, - "type": "Map" - } - ], - "kind": 64, - "name": "moduleMethod", - "required": true, - "return": { - "kind": 34, - "name": "moduleMethod", - "required": true, - "scalar": { - "kind": 4, - "name": "moduleMethod", - "required": true, - "type": "Int" - }, - "type": "Int" - }, - "type": "Method" - }, - { - "arguments": [ - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "AnotherType" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[AnotherType]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[AnotherType]" - } - ], - "env": { - "required": true - }, - "kind": 64, - "name": "objectMethod", - "required": true, - "return": { - "kind": 34, - "name": "objectMethod", - "object": { - "kind": 8192, - "name": "objectMethod", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - "type": "Method" - }, - { - "arguments": [ - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "AnotherType" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[AnotherType]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[AnotherType]" - } - ], - "env": { - "required": false - }, - "kind": 64, - "name": "optionalEnvMethod", - "required": true, - "return": { - "kind": 34, - "name": "optionalEnvMethod", - "object": { - "kind": 8192, - "name": "optionalEnvMethod", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - "type": "Method" - }, - { - "arguments": [ - { - "kind": 34, - "name": "if", - "object": { - "kind": 8192, - "name": "if", - "required": true, - "type": "else" - }, - "required": true, - "type": "else" - } - ], - "kind": 64, - "name": "if", - "required": true, - "return": { - "kind": 34, - "name": "if", - "object": { - "kind": 8192, - "name": "if", - "required": true, - "type": "else" - }, - "required": true, - "type": "else" - }, - "type": "Method" - } - ], - "type": "Module" - }, - "objectTypes": [ - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "str", - "required": true, - "scalar": { - "kind": 4, - "name": "str", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "optStr", - "scalar": { - "kind": 4, - "name": "optStr", - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "u", - "required": true, - "scalar": { - "kind": 4, - "name": "u", - "required": true, - "type": "UInt" - }, - "type": "UInt" - }, - { - "kind": 34, - "name": "optU", - "scalar": { - "kind": 4, - "name": "optU", - "type": "UInt" - }, - "type": "UInt" - }, - { - "kind": 34, - "name": "u8", - "required": true, - "scalar": { - "kind": 4, - "name": "u8", - "required": true, - "type": "UInt8" - }, - "type": "UInt8" - }, - { - "kind": 34, - "name": "u16", - "required": true, - "scalar": { - "kind": 4, - "name": "u16", - "required": true, - "type": "UInt16" - }, - "type": "UInt16" - }, - { - "kind": 34, - "name": "u32", - "required": true, - "scalar": { - "kind": 4, - "name": "u32", - "required": true, - "type": "UInt32" - }, - "type": "UInt32" - }, - { - "kind": 34, - "name": "i", - "required": true, - "scalar": { - "kind": 4, - "name": "i", - "required": true, - "type": "Int" - }, - "type": "Int" - }, - { - "kind": 34, - "name": "i8", - "required": true, - "scalar": { - "kind": 4, - "name": "i8", - "required": true, - "type": "Int8" - }, - "type": "Int8" - }, - { - "kind": 34, - "name": "i16", - "required": true, - "scalar": { - "kind": 4, - "name": "i16", - "required": true, - "type": "Int16" - }, - "type": "Int16" - }, - { - "kind": 34, - "name": "i32", - "required": true, - "scalar": { - "kind": 4, - "name": "i32", - "required": true, - "type": "Int32" - }, - "type": "Int32" - }, - { - "kind": 34, - "name": "bigint", - "required": true, - "scalar": { - "kind": 4, - "name": "bigint", - "required": true, - "type": "BigInt" - }, - "type": "BigInt" - }, - { - "kind": 34, - "name": "optBigint", - "scalar": { - "kind": 4, - "name": "optBigint", - "type": "BigInt" - }, - "type": "BigInt" - }, - { - "kind": 34, - "name": "bignumber", - "required": true, - "scalar": { - "kind": 4, - "name": "bignumber", - "required": true, - "type": "BigNumber" - }, - "type": "BigNumber" - }, - { - "kind": 34, - "name": "optBignumber", - "scalar": { - "kind": 4, - "name": "optBignumber", - "type": "BigNumber" - }, - "type": "BigNumber" - }, - { - "kind": 34, - "name": "json", - "required": true, - "scalar": { - "kind": 4, - "name": "json", - "required": true, - "type": "JSON" - }, - "type": "JSON" - }, - { - "kind": 34, - "name": "optJson", - "scalar": { - "kind": 4, - "name": "optJson", - "type": "JSON" - }, - "type": "JSON" - }, - { - "kind": 34, - "name": "bytes", - "required": true, - "scalar": { - "kind": 4, - "name": "bytes", - "required": true, - "type": "Bytes" - }, - "type": "Bytes" - }, - { - "kind": 34, - "name": "optBytes", - "scalar": { - "kind": 4, - "name": "optBytes", - "type": "Bytes" - }, - "type": "Bytes" - }, - { - "kind": 34, - "name": "boolean", - "required": true, - "scalar": { - "kind": 4, - "name": "boolean", - "required": true, - "type": "Boolean" - }, - "type": "Boolean" - }, - { - "kind": 34, - "name": "optBoolean", - "scalar": { - "kind": 4, - "name": "optBoolean", - "type": "Boolean" - }, - "type": "Boolean" - }, - { - "array": { - "item": { - "kind": 4, - "name": "u_array", - "required": true, - "type": "UInt" - }, - "kind": 18, - "name": "u_array", - "required": true, - "scalar": { - "kind": 4, - "name": "u_array", - "required": true, - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 34, - "name": "u_array", - "required": true, - "type": "[UInt]" - }, - { - "array": { - "item": { - "kind": 4, - "name": "uOpt_array", - "required": true, - "type": "UInt" - }, - "kind": 18, - "name": "uOpt_array", - "scalar": { - "kind": 4, - "name": "uOpt_array", - "required": true, - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 34, - "name": "uOpt_array", - "type": "[UInt]" - }, - { - "array": { - "item": { - "kind": 4, - "name": "_opt_uOptArray", - "type": "UInt" - }, - "kind": 18, - "name": "_opt_uOptArray", - "scalar": { - "kind": 4, - "name": "_opt_uOptArray", - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 34, - "name": "_opt_uOptArray", - "type": "[UInt]" - }, - { - "array": { - "item": { - "kind": 4, - "name": "optStrOptArray", - "type": "String" - }, - "kind": 18, - "name": "optStrOptArray", - "scalar": { - "kind": 4, - "name": "optStrOptArray", - "type": "String" - }, - "type": "[String]" - }, - "kind": 34, - "name": "optStrOptArray", - "type": "[String]" - }, - { - "array": { - "array": { - "item": { - "kind": 4, - "name": "uArrayArray", - "required": true, - "type": "UInt" - }, - "kind": 18, - "name": "uArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayArray", - "required": true, - "type": "UInt" - }, - "type": "[UInt]" - }, - "item": { - "item": { - "kind": 4, - "name": "uArrayArray", - "required": true, - "type": "UInt" - }, - "kind": 18, - "name": "uArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayArray", - "required": true, - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 18, - "name": "uArrayArray", - "required": true, - "type": "[[UInt]]" - }, - "kind": 34, - "name": "uArrayArray", - "required": true, - "type": "[[UInt]]" - }, - { - "array": { - "array": { - "item": { - "kind": 4, - "name": "uOptArrayOptArray", - "type": "UInt32" - }, - "kind": 18, - "name": "uOptArrayOptArray", - "scalar": { - "kind": 4, - "name": "uOptArrayOptArray", - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "uOptArrayOptArray", - "type": "UInt32" - }, - "kind": 18, - "name": "uOptArrayOptArray", - "scalar": { - "kind": 4, - "name": "uOptArrayOptArray", - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "uOptArrayOptArray", - "required": true, - "type": "[[UInt32]]" - }, - "kind": 34, - "name": "uOptArrayOptArray", - "required": true, - "type": "[[UInt32]]" - }, - { - "array": { - "array": { - "array": { - "item": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "type": "[[UInt32]]" - }, - "item": { - "array": { - "item": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "type": "[[UInt32]]" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "type": "[[[UInt32]]]" - }, - "kind": 34, - "name": "uArrayOptArrayArray", - "required": true, - "type": "[[[UInt32]]]" - }, - { - "array": { - "array": { - "array": { - "array": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "crazyArray", - "required": true, - "type": "[[UInt32]]" - }, - "item": { - "array": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "crazyArray", - "required": true, - "type": "[[UInt32]]" - }, - "kind": 18, - "name": "crazyArray", - "type": "[[[UInt32]]]" - }, - "item": { - "array": { - "array": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "crazyArray", - "required": true, - "type": "[[UInt32]]" - }, - "item": { - "array": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "crazyArray", - "required": true, - "type": "[[UInt32]]" - }, - "kind": 18, - "name": "crazyArray", - "type": "[[[UInt32]]]" - }, - "kind": 18, - "name": "crazyArray", - "type": "[[[[UInt32]]]]" - }, - "kind": 34, - "name": "crazyArray", - "type": "[[[[UInt32]]]]" - }, - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "AnotherType" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[AnotherType]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[AnotherType]" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "CustomEnum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "CustomEnum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "CustomEnum" - }, - "kind": 34, - "name": "optEnum", - "type": "CustomEnum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "CustomEnum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "CustomEnum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[CustomEnum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[CustomEnum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "CustomEnum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "CustomEnum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[CustomEnum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[CustomEnum]" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "map", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "map", - "required": true, - "scalar": { - "kind": 4, - "name": "map", - "required": true, - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "map", - "required": true, - "type": "Int" - } - }, - "name": "map", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "array": { - "item": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "kind": 18, - "name": "mapOfArr", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "type": "[Int]" - }, - "key": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfArr", - "required": true, - "type": "Map", - "value": { - "item": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "kind": 18, - "name": "mapOfArr", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "type": "[Int]" - } - }, - "name": "mapOfArr", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "mapOfObj", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfObj", - "object": { - "kind": 8192, - "name": "mapOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "Map", - "value": { - "kind": 8192, - "name": "mapOfObj", - "required": true, - "type": "AnotherType" - } - }, - "name": "mapOfObj", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "array": { - "item": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "mapOfArrOfObj", - "object": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "key": { - "kind": 4, - "name": "mapOfArrOfObj", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfArrOfObj", - "required": true, - "type": "Map", - "value": { - "item": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "mapOfArrOfObj", - "object": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - } - }, - "name": "mapOfArrOfObj", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "mapCustomValue", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapCustomValue", - "object": { - "kind": 8192, - "name": "mapCustomValue", - "type": "CustomMapValue" - }, - "required": true, - "type": "Map", - "value": { - "kind": 8192, - "name": "mapCustomValue", - "type": "CustomMapValue" - } - }, - "name": "mapCustomValue", - "required": true, - "type": "Map" - } - ], - "type": "CustomType" - }, - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "prop", - "scalar": { - "kind": 4, - "name": "prop", - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "circular", - "object": { - "kind": 8192, - "name": "circular", - "type": "CustomType" - }, - "type": "CustomType" - }, - { - "kind": 34, - "name": "const", - "scalar": { - "kind": 4, - "name": "const", - "type": "String" - }, - "type": "String" - } - ], - "type": "AnotherType" - }, - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "foo", - "required": true, - "scalar": { - "kind": 4, - "name": "foo", - "required": true, - "type": "String" - }, - "type": "String" - } - ], - "type": "CustomMapValue" - }, - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "else", - "required": true, - "scalar": { - "kind": 4, - "name": "else", - "required": true, - "type": "String" - }, - "type": "String" - } - ], - "type": "else" - } - ], - "version": "0.1" -} -""") - -manifest = WrapManifest.parse_obj({ - "name": "Test", - "type": "plugin", - "version": "0.1", - "abi": abi, -}) diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/mod.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/mod.rs deleted file mode 100644 index 88b7de7bdf..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-rs/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -/// NOTE: This is an auto-generated file. -/// All modifications will be overwritten. - -pub mod types; -#[path = "wrap.info.rs"] -pub mod wrap_info; -pub mod module; \ No newline at end of file diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs deleted file mode 100644 index db0deb7938..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs +++ /dev/null @@ -1,69 +0,0 @@ -/// NOTE: This is an auto-generated file. -/// All modifications will be overwritten. - -use std::sync::Arc; -use polywrap_core::invoke::Invoker; -use polywrap_plugin::{error::PluginError, module::PluginModule}; -use serde::{Serialize, Deserialize}; -use super::types::*; - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsModuleMethod { - pub str: String, - #[serde(rename = "optStr")] - pub opt_str: Option, - pub en: CustomEnum, - #[serde(rename = "optEnum")] - pub opt_enum: Option, - #[serde(rename = "enumArray")] - pub enum_array: Vec, - #[serde(rename = "optEnumArray")] - pub opt_enum_array: Option>>, - pub map: Map, - #[serde(rename = "mapOfArr")] - pub map_of_arr: Map>, - #[serde(rename = "mapOfMap")] - pub map_of_map: Map>, - #[serde(rename = "mapOfObj")] - pub map_of_obj: Map, - #[serde(rename = "mapOfArrOfObj")] - pub map_of_arr_of_obj: Map>, -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsObjectMethod { - pub object: AnotherType, - #[serde(rename = "optObject")] - pub opt_object: Option, - #[serde(rename = "objectArray")] - pub object_array: Vec, - #[serde(rename = "optObjectArray")] - pub opt_object_array: Option>>, -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsOptionalEnvMethod { - pub object: AnotherType, - #[serde(rename = "optObject")] - pub opt_object: Option, - #[serde(rename = "objectArray")] - pub object_array: Vec, - #[serde(rename = "optObjectArray")] - pub opt_object_array: Option>>, -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsIf { - #[serde(rename = "if")] - pub _if: Else, -} - -pub trait Module: PluginModule { - fn module_method(&mut self, args: &ArgsModuleMethod, invoker: Arc) -> Result; - - fn object_method(&mut self, args: &ArgsObjectMethod, invoker: Arc, env: Env) -> Result, PluginError>; - - fn optional_env_method(&mut self, args: &ArgsOptionalEnvMethod, invoker: Arc, env: Option) -> Result, PluginError>; - - fn _if(&mut self, args: &ArgsIf, invoker: Arc) -> Result; -} diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs deleted file mode 100644 index fe3c18556b..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs +++ /dev/null @@ -1,289 +0,0 @@ -#![allow(unused_imports)] -#![allow(non_camel_case_types)] - -// NOTE: This is an auto-generated file. -// All modifications will be overwritten. -use polywrap_core::{invoke::Invoker, uri::Uri}; -use polywrap_msgpack::{decode, serialize}; -use polywrap_plugin::{error::PluginError, BigInt, BigNumber, Map, JSON}; -use serde::{Serialize, Deserialize}; -use std::sync::Arc; - -// Env START // - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Env { - pub prop: String, - #[serde(rename = "optProp")] - pub opt_prop: Option, - #[serde(rename = "optMap")] - pub opt_map: Option>>, -} -// Env END // - -// Objects START // - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CustomType { - pub str: String, - #[serde(rename = "optStr")] - pub opt_str: Option, - pub u: u32, - #[serde(rename = "optU")] - pub opt_u: Option, - pub u8: u8, - pub u16: u16, - pub u32: u32, - pub i: i32, - pub i8: i8, - pub i16: i16, - pub i32: i32, - pub bigint: BigInt, - #[serde(rename = "optBigint")] - pub opt_bigint: Option, - pub bignumber: BigNumber, - #[serde(rename = "optBignumber")] - pub opt_bignumber: Option, - pub json: JSON::Value, - #[serde(rename = "optJson")] - pub opt_json: Option, - #[serde(with = "serde_bytes")] - pub bytes: Vec, - #[serde(with = "serde_bytes")] - #[serde(rename = "optBytes")] - pub opt_bytes: Option>, - pub boolean: bool, - #[serde(rename = "optBoolean")] - pub opt_boolean: Option, - pub u_array: Vec, - #[serde(rename = "uOpt_array")] - pub u_opt_array: Option>, - #[serde(rename = "_opt_uOptArray")] - pub _opt_u_opt_array: Option>>, - #[serde(rename = "optStrOptArray")] - pub opt_str_opt_array: Option>>, - #[serde(rename = "uArrayArray")] - pub u_array_array: Vec>, - #[serde(rename = "uOptArrayOptArray")] - pub u_opt_array_opt_array: Vec>>>, - #[serde(rename = "uArrayOptArrayArray")] - pub u_array_opt_array_array: Vec>>>, - #[serde(rename = "crazyArray")] - pub crazy_array: Option>>>>>>, - pub object: AnotherType, - #[serde(rename = "optObject")] - pub opt_object: Option, - #[serde(rename = "objectArray")] - pub object_array: Vec, - #[serde(rename = "optObjectArray")] - pub opt_object_array: Option>>, - pub en: CustomEnum, - #[serde(rename = "optEnum")] - pub opt_enum: Option, - #[serde(rename = "enumArray")] - pub enum_array: Vec, - #[serde(rename = "optEnumArray")] - pub opt_enum_array: Option>>, - pub map: Map, - #[serde(rename = "mapOfArr")] - pub map_of_arr: Map>, - #[serde(rename = "mapOfObj")] - pub map_of_obj: Map, - #[serde(rename = "mapOfArrOfObj")] - pub map_of_arr_of_obj: Map>, - #[serde(rename = "mapCustomValue")] - pub map_custom_value: Map>, -} -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct AnotherType { - pub prop: Option, - pub circular: Option, - #[serde(rename = "const")] - pub _const: Option, -} -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CustomMapValue { - pub foo: String, -} -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Else { - #[serde(rename = "else")] - pub _else: String, -} -// Objects END // - -// Enums START // - -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] -pub enum CustomEnum { - STRING, - BYTES, - _MAX_ -} -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] -pub enum While { - _for, - _in, - _MAX_ -} -// Enums END // - -// Imported objects START // - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TestImportObject { - pub object: TestImportAnotherObject, - #[serde(rename = "optObject")] - pub opt_object: Option, - #[serde(rename = "objectArray")] - pub object_array: Vec, - #[serde(rename = "optObjectArray")] - pub opt_object_array: Option>>, - pub en: TestImportEnum, - #[serde(rename = "optEnum")] - pub opt_enum: Option, - #[serde(rename = "enumArray")] - pub enum_array: Vec, - #[serde(rename = "optEnumArray")] - pub opt_enum_array: Option>>, -} -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TestImportAnotherObject { - pub prop: String, -} -// Imported objects END // - -// Imported envs START // - -// Imported envs END // - -// Imported enums START // - -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] -pub enum TestImportEnum { - STRING, - BYTES, - _MAX_ -} -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] -pub enum TestImportEnumReturn { - STRING, - BYTES, - _MAX_ -} -// Imported enums END // - -// Imported Modules START // - -// URI: "testimport.uri.eth" // -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TestImportModuleArgsImportedMethod { - pub str: String, - #[serde(rename = "optStr")] - pub opt_str: Option, - pub u: u32, - #[serde(rename = "optU")] - pub opt_u: Option, - #[serde(rename = "uArrayArray")] - pub u_array_array: Vec>>>, - pub object: TestImportObject, - #[serde(rename = "optObject")] - pub opt_object: Option, - #[serde(rename = "objectArray")] - pub object_array: Vec, - #[serde(rename = "optObjectArray")] - pub opt_object_array: Option>>, - pub en: TestImportEnum, - #[serde(rename = "optEnum")] - pub opt_enum: Option, - #[serde(rename = "enumArray")] - pub enum_array: Vec, - #[serde(rename = "optEnumArray")] - pub opt_enum_array: Option>>, -} - -// URI: "testimport.uri.eth" // -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TestImportModuleArgsAnotherMethod { - pub arg: Vec, -} - -// URI: "testimport.uri.eth" // -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TestImportModuleArgsReturnsArrayOfEnums { - pub arg: String, -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TestImportModule<'a> { - uri: &'a str -} - -impl<'a> TestImportModule<'a> { - pub const INTERFACE_URI: &'static str = "testimport.uri.eth"; - - pub fn new(uri: &'a str) -> TestImportModule<'a> { - TestImportModule { uri: uri } - } - - pub fn imported_method(&self, args: &TestImportModuleArgsImportedMethod) -> Result, PluginError> { - let uri = self.uri; - let serialized_args = serialize(args.clone()).unwrap(); - let result = invoker.invoke_raw( - uri, - "importedMethod", - serialized_args, - None, - None - ) - .map_err(|e| PluginError::SubinvocationError { - uri: uri.to_string(), - method: "importedMethod".to_string(), - args: JSON::to_string(&args).unwrap(), - exception: e.to_string(), - })?; - - Ok(Some(decode(result.as_slice())?)) - } - - pub fn another_method(&self, args: &TestImportModuleArgsAnotherMethod) -> Result { - let uri = self.uri; - let serialized_args = serialize(args.clone()).unwrap(); - let result = invoker.invoke_raw( - uri, - "anotherMethod", - serialized_args, - None, - None - ) - .map_err(|e| PluginError::SubinvocationError { - uri: uri.to_string(), - method: "anotherMethod".to_string(), - args: JSON::to_string(&args).unwrap(), - exception: e.to_string(), - })?; - - Ok(decode(result.as_slice())?) - } - - pub fn returns_array_of_enums(&self, args: &TestImportModuleArgsReturnsArrayOfEnums) -> Result>, PluginError> { - let uri = self.uri; - let serialized_args = serialize(args.clone()).unwrap(); - let result = invoker.invoke_raw( - uri, - "returnsArrayOfEnums", - serialized_args, - None, - None - ) - .map_err(|e| PluginError::SubinvocationError { - uri: uri.to_string(), - method: "returnsArrayOfEnums".to_string(), - args: JSON::to_string(&args).unwrap(), - exception: e.to_string(), - })?; - - Ok(decode(result.as_slice())?) - } -} -// Imported Modules END // diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/wrap.info.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/wrap.info.rs deleted file mode 100644 index a7fab1e26d..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-rs/wrap.info.rs +++ /dev/null @@ -1,2436 +0,0 @@ -/// NOTE: This is an auto-generated file. -/// All modifications will be overwritten. -use polywrap_plugin::JSON::{from_value, json}; -use wrap_manifest_schemas::versions::{WrapManifest, WrapManifestAbi}; - -pub fn get_manifest() -> WrapManifest { - WrapManifest { - name: "Test".to_string(), - type_: "plugin".to_string(), - version: "0.1".to_string(), - abi: from_value::(json!({ - "enumTypes": [ - { - "constants": [ - "STRING", - "BYTES" - ], - "kind": 8, - "type": "CustomEnum" - }, - { - "constants": [ - "for", - "in" - ], - "kind": 8, - "type": "while" - } - ], - "envType": { - "kind": 65536, - "properties": [ - { - "kind": 34, - "name": "prop", - "required": true, - "scalar": { - "kind": 4, - "name": "prop", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "optProp", - "scalar": { - "kind": 4, - "name": "optProp", - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "optMap", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "optMap", - "scalar": { - "kind": 4, - "name": "optMap", - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "optMap", - "type": "Int" - } - }, - "name": "optMap", - "type": "Map" - } - ], - "type": "Env" - }, - "importedEnumTypes": [ - { - "constants": [ - "STRING", - "BYTES" - ], - "kind": 520, - "namespace": "TestImport", - "nativeType": "Enum", - "type": "TestImport_Enum", - "uri": "testimport.uri.eth" - }, - { - "constants": [ - "STRING", - "BYTES" - ], - "kind": 520, - "namespace": "TestImport", - "nativeType": "Enum", - "type": "TestImport_Enum_Return", - "uri": "testimport.uri.eth" - } - ], - "importedEnvTypes": [ - { - "kind": 524288, - "namespace": "TestImport", - "nativeType": "Env", - "properties": [ - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "TestImport_AnotherObject" - }, - "required": true, - "type": "TestImport_AnotherObject" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "TestImport_AnotherObject" - }, - "type": "TestImport_AnotherObject" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_AnotherObject" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_AnotherObject" - }, - "required": true, - "type": "[TestImport_AnotherObject]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[TestImport_AnotherObject]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_AnotherObject" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_AnotherObject" - }, - "type": "[TestImport_AnotherObject]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[TestImport_AnotherObject]" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "optEnum", - "type": "TestImport_Enum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - } - ], - "type": "TestImport_Env", - "uri": "testimport.uri.eth" - } - ], - "importedModuleTypes": [ - { - "isInterface": true, - "kind": 256, - "methods": [ - { - "arguments": [ - { - "kind": 34, - "name": "str", - "required": true, - "scalar": { - "kind": 4, - "name": "str", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "optStr", - "scalar": { - "kind": 4, - "name": "optStr", - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "u", - "required": true, - "scalar": { - "kind": 4, - "name": "u", - "required": true, - "type": "UInt" - }, - "type": "UInt" - }, - { - "kind": 34, - "name": "optU", - "scalar": { - "kind": 4, - "name": "optU", - "type": "UInt" - }, - "type": "UInt" - }, - { - "array": { - "array": { - "item": { - "kind": 4, - "name": "uArrayArray", - "type": "UInt" - }, - "kind": 18, - "name": "uArrayArray", - "scalar": { - "kind": 4, - "name": "uArrayArray", - "type": "UInt" - }, - "type": "[UInt]" - }, - "item": { - "item": { - "kind": 4, - "name": "uArrayArray", - "type": "UInt" - }, - "kind": 18, - "name": "uArrayArray", - "scalar": { - "kind": 4, - "name": "uArrayArray", - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 18, - "name": "uArrayArray", - "required": true, - "type": "[[UInt]]" - }, - "kind": 34, - "name": "uArrayArray", - "required": true, - "type": "[[UInt]]" - }, - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "TestImport_Object" - }, - "required": true, - "type": "TestImport_Object" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "TestImport_Object" - }, - "type": "TestImport_Object" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_Object" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_Object" - }, - "required": true, - "type": "[TestImport_Object]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[TestImport_Object]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_Object" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_Object" - }, - "type": "[TestImport_Object]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[TestImport_Object]" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "optEnum", - "type": "TestImport_Enum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - } - ], - "env": { - "required": true - }, - "kind": 64, - "name": "importedMethod", - "required": true, - "return": { - "kind": 34, - "name": "importedMethod", - "object": { - "kind": 8192, - "name": "importedMethod", - "type": "TestImport_Object" - }, - "type": "TestImport_Object" - }, - "type": "Method" - }, - { - "arguments": [ - { - "array": { - "item": { - "kind": 4, - "name": "arg", - "required": true, - "type": "String" - }, - "kind": 18, - "name": "arg", - "required": true, - "scalar": { - "kind": 4, - "name": "arg", - "required": true, - "type": "String" - }, - "type": "[String]" - }, - "kind": 34, - "name": "arg", - "required": true, - "type": "[String]" - } - ], - "kind": 64, - "name": "anotherMethod", - "required": true, - "return": { - "kind": 34, - "name": "anotherMethod", - "required": true, - "scalar": { - "kind": 4, - "name": "anotherMethod", - "required": true, - "type": "Int32" - }, - "type": "Int32" - }, - "type": "Method" - }, - { - "arguments": [ - { - "kind": 34, - "name": "arg", - "required": true, - "scalar": { - "kind": 4, - "name": "arg", - "required": true, - "type": "String" - }, - "type": "String" - } - ], - "kind": 64, - "name": "returnsArrayOfEnums", - "required": true, - "return": { - "array": { - "enum": { - "kind": 16384, - "name": "returnsArrayOfEnums", - "type": "TestImport_Enum_Return" - }, - "item": { - "kind": 16384, - "name": "returnsArrayOfEnums", - "type": "TestImport_Enum_Return" - }, - "kind": 18, - "name": "returnsArrayOfEnums", - "required": true, - "type": "[TestImport_Enum_Return]" - }, - "kind": 34, - "name": "returnsArrayOfEnums", - "required": true, - "type": "[TestImport_Enum_Return]" - }, - "type": "Method" - } - ], - "namespace": "TestImport", - "nativeType": "Module", - "type": "TestImport_Module", - "uri": "testimport.uri.eth" - } - ], - "importedObjectTypes": [ - { - "kind": 1025, - "namespace": "TestImport", - "nativeType": "Object", - "properties": [ - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "TestImport_AnotherObject" - }, - "required": true, - "type": "TestImport_AnotherObject" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "TestImport_AnotherObject" - }, - "type": "TestImport_AnotherObject" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_AnotherObject" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_AnotherObject" - }, - "required": true, - "type": "[TestImport_AnotherObject]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[TestImport_AnotherObject]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_AnotherObject" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_AnotherObject" - }, - "type": "[TestImport_AnotherObject]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[TestImport_AnotherObject]" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "optEnum", - "type": "TestImport_Enum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - } - ], - "type": "TestImport_Object", - "uri": "testimport.uri.eth" - }, - { - "kind": 1025, - "namespace": "TestImport", - "nativeType": "AnotherObject", - "properties": [ - { - "kind": 34, - "name": "prop", - "required": true, - "scalar": { - "kind": 4, - "name": "prop", - "required": true, - "type": "String" - }, - "type": "String" - } - ], - "type": "TestImport_AnotherObject", - "uri": "testimport.uri.eth" - } - ], - "interfaceTypes": [ - { - "capabilities": { - "getImplementations": { - "enabled": true - } - }, - "kind": 32768, - "namespace": "TestImport", - "nativeType": "Interface", - "type": "TestImport", - "uri": "testimport.uri.eth" - } - ], - "moduleType": { - "imports": [ - { - "type": "TestImport_Module" - }, - { - "type": "TestImport_Object" - }, - { - "type": "TestImport_AnotherObject" - }, - { - "type": "TestImport_Enum" - }, - { - "type": "TestImport_Enum_Return" - } - ], - "kind": 128, - "methods": [ - { - "arguments": [ - { - "kind": 34, - "name": "str", - "required": true, - "scalar": { - "kind": 4, - "name": "str", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "optStr", - "scalar": { - "kind": 4, - "name": "optStr", - "type": "String" - }, - "type": "String" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "CustomEnum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "CustomEnum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "CustomEnum" - }, - "kind": 34, - "name": "optEnum", - "type": "CustomEnum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "CustomEnum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "CustomEnum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[CustomEnum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[CustomEnum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "CustomEnum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "CustomEnum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[CustomEnum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[CustomEnum]" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "map", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "map", - "required": true, - "scalar": { - "kind": 4, - "name": "map", - "required": true, - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "map", - "required": true, - "type": "Int" - } - }, - "name": "map", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "array": { - "item": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "kind": 18, - "name": "mapOfArr", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "type": "[Int]" - }, - "key": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfArr", - "required": true, - "type": "Map", - "value": { - "item": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "kind": 18, - "name": "mapOfArr", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "type": "[Int]" - } - }, - "name": "mapOfArr", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "String" - }, - "kind": 262146, - "map": { - "key": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfMap", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "Int" - } - }, - "name": "mapOfMap", - "required": true, - "type": "Map>", - "value": { - "key": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfMap", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "Int" - } - } - }, - "name": "mapOfMap", - "required": true, - "type": "Map>" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "mapOfObj", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfObj", - "object": { - "kind": 8192, - "name": "mapOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "Map", - "value": { - "kind": 8192, - "name": "mapOfObj", - "required": true, - "type": "AnotherType" - } - }, - "name": "mapOfObj", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "array": { - "item": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "mapOfArrOfObj", - "object": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "key": { - "kind": 4, - "name": "mapOfArrOfObj", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfArrOfObj", - "required": true, - "type": "Map", - "value": { - "item": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "mapOfArrOfObj", - "object": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - } - }, - "name": "mapOfArrOfObj", - "required": true, - "type": "Map" - } - ], - "kind": 64, - "name": "moduleMethod", - "required": true, - "return": { - "kind": 34, - "name": "moduleMethod", - "required": true, - "scalar": { - "kind": 4, - "name": "moduleMethod", - "required": true, - "type": "Int" - }, - "type": "Int" - }, - "type": "Method" - }, - { - "arguments": [ - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "AnotherType" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[AnotherType]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[AnotherType]" - } - ], - "env": { - "required": true - }, - "kind": 64, - "name": "objectMethod", - "required": true, - "return": { - "kind": 34, - "name": "objectMethod", - "object": { - "kind": 8192, - "name": "objectMethod", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - "type": "Method" - }, - { - "arguments": [ - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "AnotherType" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[AnotherType]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[AnotherType]" - } - ], - "env": { - "required": false - }, - "kind": 64, - "name": "optionalEnvMethod", - "required": true, - "return": { - "kind": 34, - "name": "optionalEnvMethod", - "object": { - "kind": 8192, - "name": "optionalEnvMethod", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - "type": "Method" - }, - { - "arguments": [ - { - "kind": 34, - "name": "if", - "object": { - "kind": 8192, - "name": "if", - "required": true, - "type": "else" - }, - "required": true, - "type": "else" - } - ], - "kind": 64, - "name": "if", - "required": true, - "return": { - "kind": 34, - "name": "if", - "object": { - "kind": 8192, - "name": "if", - "required": true, - "type": "else" - }, - "required": true, - "type": "else" - }, - "type": "Method" - } - ], - "type": "Module" - }, - "objectTypes": [ - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "str", - "required": true, - "scalar": { - "kind": 4, - "name": "str", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "optStr", - "scalar": { - "kind": 4, - "name": "optStr", - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "u", - "required": true, - "scalar": { - "kind": 4, - "name": "u", - "required": true, - "type": "UInt" - }, - "type": "UInt" - }, - { - "kind": 34, - "name": "optU", - "scalar": { - "kind": 4, - "name": "optU", - "type": "UInt" - }, - "type": "UInt" - }, - { - "kind": 34, - "name": "u8", - "required": true, - "scalar": { - "kind": 4, - "name": "u8", - "required": true, - "type": "UInt8" - }, - "type": "UInt8" - }, - { - "kind": 34, - "name": "u16", - "required": true, - "scalar": { - "kind": 4, - "name": "u16", - "required": true, - "type": "UInt16" - }, - "type": "UInt16" - }, - { - "kind": 34, - "name": "u32", - "required": true, - "scalar": { - "kind": 4, - "name": "u32", - "required": true, - "type": "UInt32" - }, - "type": "UInt32" - }, - { - "kind": 34, - "name": "i", - "required": true, - "scalar": { - "kind": 4, - "name": "i", - "required": true, - "type": "Int" - }, - "type": "Int" - }, - { - "kind": 34, - "name": "i8", - "required": true, - "scalar": { - "kind": 4, - "name": "i8", - "required": true, - "type": "Int8" - }, - "type": "Int8" - }, - { - "kind": 34, - "name": "i16", - "required": true, - "scalar": { - "kind": 4, - "name": "i16", - "required": true, - "type": "Int16" - }, - "type": "Int16" - }, - { - "kind": 34, - "name": "i32", - "required": true, - "scalar": { - "kind": 4, - "name": "i32", - "required": true, - "type": "Int32" - }, - "type": "Int32" - }, - { - "kind": 34, - "name": "bigint", - "required": true, - "scalar": { - "kind": 4, - "name": "bigint", - "required": true, - "type": "BigInt" - }, - "type": "BigInt" - }, - { - "kind": 34, - "name": "optBigint", - "scalar": { - "kind": 4, - "name": "optBigint", - "type": "BigInt" - }, - "type": "BigInt" - }, - { - "kind": 34, - "name": "bignumber", - "required": true, - "scalar": { - "kind": 4, - "name": "bignumber", - "required": true, - "type": "BigNumber" - }, - "type": "BigNumber" - }, - { - "kind": 34, - "name": "optBignumber", - "scalar": { - "kind": 4, - "name": "optBignumber", - "type": "BigNumber" - }, - "type": "BigNumber" - }, - { - "kind": 34, - "name": "json", - "required": true, - "scalar": { - "kind": 4, - "name": "json", - "required": true, - "type": "JSON" - }, - "type": "JSON" - }, - { - "kind": 34, - "name": "optJson", - "scalar": { - "kind": 4, - "name": "optJson", - "type": "JSON" - }, - "type": "JSON" - }, - { - "kind": 34, - "name": "bytes", - "required": true, - "scalar": { - "kind": 4, - "name": "bytes", - "required": true, - "type": "Bytes" - }, - "type": "Bytes" - }, - { - "kind": 34, - "name": "optBytes", - "scalar": { - "kind": 4, - "name": "optBytes", - "type": "Bytes" - }, - "type": "Bytes" - }, - { - "kind": 34, - "name": "boolean", - "required": true, - "scalar": { - "kind": 4, - "name": "boolean", - "required": true, - "type": "Boolean" - }, - "type": "Boolean" - }, - { - "kind": 34, - "name": "optBoolean", - "scalar": { - "kind": 4, - "name": "optBoolean", - "type": "Boolean" - }, - "type": "Boolean" - }, - { - "array": { - "item": { - "kind": 4, - "name": "u_array", - "required": true, - "type": "UInt" - }, - "kind": 18, - "name": "u_array", - "required": true, - "scalar": { - "kind": 4, - "name": "u_array", - "required": true, - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 34, - "name": "u_array", - "required": true, - "type": "[UInt]" - }, - { - "array": { - "item": { - "kind": 4, - "name": "uOpt_array", - "required": true, - "type": "UInt" - }, - "kind": 18, - "name": "uOpt_array", - "scalar": { - "kind": 4, - "name": "uOpt_array", - "required": true, - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 34, - "name": "uOpt_array", - "type": "[UInt]" - }, - { - "array": { - "item": { - "kind": 4, - "name": "_opt_uOptArray", - "type": "UInt" - }, - "kind": 18, - "name": "_opt_uOptArray", - "scalar": { - "kind": 4, - "name": "_opt_uOptArray", - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 34, - "name": "_opt_uOptArray", - "type": "[UInt]" - }, - { - "array": { - "item": { - "kind": 4, - "name": "optStrOptArray", - "type": "String" - }, - "kind": 18, - "name": "optStrOptArray", - "scalar": { - "kind": 4, - "name": "optStrOptArray", - "type": "String" - }, - "type": "[String]" - }, - "kind": 34, - "name": "optStrOptArray", - "type": "[String]" - }, - { - "array": { - "array": { - "item": { - "kind": 4, - "name": "uArrayArray", - "required": true, - "type": "UInt" - }, - "kind": 18, - "name": "uArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayArray", - "required": true, - "type": "UInt" - }, - "type": "[UInt]" - }, - "item": { - "item": { - "kind": 4, - "name": "uArrayArray", - "required": true, - "type": "UInt" - }, - "kind": 18, - "name": "uArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayArray", - "required": true, - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 18, - "name": "uArrayArray", - "required": true, - "type": "[[UInt]]" - }, - "kind": 34, - "name": "uArrayArray", - "required": true, - "type": "[[UInt]]" - }, - { - "array": { - "array": { - "item": { - "kind": 4, - "name": "uOptArrayOptArray", - "type": "UInt32" - }, - "kind": 18, - "name": "uOptArrayOptArray", - "scalar": { - "kind": 4, - "name": "uOptArrayOptArray", - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "uOptArrayOptArray", - "type": "UInt32" - }, - "kind": 18, - "name": "uOptArrayOptArray", - "scalar": { - "kind": 4, - "name": "uOptArrayOptArray", - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "uOptArrayOptArray", - "required": true, - "type": "[[UInt32]]" - }, - "kind": 34, - "name": "uOptArrayOptArray", - "required": true, - "type": "[[UInt32]]" - }, - { - "array": { - "array": { - "array": { - "item": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "type": "[[UInt32]]" - }, - "item": { - "array": { - "item": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "type": "[[UInt32]]" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "type": "[[[UInt32]]]" - }, - "kind": 34, - "name": "uArrayOptArrayArray", - "required": true, - "type": "[[[UInt32]]]" - }, - { - "array": { - "array": { - "array": { - "array": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "crazyArray", - "required": true, - "type": "[[UInt32]]" - }, - "item": { - "array": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "crazyArray", - "required": true, - "type": "[[UInt32]]" - }, - "kind": 18, - "name": "crazyArray", - "type": "[[[UInt32]]]" - }, - "item": { - "array": { - "array": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "crazyArray", - "required": true, - "type": "[[UInt32]]" - }, - "item": { - "array": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "crazyArray", - "required": true, - "type": "[[UInt32]]" - }, - "kind": 18, - "name": "crazyArray", - "type": "[[[UInt32]]]" - }, - "kind": 18, - "name": "crazyArray", - "type": "[[[[UInt32]]]]" - }, - "kind": 34, - "name": "crazyArray", - "type": "[[[[UInt32]]]]" - }, - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "AnotherType" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[AnotherType]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[AnotherType]" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "CustomEnum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "CustomEnum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "CustomEnum" - }, - "kind": 34, - "name": "optEnum", - "type": "CustomEnum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "CustomEnum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "CustomEnum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[CustomEnum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[CustomEnum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "CustomEnum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "CustomEnum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[CustomEnum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[CustomEnum]" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "map", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "map", - "required": true, - "scalar": { - "kind": 4, - "name": "map", - "required": true, - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "map", - "required": true, - "type": "Int" - } - }, - "name": "map", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "array": { - "item": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "kind": 18, - "name": "mapOfArr", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "type": "[Int]" - }, - "key": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfArr", - "required": true, - "type": "Map", - "value": { - "item": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "kind": 18, - "name": "mapOfArr", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "type": "[Int]" - } - }, - "name": "mapOfArr", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "mapOfObj", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfObj", - "object": { - "kind": 8192, - "name": "mapOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "Map", - "value": { - "kind": 8192, - "name": "mapOfObj", - "required": true, - "type": "AnotherType" - } - }, - "name": "mapOfObj", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "array": { - "item": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "mapOfArrOfObj", - "object": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "key": { - "kind": 4, - "name": "mapOfArrOfObj", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfArrOfObj", - "required": true, - "type": "Map", - "value": { - "item": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "mapOfArrOfObj", - "object": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - } - }, - "name": "mapOfArrOfObj", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "mapCustomValue", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapCustomValue", - "object": { - "kind": 8192, - "name": "mapCustomValue", - "type": "CustomMapValue" - }, - "required": true, - "type": "Map", - "value": { - "kind": 8192, - "name": "mapCustomValue", - "type": "CustomMapValue" - } - }, - "name": "mapCustomValue", - "required": true, - "type": "Map" - } - ], - "type": "CustomType" - }, - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "prop", - "scalar": { - "kind": 4, - "name": "prop", - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "circular", - "object": { - "kind": 8192, - "name": "circular", - "type": "CustomType" - }, - "type": "CustomType" - }, - { - "kind": 34, - "name": "const", - "scalar": { - "kind": 4, - "name": "const", - "type": "String" - }, - "type": "String" - } - ], - "type": "AnotherType" - }, - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "foo", - "required": true, - "scalar": { - "kind": 4, - "name": "foo", - "required": true, - "type": "String" - }, - "type": "String" - } - ], - "type": "CustomMapValue" - }, - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "else", - "required": true, - "scalar": { - "kind": 4, - "name": "else", - "required": true, - "type": "String" - }, - "type": "String" - } - ], - "type": "else" - } - ], - "version": "0.1" -})).unwrap() - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-ts/index.ts b/packages/test-cases/cases/bind/sanity/output/plugin-ts/index.ts deleted file mode 100644 index 4f5ca809d5..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-ts/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// NOTE: This is an auto-generated file. -/// All modifications will be overwritten. - -export * from "./wrap.info"; -export * from "./module"; -export * from "./types"; - -export { CoreClient } from "@polywrap/core-js"; diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-ts/module.ts b/packages/test-cases/cases/bind/sanity/output/plugin-ts/module.ts deleted file mode 100644 index 96d6faf2fb..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-ts/module.ts +++ /dev/null @@ -1,67 +0,0 @@ -/// NOTE: This is an auto-generated file. -/// All modifications will be overwritten. - -// @ts-ignore -import * as Types from "./types"; - -// @ts-ignore -import { CoreClient, MaybeAsync } from "@polywrap/core-js"; -import { PluginModule } from "@polywrap/plugin-js"; - -export interface Args_moduleMethod { - str: Types.String; - optStr?: Types.String | null; - en: Types.CustomEnum; - optEnum?: Types.CustomEnum | null; - enumArray: Array; - optEnumArray?: Array | null; - map: Map; - mapOfArr: Map>; - mapOfMap: Map>; - mapOfObj: Map; - mapOfArrOfObj: Map>; -} - -export interface Args_objectMethod { - object: Types.AnotherType; - optObject?: Types.AnotherType | null; - objectArray: Array; - optObjectArray?: Array | null; -} - -export interface Args_optionalEnvMethod { - object: Types.AnotherType; - optObject?: Types.AnotherType | null; - objectArray: Array; - optObjectArray?: Array | null; -} - -export interface Args_if { - if: Types._else; -} - -export abstract class Module extends PluginModule { - abstract moduleMethod( - args: Args_moduleMethod, - client: CoreClient, - env?: null - ): MaybeAsync; - - abstract objectMethod( - args: Args_objectMethod, - client: CoreClient, - env: Types.Env - ): MaybeAsync; - - abstract optionalEnvMethod( - args: Args_optionalEnvMethod, - client: CoreClient, - env?: Types.Env | null - ): MaybeAsync; - - abstract if( - args: Args_if, - client: CoreClient, - env?: null - ): MaybeAsync; -} diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts b/packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts deleted file mode 100644 index 428ddf9e92..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-ts/types.ts +++ /dev/null @@ -1,257 +0,0 @@ -/// NOTE: This is an auto-generated file. -/// All modifications will be overwritten. - -// @ts-ignore -import * as Types from "./"; - -// @ts-ignore -import { - CoreClient, - Result, - InvokeResult, - Uri, -} from "@polywrap/core-js"; - -export type UInt = number; -export type UInt8 = number; -export type UInt16 = number; -export type UInt32 = number; -export type Int = number; -export type Int8 = number; -export type Int16 = number; -export type Int32 = number; -export type Bytes = Uint8Array; -export type BigInt = string; -export type BigNumber = string; -export type Json = string; -export type String = string; -export type Boolean = boolean; - -/// Env START /// -export interface Env extends Record { - prop: Types.String; - optProp?: Types.String | null; - optMap?: Map | null; -} -/// Env END /// - -/// Objects START /// -export interface CustomType { - str: Types.String; - optStr?: Types.String | null; - u: Types.UInt; - optU?: Types.UInt | null; - u8: Types.UInt8; - u16: Types.UInt16; - u32: Types.UInt32; - i: Types.Int; - i8: Types.Int8; - i16: Types.Int16; - i32: Types.Int32; - bigint: Types.BigInt; - optBigint?: Types.BigInt | null; - bignumber: Types.BigNumber; - optBignumber?: Types.BigNumber | null; - json: Types.Json; - optJson?: Types.Json | null; - bytes: Types.Bytes; - optBytes?: Types.Bytes | null; - boolean: Types.Boolean; - optBoolean?: Types.Boolean | null; - u_array: Array; - uOpt_array?: Array | null; - _opt_uOptArray?: Array | null; - optStrOptArray?: Array | null; - uArrayArray: Array>; - uOptArrayOptArray: Array | null>; - uArrayOptArrayArray: Array> | null>; - crazyArray?: Array | null>> | null> | null; - object: Types.AnotherType; - optObject?: Types.AnotherType | null; - objectArray: Array; - optObjectArray?: Array | null; - en: Types.CustomEnum; - optEnum?: Types.CustomEnum | null; - enumArray: Array; - optEnumArray?: Array | null; - map: Map; - mapOfArr: Map>; - mapOfObj: Map; - mapOfArrOfObj: Map>; - mapCustomValue: Map; -} - -export interface AnotherType { - prop?: Types.String | null; - circular?: Types.CustomType | null; - const?: Types.String | null; -} - -export interface CustomMapValue { - foo: Types.String; -} - -export interface _else { - else: Types.String; -} - -/// Objects END /// - -/// Enums START /// -export enum CustomEnumEnum { - STRING, - BYTES, -} - -export type CustomEnumString = - | "STRING" - | "BYTES" - -export type CustomEnum = CustomEnumEnum | CustomEnumString; - -export enum whileEnum { - for, - in, -} - -export type whileString = - | "for" - | "in" - -export type _while = whileEnum | whileString; - -/// Enums END /// - -/// Imported Objects START /// - -/* URI: "testimport.uri.eth" */ -export interface TestImport_Object { - object: Types.TestImport_AnotherObject; - optObject?: Types.TestImport_AnotherObject | null; - objectArray: Array; - optObjectArray?: Array | null; - en: Types.TestImport_Enum; - optEnum?: Types.TestImport_Enum | null; - enumArray: Array; - optEnumArray?: Array | null; -} - -/* URI: "testimport.uri.eth" */ -export interface TestImport_AnotherObject { - prop: Types.String; -} - -/* URI: "testimport.uri.eth" */ -export enum TestImport_EnumEnum { - STRING, - BYTES, -} - -export type TestImport_EnumString = - | "STRING" - | "BYTES" - -export type TestImport_Enum = TestImport_EnumEnum | TestImport_EnumString; - -/* URI: "testimport.uri.eth" */ -export enum TestImport_Enum_ReturnEnum { - STRING, - BYTES, -} - -export type TestImport_Enum_ReturnString = - | "STRING" - | "BYTES" - -export type TestImport_Enum_Return = TestImport_Enum_ReturnEnum | TestImport_Enum_ReturnString; - -/// Imported Objects END /// - -/// Imported Modules START /// - -/* URI: "testimport.uri.eth" */ -export interface TestImport_Module_Args_importedMethod { - str: Types.String; - optStr?: Types.String | null; - u: Types.UInt; - optU?: Types.UInt | null; - uArrayArray: Array | null>; - object: Types.TestImport_Object; - optObject?: Types.TestImport_Object | null; - objectArray: Array; - optObjectArray?: Array | null; - en: Types.TestImport_Enum; - optEnum?: Types.TestImport_Enum | null; - enumArray: Array; - optEnumArray?: Array | null; -} - -/* URI: "testimport.uri.eth" */ -export interface TestImport_Module_Args_anotherMethod { - arg: Array; -} - -/* URI: "testimport.uri.eth" */ -export interface TestImport_Module_Args_returnsArrayOfEnums { - arg: Types.String; -} - -/* URI: "testimport.uri.eth" */ -export class TestImport_Module { - public static interfaceUri: string = "testimport.uri.eth"; - public uri: Uri; - - constructor(uri: string) { - this.uri = Uri.from(uri); - } - - public async importedMethod( - args: TestImport_Module_Args_importedMethod, - client: CoreClient - ): Promise> { - return client.invoke({ - uri: this.uri, - method: "importedMethod", - args: (args as unknown) as Record, - }); - } - - public async anotherMethod( - args: TestImport_Module_Args_anotherMethod, - client: CoreClient - ): Promise> { - return client.invoke({ - uri: this.uri, - method: "anotherMethod", - args: (args as unknown) as Record, - }); - } - - public async returnsArrayOfEnums( - args: TestImport_Module_Args_returnsArrayOfEnums, - client: CoreClient - ): Promise>> { - return client.invoke>({ - uri: this.uri, - method: "returnsArrayOfEnums", - args: (args as unknown) as Record, - }); - } -} - -/// Imported Modules END /// - -export class TestImport { - static uri: Uri = Uri.from("testimport.uri.eth"); - - public static async getImplementations( - client: CoreClient - ): Promise> { - const impls = await client.getImplementations(this.uri, {}); - if (!impls.ok) { - return { ok: false, error: impls.error}; - } - - return { ok: true, value: impls.value.map((impl) => (impl.uri))}; - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-ts/wrap.info.ts b/packages/test-cases/cases/bind/sanity/output/plugin-ts/wrap.info.ts deleted file mode 100644 index 559110bb09..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-ts/wrap.info.ts +++ /dev/null @@ -1,2433 +0,0 @@ -/// NOTE: This is an auto-generated file. -/// All modifications will be overwritten. -import { WrapManifest } from "@polywrap/wrap-manifest-types-js" - -export const manifest: WrapManifest = { - name: "Test", - type: "plugin", - version: "0.1", - abi: { - "enumTypes": [ - { - "constants": [ - "STRING", - "BYTES" - ], - "kind": 8, - "type": "CustomEnum" - }, - { - "constants": [ - "for", - "in" - ], - "kind": 8, - "type": "while" - } - ], - "envType": { - "kind": 65536, - "properties": [ - { - "kind": 34, - "name": "prop", - "required": true, - "scalar": { - "kind": 4, - "name": "prop", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "optProp", - "scalar": { - "kind": 4, - "name": "optProp", - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "optMap", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "optMap", - "scalar": { - "kind": 4, - "name": "optMap", - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "optMap", - "type": "Int" - } - }, - "name": "optMap", - "type": "Map" - } - ], - "type": "Env" - }, - "importedEnumTypes": [ - { - "constants": [ - "STRING", - "BYTES" - ], - "kind": 520, - "namespace": "TestImport", - "nativeType": "Enum", - "type": "TestImport_Enum", - "uri": "testimport.uri.eth" - }, - { - "constants": [ - "STRING", - "BYTES" - ], - "kind": 520, - "namespace": "TestImport", - "nativeType": "Enum", - "type": "TestImport_Enum_Return", - "uri": "testimport.uri.eth" - } - ], - "importedEnvTypes": [ - { - "kind": 524288, - "namespace": "TestImport", - "nativeType": "Env", - "properties": [ - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "TestImport_AnotherObject" - }, - "required": true, - "type": "TestImport_AnotherObject" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "TestImport_AnotherObject" - }, - "type": "TestImport_AnotherObject" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_AnotherObject" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_AnotherObject" - }, - "required": true, - "type": "[TestImport_AnotherObject]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[TestImport_AnotherObject]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_AnotherObject" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_AnotherObject" - }, - "type": "[TestImport_AnotherObject]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[TestImport_AnotherObject]" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "optEnum", - "type": "TestImport_Enum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - } - ], - "type": "TestImport_Env", - "uri": "testimport.uri.eth" - } - ], - "importedModuleTypes": [ - { - "isInterface": true, - "kind": 256, - "methods": [ - { - "arguments": [ - { - "kind": 34, - "name": "str", - "required": true, - "scalar": { - "kind": 4, - "name": "str", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "optStr", - "scalar": { - "kind": 4, - "name": "optStr", - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "u", - "required": true, - "scalar": { - "kind": 4, - "name": "u", - "required": true, - "type": "UInt" - }, - "type": "UInt" - }, - { - "kind": 34, - "name": "optU", - "scalar": { - "kind": 4, - "name": "optU", - "type": "UInt" - }, - "type": "UInt" - }, - { - "array": { - "array": { - "item": { - "kind": 4, - "name": "uArrayArray", - "type": "UInt" - }, - "kind": 18, - "name": "uArrayArray", - "scalar": { - "kind": 4, - "name": "uArrayArray", - "type": "UInt" - }, - "type": "[UInt]" - }, - "item": { - "item": { - "kind": 4, - "name": "uArrayArray", - "type": "UInt" - }, - "kind": 18, - "name": "uArrayArray", - "scalar": { - "kind": 4, - "name": "uArrayArray", - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 18, - "name": "uArrayArray", - "required": true, - "type": "[[UInt]]" - }, - "kind": 34, - "name": "uArrayArray", - "required": true, - "type": "[[UInt]]" - }, - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "TestImport_Object" - }, - "required": true, - "type": "TestImport_Object" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "TestImport_Object" - }, - "type": "TestImport_Object" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_Object" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_Object" - }, - "required": true, - "type": "[TestImport_Object]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[TestImport_Object]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_Object" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_Object" - }, - "type": "[TestImport_Object]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[TestImport_Object]" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "optEnum", - "type": "TestImport_Enum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - } - ], - "env": { - "required": true - }, - "kind": 64, - "name": "importedMethod", - "required": true, - "return": { - "kind": 34, - "name": "importedMethod", - "object": { - "kind": 8192, - "name": "importedMethod", - "type": "TestImport_Object" - }, - "type": "TestImport_Object" - }, - "type": "Method" - }, - { - "arguments": [ - { - "array": { - "item": { - "kind": 4, - "name": "arg", - "required": true, - "type": "String" - }, - "kind": 18, - "name": "arg", - "required": true, - "scalar": { - "kind": 4, - "name": "arg", - "required": true, - "type": "String" - }, - "type": "[String]" - }, - "kind": 34, - "name": "arg", - "required": true, - "type": "[String]" - } - ], - "kind": 64, - "name": "anotherMethod", - "required": true, - "return": { - "kind": 34, - "name": "anotherMethod", - "required": true, - "scalar": { - "kind": 4, - "name": "anotherMethod", - "required": true, - "type": "Int32" - }, - "type": "Int32" - }, - "type": "Method" - }, - { - "arguments": [ - { - "kind": 34, - "name": "arg", - "required": true, - "scalar": { - "kind": 4, - "name": "arg", - "required": true, - "type": "String" - }, - "type": "String" - } - ], - "kind": 64, - "name": "returnsArrayOfEnums", - "required": true, - "return": { - "array": { - "enum": { - "kind": 16384, - "name": "returnsArrayOfEnums", - "type": "TestImport_Enum_Return" - }, - "item": { - "kind": 16384, - "name": "returnsArrayOfEnums", - "type": "TestImport_Enum_Return" - }, - "kind": 18, - "name": "returnsArrayOfEnums", - "required": true, - "type": "[TestImport_Enum_Return]" - }, - "kind": 34, - "name": "returnsArrayOfEnums", - "required": true, - "type": "[TestImport_Enum_Return]" - }, - "type": "Method" - } - ], - "namespace": "TestImport", - "nativeType": "Module", - "type": "TestImport_Module", - "uri": "testimport.uri.eth" - } - ], - "importedObjectTypes": [ - { - "kind": 1025, - "namespace": "TestImport", - "nativeType": "Object", - "properties": [ - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "TestImport_AnotherObject" - }, - "required": true, - "type": "TestImport_AnotherObject" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "TestImport_AnotherObject" - }, - "type": "TestImport_AnotherObject" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_AnotherObject" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_AnotherObject" - }, - "required": true, - "type": "[TestImport_AnotherObject]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[TestImport_AnotherObject]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_AnotherObject" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_AnotherObject" - }, - "type": "[TestImport_AnotherObject]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[TestImport_AnotherObject]" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "optEnum", - "type": "TestImport_Enum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - } - ], - "type": "TestImport_Object", - "uri": "testimport.uri.eth" - }, - { - "kind": 1025, - "namespace": "TestImport", - "nativeType": "AnotherObject", - "properties": [ - { - "kind": 34, - "name": "prop", - "required": true, - "scalar": { - "kind": 4, - "name": "prop", - "required": true, - "type": "String" - }, - "type": "String" - } - ], - "type": "TestImport_AnotherObject", - "uri": "testimport.uri.eth" - } - ], - "interfaceTypes": [ - { - "capabilities": { - "getImplementations": { - "enabled": true - } - }, - "kind": 32768, - "namespace": "TestImport", - "nativeType": "Interface", - "type": "TestImport", - "uri": "testimport.uri.eth" - } - ], - "moduleType": { - "imports": [ - { - "type": "TestImport_Module" - }, - { - "type": "TestImport_Object" - }, - { - "type": "TestImport_AnotherObject" - }, - { - "type": "TestImport_Enum" - }, - { - "type": "TestImport_Enum_Return" - } - ], - "kind": 128, - "methods": [ - { - "arguments": [ - { - "kind": 34, - "name": "str", - "required": true, - "scalar": { - "kind": 4, - "name": "str", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "optStr", - "scalar": { - "kind": 4, - "name": "optStr", - "type": "String" - }, - "type": "String" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "CustomEnum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "CustomEnum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "CustomEnum" - }, - "kind": 34, - "name": "optEnum", - "type": "CustomEnum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "CustomEnum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "CustomEnum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[CustomEnum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[CustomEnum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "CustomEnum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "CustomEnum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[CustomEnum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[CustomEnum]" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "map", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "map", - "required": true, - "scalar": { - "kind": 4, - "name": "map", - "required": true, - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "map", - "required": true, - "type": "Int" - } - }, - "name": "map", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "array": { - "item": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "kind": 18, - "name": "mapOfArr", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "type": "[Int]" - }, - "key": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfArr", - "required": true, - "type": "Map", - "value": { - "item": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "kind": 18, - "name": "mapOfArr", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "type": "[Int]" - } - }, - "name": "mapOfArr", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "String" - }, - "kind": 262146, - "map": { - "key": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfMap", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "Int" - } - }, - "name": "mapOfMap", - "required": true, - "type": "Map>", - "value": { - "key": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfMap", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "Int" - } - } - }, - "name": "mapOfMap", - "required": true, - "type": "Map>" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "mapOfObj", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfObj", - "object": { - "kind": 8192, - "name": "mapOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "Map", - "value": { - "kind": 8192, - "name": "mapOfObj", - "required": true, - "type": "AnotherType" - } - }, - "name": "mapOfObj", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "array": { - "item": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "mapOfArrOfObj", - "object": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "key": { - "kind": 4, - "name": "mapOfArrOfObj", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfArrOfObj", - "required": true, - "type": "Map", - "value": { - "item": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "mapOfArrOfObj", - "object": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - } - }, - "name": "mapOfArrOfObj", - "required": true, - "type": "Map" - } - ], - "kind": 64, - "name": "moduleMethod", - "required": true, - "return": { - "kind": 34, - "name": "moduleMethod", - "required": true, - "scalar": { - "kind": 4, - "name": "moduleMethod", - "required": true, - "type": "Int" - }, - "type": "Int" - }, - "type": "Method" - }, - { - "arguments": [ - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "AnotherType" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[AnotherType]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[AnotherType]" - } - ], - "env": { - "required": true - }, - "kind": 64, - "name": "objectMethod", - "required": true, - "return": { - "kind": 34, - "name": "objectMethod", - "object": { - "kind": 8192, - "name": "objectMethod", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - "type": "Method" - }, - { - "arguments": [ - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "AnotherType" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[AnotherType]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[AnotherType]" - } - ], - "env": { - "required": false - }, - "kind": 64, - "name": "optionalEnvMethod", - "required": true, - "return": { - "kind": 34, - "name": "optionalEnvMethod", - "object": { - "kind": 8192, - "name": "optionalEnvMethod", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - "type": "Method" - }, - { - "arguments": [ - { - "kind": 34, - "name": "if", - "object": { - "kind": 8192, - "name": "if", - "required": true, - "type": "else" - }, - "required": true, - "type": "else" - } - ], - "kind": 64, - "name": "if", - "required": true, - "return": { - "kind": 34, - "name": "if", - "object": { - "kind": 8192, - "name": "if", - "required": true, - "type": "else" - }, - "required": true, - "type": "else" - }, - "type": "Method" - } - ], - "type": "Module" - }, - "objectTypes": [ - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "str", - "required": true, - "scalar": { - "kind": 4, - "name": "str", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "optStr", - "scalar": { - "kind": 4, - "name": "optStr", - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "u", - "required": true, - "scalar": { - "kind": 4, - "name": "u", - "required": true, - "type": "UInt" - }, - "type": "UInt" - }, - { - "kind": 34, - "name": "optU", - "scalar": { - "kind": 4, - "name": "optU", - "type": "UInt" - }, - "type": "UInt" - }, - { - "kind": 34, - "name": "u8", - "required": true, - "scalar": { - "kind": 4, - "name": "u8", - "required": true, - "type": "UInt8" - }, - "type": "UInt8" - }, - { - "kind": 34, - "name": "u16", - "required": true, - "scalar": { - "kind": 4, - "name": "u16", - "required": true, - "type": "UInt16" - }, - "type": "UInt16" - }, - { - "kind": 34, - "name": "u32", - "required": true, - "scalar": { - "kind": 4, - "name": "u32", - "required": true, - "type": "UInt32" - }, - "type": "UInt32" - }, - { - "kind": 34, - "name": "i", - "required": true, - "scalar": { - "kind": 4, - "name": "i", - "required": true, - "type": "Int" - }, - "type": "Int" - }, - { - "kind": 34, - "name": "i8", - "required": true, - "scalar": { - "kind": 4, - "name": "i8", - "required": true, - "type": "Int8" - }, - "type": "Int8" - }, - { - "kind": 34, - "name": "i16", - "required": true, - "scalar": { - "kind": 4, - "name": "i16", - "required": true, - "type": "Int16" - }, - "type": "Int16" - }, - { - "kind": 34, - "name": "i32", - "required": true, - "scalar": { - "kind": 4, - "name": "i32", - "required": true, - "type": "Int32" - }, - "type": "Int32" - }, - { - "kind": 34, - "name": "bigint", - "required": true, - "scalar": { - "kind": 4, - "name": "bigint", - "required": true, - "type": "BigInt" - }, - "type": "BigInt" - }, - { - "kind": 34, - "name": "optBigint", - "scalar": { - "kind": 4, - "name": "optBigint", - "type": "BigInt" - }, - "type": "BigInt" - }, - { - "kind": 34, - "name": "bignumber", - "required": true, - "scalar": { - "kind": 4, - "name": "bignumber", - "required": true, - "type": "BigNumber" - }, - "type": "BigNumber" - }, - { - "kind": 34, - "name": "optBignumber", - "scalar": { - "kind": 4, - "name": "optBignumber", - "type": "BigNumber" - }, - "type": "BigNumber" - }, - { - "kind": 34, - "name": "json", - "required": true, - "scalar": { - "kind": 4, - "name": "json", - "required": true, - "type": "JSON" - }, - "type": "JSON" - }, - { - "kind": 34, - "name": "optJson", - "scalar": { - "kind": 4, - "name": "optJson", - "type": "JSON" - }, - "type": "JSON" - }, - { - "kind": 34, - "name": "bytes", - "required": true, - "scalar": { - "kind": 4, - "name": "bytes", - "required": true, - "type": "Bytes" - }, - "type": "Bytes" - }, - { - "kind": 34, - "name": "optBytes", - "scalar": { - "kind": 4, - "name": "optBytes", - "type": "Bytes" - }, - "type": "Bytes" - }, - { - "kind": 34, - "name": "boolean", - "required": true, - "scalar": { - "kind": 4, - "name": "boolean", - "required": true, - "type": "Boolean" - }, - "type": "Boolean" - }, - { - "kind": 34, - "name": "optBoolean", - "scalar": { - "kind": 4, - "name": "optBoolean", - "type": "Boolean" - }, - "type": "Boolean" - }, - { - "array": { - "item": { - "kind": 4, - "name": "u_array", - "required": true, - "type": "UInt" - }, - "kind": 18, - "name": "u_array", - "required": true, - "scalar": { - "kind": 4, - "name": "u_array", - "required": true, - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 34, - "name": "u_array", - "required": true, - "type": "[UInt]" - }, - { - "array": { - "item": { - "kind": 4, - "name": "uOpt_array", - "required": true, - "type": "UInt" - }, - "kind": 18, - "name": "uOpt_array", - "scalar": { - "kind": 4, - "name": "uOpt_array", - "required": true, - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 34, - "name": "uOpt_array", - "type": "[UInt]" - }, - { - "array": { - "item": { - "kind": 4, - "name": "_opt_uOptArray", - "type": "UInt" - }, - "kind": 18, - "name": "_opt_uOptArray", - "scalar": { - "kind": 4, - "name": "_opt_uOptArray", - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 34, - "name": "_opt_uOptArray", - "type": "[UInt]" - }, - { - "array": { - "item": { - "kind": 4, - "name": "optStrOptArray", - "type": "String" - }, - "kind": 18, - "name": "optStrOptArray", - "scalar": { - "kind": 4, - "name": "optStrOptArray", - "type": "String" - }, - "type": "[String]" - }, - "kind": 34, - "name": "optStrOptArray", - "type": "[String]" - }, - { - "array": { - "array": { - "item": { - "kind": 4, - "name": "uArrayArray", - "required": true, - "type": "UInt" - }, - "kind": 18, - "name": "uArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayArray", - "required": true, - "type": "UInt" - }, - "type": "[UInt]" - }, - "item": { - "item": { - "kind": 4, - "name": "uArrayArray", - "required": true, - "type": "UInt" - }, - "kind": 18, - "name": "uArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayArray", - "required": true, - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 18, - "name": "uArrayArray", - "required": true, - "type": "[[UInt]]" - }, - "kind": 34, - "name": "uArrayArray", - "required": true, - "type": "[[UInt]]" - }, - { - "array": { - "array": { - "item": { - "kind": 4, - "name": "uOptArrayOptArray", - "type": "UInt32" - }, - "kind": 18, - "name": "uOptArrayOptArray", - "scalar": { - "kind": 4, - "name": "uOptArrayOptArray", - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "uOptArrayOptArray", - "type": "UInt32" - }, - "kind": 18, - "name": "uOptArrayOptArray", - "scalar": { - "kind": 4, - "name": "uOptArrayOptArray", - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "uOptArrayOptArray", - "required": true, - "type": "[[UInt32]]" - }, - "kind": 34, - "name": "uOptArrayOptArray", - "required": true, - "type": "[[UInt32]]" - }, - { - "array": { - "array": { - "array": { - "item": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "type": "[[UInt32]]" - }, - "item": { - "array": { - "item": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "type": "[[UInt32]]" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "type": "[[[UInt32]]]" - }, - "kind": 34, - "name": "uArrayOptArrayArray", - "required": true, - "type": "[[[UInt32]]]" - }, - { - "array": { - "array": { - "array": { - "array": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "crazyArray", - "required": true, - "type": "[[UInt32]]" - }, - "item": { - "array": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "crazyArray", - "required": true, - "type": "[[UInt32]]" - }, - "kind": 18, - "name": "crazyArray", - "type": "[[[UInt32]]]" - }, - "item": { - "array": { - "array": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "crazyArray", - "required": true, - "type": "[[UInt32]]" - }, - "item": { - "array": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "crazyArray", - "required": true, - "type": "[[UInt32]]" - }, - "kind": 18, - "name": "crazyArray", - "type": "[[[UInt32]]]" - }, - "kind": 18, - "name": "crazyArray", - "type": "[[[[UInt32]]]]" - }, - "kind": 34, - "name": "crazyArray", - "type": "[[[[UInt32]]]]" - }, - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "AnotherType" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[AnotherType]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[AnotherType]" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "CustomEnum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "CustomEnum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "CustomEnum" - }, - "kind": 34, - "name": "optEnum", - "type": "CustomEnum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "CustomEnum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "CustomEnum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[CustomEnum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[CustomEnum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "CustomEnum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "CustomEnum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[CustomEnum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[CustomEnum]" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "map", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "map", - "required": true, - "scalar": { - "kind": 4, - "name": "map", - "required": true, - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "map", - "required": true, - "type": "Int" - } - }, - "name": "map", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "array": { - "item": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "kind": 18, - "name": "mapOfArr", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "type": "[Int]" - }, - "key": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfArr", - "required": true, - "type": "Map", - "value": { - "item": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "kind": 18, - "name": "mapOfArr", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "type": "[Int]" - } - }, - "name": "mapOfArr", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "mapOfObj", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfObj", - "object": { - "kind": 8192, - "name": "mapOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "Map", - "value": { - "kind": 8192, - "name": "mapOfObj", - "required": true, - "type": "AnotherType" - } - }, - "name": "mapOfObj", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "array": { - "item": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "mapOfArrOfObj", - "object": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "key": { - "kind": 4, - "name": "mapOfArrOfObj", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfArrOfObj", - "required": true, - "type": "Map", - "value": { - "item": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "mapOfArrOfObj", - "object": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - } - }, - "name": "mapOfArrOfObj", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "mapCustomValue", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapCustomValue", - "object": { - "kind": 8192, - "name": "mapCustomValue", - "type": "CustomMapValue" - }, - "required": true, - "type": "Map", - "value": { - "kind": 8192, - "name": "mapCustomValue", - "type": "CustomMapValue" - } - }, - "name": "mapCustomValue", - "required": true, - "type": "Map" - } - ], - "type": "CustomType" - }, - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "prop", - "scalar": { - "kind": 4, - "name": "prop", - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "circular", - "object": { - "kind": 8192, - "name": "circular", - "type": "CustomType" - }, - "type": "CustomType" - }, - { - "kind": 34, - "name": "const", - "scalar": { - "kind": 4, - "name": "const", - "type": "String" - }, - "type": "String" - } - ], - "type": "AnotherType" - }, - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "foo", - "required": true, - "scalar": { - "kind": 4, - "name": "foo", - "required": true, - "type": "String" - }, - "type": "String" - } - ], - "type": "CustomMapValue" - }, - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "else", - "required": true, - "scalar": { - "kind": 4, - "name": "else", - "required": true, - "type": "String" - }, - "type": "String" - } - ], - "type": "else" - } - ], - "version": "0.1" -} -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/AnotherType/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/AnotherType/index.ts deleted file mode 100644 index 7d2d0c8391..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/AnotherType/index.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { - Read, - Write, - Box, - BigInt, - BigNumber, - JSON -} from "@polywrap/wasm-as"; -import { - serializeAnotherType, - deserializeAnotherType, - writeAnotherType, - readAnotherType -} from "./serialization"; -import * as Types from ".."; - -export class AnotherType { - prop: string | null; - circular: Types.CustomType | null; - _const: string | null; - - static toBuffer(type: AnotherType): ArrayBuffer { - return serializeAnotherType(type); - } - - static fromBuffer(buffer: ArrayBuffer): AnotherType { - return deserializeAnotherType(buffer); - } - - static write(writer: Write, type: AnotherType): void { - writeAnotherType(writer, type); - } - - static read(reader: Read): AnotherType { - return readAnotherType(reader); - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/AnotherType/serialization.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/AnotherType/serialization.ts deleted file mode 100644 index 9ed99bc7a3..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/AnotherType/serialization.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { - Read, - ReadDecoder, - Write, - WriteSizer, - WriteEncoder, - Box, - BigInt, - BigNumber, - JSON, - Context -} from "@polywrap/wasm-as"; -import { AnotherType } from "./"; -import * as Types from ".."; - -export function serializeAnotherType(type: AnotherType): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) object-type: AnotherType"); - const sizer = new WriteSizer(sizerContext); - writeAnotherType(sizer, type); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) object-type: AnotherType"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeAnotherType(encoder, type); - return buffer; -} - -export function writeAnotherType(writer: Write, type: AnotherType): void { - writer.writeMapLength(3); - writer.context().push("prop", "string | null", "writing property"); - writer.writeString("prop"); - writer.writeOptionalString(type.prop); - writer.context().pop(); - writer.context().push("circular", "Types.CustomType | null", "writing property"); - writer.writeString("circular"); - if (type.circular) { - Types.CustomType.write(writer, type.circular as Types.CustomType); - } else { - writer.writeNil(); - } - writer.context().pop(); - writer.context().push("const", "string | null", "writing property"); - writer.writeString("const"); - writer.writeOptionalString(type._const); - writer.context().pop(); -} - -export function deserializeAnotherType(buffer: ArrayBuffer): AnotherType { - const context: Context = new Context("Deserializing object-type AnotherType"); - const reader = new ReadDecoder(buffer, context); - return readAnotherType(reader); -} - -export function readAnotherType(reader: Read): AnotherType { - let numFields = reader.readMapLength(); - - let _prop: string | null = null; - let _circular: Types.CustomType | null = null; - let _const: string | null = null; - - while (numFields > 0) { - numFields--; - const field = reader.readString(); - - reader.context().push(field, "unknown", "searching for property type"); - if (field == "prop") { - reader.context().push(field, "string | null", "type found, reading property"); - _prop = reader.readOptionalString(); - reader.context().pop(); - } - else if (field == "circular") { - reader.context().push(field, "Types.CustomType | null", "type found, reading property"); - let object: Types.CustomType | null = null; - if (!reader.isNextNil()) { - object = Types.CustomType.read(reader); - } - _circular = object; - reader.context().pop(); - } - else if (field == "const") { - reader.context().push(field, "string | null", "type found, reading property"); - _const = reader.readOptionalString(); - reader.context().pop(); - } - reader.context().pop(); - } - - - return { - prop: _prop, - circular: _circular, - _const: _const - }; -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/CustomEnum/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/CustomEnum/index.ts deleted file mode 100644 index 27c57a440b..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/CustomEnum/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -export enum CustomEnum { - STRING, - BYTES, - _MAX_ -} - -export function sanitizeCustomEnumValue(value: i32): void { - const valid = value >= 0 && value < CustomEnum._MAX_; - if (!valid) { - throw new Error("Invalid value for enum 'CustomEnum': " + value.toString()); - } -} - -export function getCustomEnumValue(key: string): CustomEnum { - if (key == "STRING") { - return CustomEnum.STRING; - } - if (key == "BYTES") { - return CustomEnum.BYTES; - } - - throw new Error("Invalid key for enum 'CustomEnum': " + key); -} - -export function getCustomEnumKey(value: CustomEnum): string { - sanitizeCustomEnumValue(value); - - switch (value) { - case CustomEnum.STRING: return "STRING"; - case CustomEnum.BYTES: return "BYTES"; - default: - throw new Error("Invalid value for enum 'CustomEnum': " + value.toString()); - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/CustomMapValue/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/CustomMapValue/index.ts deleted file mode 100644 index 4162a95785..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/CustomMapValue/index.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { - Read, - Write, - Box, - BigInt, - BigNumber, - JSON -} from "@polywrap/wasm-as"; -import { - serializeCustomMapValue, - deserializeCustomMapValue, - writeCustomMapValue, - readCustomMapValue -} from "./serialization"; -import * as Types from ".."; - -export class CustomMapValue { - foo: string; - - static toBuffer(type: CustomMapValue): ArrayBuffer { - return serializeCustomMapValue(type); - } - - static fromBuffer(buffer: ArrayBuffer): CustomMapValue { - return deserializeCustomMapValue(buffer); - } - - static write(writer: Write, type: CustomMapValue): void { - writeCustomMapValue(writer, type); - } - - static read(reader: Read): CustomMapValue { - return readCustomMapValue(reader); - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/CustomMapValue/serialization.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/CustomMapValue/serialization.ts deleted file mode 100644 index d3f1ee9fb8..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/CustomMapValue/serialization.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { - Read, - ReadDecoder, - Write, - WriteSizer, - WriteEncoder, - Box, - BigInt, - BigNumber, - JSON, - Context -} from "@polywrap/wasm-as"; -import { CustomMapValue } from "./"; -import * as Types from ".."; - -export function serializeCustomMapValue(type: CustomMapValue): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) object-type: CustomMapValue"); - const sizer = new WriteSizer(sizerContext); - writeCustomMapValue(sizer, type); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) object-type: CustomMapValue"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeCustomMapValue(encoder, type); - return buffer; -} - -export function writeCustomMapValue(writer: Write, type: CustomMapValue): void { - writer.writeMapLength(1); - writer.context().push("foo", "string", "writing property"); - writer.writeString("foo"); - writer.writeString(type.foo); - writer.context().pop(); -} - -export function deserializeCustomMapValue(buffer: ArrayBuffer): CustomMapValue { - const context: Context = new Context("Deserializing object-type CustomMapValue"); - const reader = new ReadDecoder(buffer, context); - return readCustomMapValue(reader); -} - -export function readCustomMapValue(reader: Read): CustomMapValue { - let numFields = reader.readMapLength(); - - let _foo: string = ""; - let _fooSet: bool = false; - - while (numFields > 0) { - numFields--; - const field = reader.readString(); - - reader.context().push(field, "unknown", "searching for property type"); - if (field == "foo") { - reader.context().push(field, "string", "type found, reading property"); - _foo = reader.readString(); - _fooSet = true; - reader.context().pop(); - } - reader.context().pop(); - } - - if (!_fooSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'foo: String'")); - } - - return { - foo: _foo - }; -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/CustomType/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/CustomType/index.ts deleted file mode 100644 index 3a0d39079e..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/CustomType/index.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { - Read, - Write, - Box, - BigInt, - BigNumber, - JSON -} from "@polywrap/wasm-as"; -import { - serializeCustomType, - deserializeCustomType, - writeCustomType, - readCustomType -} from "./serialization"; -import * as Types from ".."; - -export class CustomType { - str: string; - optStr: string | null; - u: u32; - optU: Box | null; - _u8: u8; - _u16: u16; - _u32: u32; - i: i32; - _i8: i8; - _i16: i16; - _i32: i32; - bigint: BigInt; - optBigint: BigInt | null; - bignumber: BigNumber; - optBignumber: BigNumber | null; - json: JSON.Value; - optJson: JSON.Value | null; - bytes: ArrayBuffer; - optBytes: ArrayBuffer | null; - _boolean: bool; - optBoolean: Box | null; - u_array: Array; - uOpt_array: Array | null; - _opt_uOptArray: Array | null> | null; - optStrOptArray: Array | null; - uArrayArray: Array>; - uOptArrayOptArray: Array | null> | null>; - uArrayOptArrayArray: Array> | null>; - crazyArray: Array | null>> | null> | null; - object: Types.AnotherType; - optObject: Types.AnotherType | null; - objectArray: Array; - optObjectArray: Array | null; - en: Types.CustomEnum; - optEnum: Box | null; - enumArray: Array; - optEnumArray: Array | null> | null; - map: Map; - mapOfArr: Map>; - mapOfObj: Map; - mapOfArrOfObj: Map>; - mapCustomValue: Map; - - static toBuffer(type: CustomType): ArrayBuffer { - return serializeCustomType(type); - } - - static fromBuffer(buffer: ArrayBuffer): CustomType { - return deserializeCustomType(buffer); - } - - static write(writer: Write, type: CustomType): void { - writeCustomType(writer, type); - } - - static read(reader: Read): CustomType { - return readCustomType(reader); - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/CustomType/serialization.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/CustomType/serialization.ts deleted file mode 100644 index fa047d5f7d..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/CustomType/serialization.ts +++ /dev/null @@ -1,845 +0,0 @@ -import { - Read, - ReadDecoder, - Write, - WriteSizer, - WriteEncoder, - Box, - BigInt, - BigNumber, - JSON, - Context -} from "@polywrap/wasm-as"; -import { CustomType } from "./"; -import * as Types from ".."; - -export function serializeCustomType(type: CustomType): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) object-type: CustomType"); - const sizer = new WriteSizer(sizerContext); - writeCustomType(sizer, type); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) object-type: CustomType"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeCustomType(encoder, type); - return buffer; -} - -export function writeCustomType(writer: Write, type: CustomType): void { - writer.writeMapLength(42); - writer.context().push("str", "string", "writing property"); - writer.writeString("str"); - writer.writeString(type.str); - writer.context().pop(); - writer.context().push("optStr", "string | null", "writing property"); - writer.writeString("optStr"); - writer.writeOptionalString(type.optStr); - writer.context().pop(); - writer.context().push("u", "u32", "writing property"); - writer.writeString("u"); - writer.writeUInt32(type.u); - writer.context().pop(); - writer.context().push("optU", "Box | null", "writing property"); - writer.writeString("optU"); - writer.writeOptionalUInt32(type.optU); - writer.context().pop(); - writer.context().push("u8", "u8", "writing property"); - writer.writeString("u8"); - writer.writeUInt8(type._u8); - writer.context().pop(); - writer.context().push("u16", "u16", "writing property"); - writer.writeString("u16"); - writer.writeUInt16(type._u16); - writer.context().pop(); - writer.context().push("u32", "u32", "writing property"); - writer.writeString("u32"); - writer.writeUInt32(type._u32); - writer.context().pop(); - writer.context().push("i", "i32", "writing property"); - writer.writeString("i"); - writer.writeInt32(type.i); - writer.context().pop(); - writer.context().push("i8", "i8", "writing property"); - writer.writeString("i8"); - writer.writeInt8(type._i8); - writer.context().pop(); - writer.context().push("i16", "i16", "writing property"); - writer.writeString("i16"); - writer.writeInt16(type._i16); - writer.context().pop(); - writer.context().push("i32", "i32", "writing property"); - writer.writeString("i32"); - writer.writeInt32(type._i32); - writer.context().pop(); - writer.context().push("bigint", "BigInt", "writing property"); - writer.writeString("bigint"); - writer.writeBigInt(type.bigint); - writer.context().pop(); - writer.context().push("optBigint", "BigInt | null", "writing property"); - writer.writeString("optBigint"); - writer.writeOptionalBigInt(type.optBigint); - writer.context().pop(); - writer.context().push("bignumber", "BigNumber", "writing property"); - writer.writeString("bignumber"); - writer.writeBigNumber(type.bignumber); - writer.context().pop(); - writer.context().push("optBignumber", "BigNumber | null", "writing property"); - writer.writeString("optBignumber"); - writer.writeOptionalBigNumber(type.optBignumber); - writer.context().pop(); - writer.context().push("json", "JSON.Value", "writing property"); - writer.writeString("json"); - writer.writeJSON(type.json); - writer.context().pop(); - writer.context().push("optJson", "JSON.Value | null", "writing property"); - writer.writeString("optJson"); - writer.writeOptionalJSON(type.optJson); - writer.context().pop(); - writer.context().push("bytes", "ArrayBuffer", "writing property"); - writer.writeString("bytes"); - writer.writeBytes(type.bytes); - writer.context().pop(); - writer.context().push("optBytes", "ArrayBuffer | null", "writing property"); - writer.writeString("optBytes"); - writer.writeOptionalBytes(type.optBytes); - writer.context().pop(); - writer.context().push("boolean", "bool", "writing property"); - writer.writeString("boolean"); - writer.writeBool(type._boolean); - writer.context().pop(); - writer.context().push("optBoolean", "Box | null", "writing property"); - writer.writeString("optBoolean"); - writer.writeOptionalBool(type.optBoolean); - writer.context().pop(); - writer.context().push("u_array", "Array", "writing property"); - writer.writeString("u_array"); - writer.writeArray(type.u_array, (writer: Write, item: u32): void => { - writer.writeUInt32(item); - }); - writer.context().pop(); - writer.context().push("uOpt_array", "Array | null", "writing property"); - writer.writeString("uOpt_array"); - writer.writeOptionalArray(type.uOpt_array, (writer: Write, item: u32): void => { - writer.writeUInt32(item); - }); - writer.context().pop(); - writer.context().push("_opt_uOptArray", "Array | null> | null", "writing property"); - writer.writeString("_opt_uOptArray"); - writer.writeOptionalArray(type._opt_uOptArray, (writer: Write, item: Box | null): void => { - writer.writeOptionalUInt32(item); - }); - writer.context().pop(); - writer.context().push("optStrOptArray", "Array | null", "writing property"); - writer.writeString("optStrOptArray"); - writer.writeOptionalArray(type.optStrOptArray, (writer: Write, item: string | null): void => { - writer.writeOptionalString(item); - }); - writer.context().pop(); - writer.context().push("uArrayArray", "Array>", "writing property"); - writer.writeString("uArrayArray"); - writer.writeArray(type.uArrayArray, (writer: Write, item: Array): void => { - writer.writeArray(item, (writer: Write, item: u32): void => { - writer.writeUInt32(item); - }); - }); - writer.context().pop(); - writer.context().push("uOptArrayOptArray", "Array | null> | null>", "writing property"); - writer.writeString("uOptArrayOptArray"); - writer.writeArray(type.uOptArrayOptArray, (writer: Write, item: Array | null> | null): void => { - writer.writeOptionalArray(item, (writer: Write, item: Box | null): void => { - writer.writeOptionalUInt32(item); - }); - }); - writer.context().pop(); - writer.context().push("uArrayOptArrayArray", "Array> | null>", "writing property"); - writer.writeString("uArrayOptArrayArray"); - writer.writeArray(type.uArrayOptArrayArray, (writer: Write, item: Array> | null): void => { - writer.writeOptionalArray(item, (writer: Write, item: Array): void => { - writer.writeArray(item, (writer: Write, item: u32): void => { - writer.writeUInt32(item); - }); - }); - }); - writer.context().pop(); - writer.context().push("crazyArray", "Array | null>> | null> | null", "writing property"); - writer.writeString("crazyArray"); - writer.writeOptionalArray(type.crazyArray, (writer: Write, item: Array | null>> | null): void => { - writer.writeOptionalArray(item, (writer: Write, item: Array | null>): void => { - writer.writeArray(item, (writer: Write, item: Array | null): void => { - writer.writeOptionalArray(item, (writer: Write, item: u32): void => { - writer.writeUInt32(item); - }); - }); - }); - }); - writer.context().pop(); - writer.context().push("object", "Types.AnotherType", "writing property"); - writer.writeString("object"); - Types.AnotherType.write(writer, type.object); - writer.context().pop(); - writer.context().push("optObject", "Types.AnotherType | null", "writing property"); - writer.writeString("optObject"); - if (type.optObject) { - Types.AnotherType.write(writer, type.optObject as Types.AnotherType); - } else { - writer.writeNil(); - } - writer.context().pop(); - writer.context().push("objectArray", "Array", "writing property"); - writer.writeString("objectArray"); - writer.writeArray(type.objectArray, (writer: Write, item: Types.AnotherType): void => { - Types.AnotherType.write(writer, item); - }); - writer.context().pop(); - writer.context().push("optObjectArray", "Array | null", "writing property"); - writer.writeString("optObjectArray"); - writer.writeOptionalArray(type.optObjectArray, (writer: Write, item: Types.AnotherType | null): void => { - if (item) { - Types.AnotherType.write(writer, item as Types.AnotherType); - } else { - writer.writeNil(); - } - }); - writer.context().pop(); - writer.context().push("en", "Types.CustomEnum", "writing property"); - writer.writeString("en"); - writer.writeInt32(type.en); - writer.context().pop(); - writer.context().push("optEnum", "Box | null", "writing property"); - writer.writeString("optEnum"); - writer.writeOptionalInt32(type.optEnum); - writer.context().pop(); - writer.context().push("enumArray", "Array", "writing property"); - writer.writeString("enumArray"); - writer.writeArray(type.enumArray, (writer: Write, item: Types.CustomEnum): void => { - writer.writeInt32(item); - }); - writer.context().pop(); - writer.context().push("optEnumArray", "Array | null> | null", "writing property"); - writer.writeString("optEnumArray"); - writer.writeOptionalArray(type.optEnumArray, (writer: Write, item: Box | null): void => { - writer.writeOptionalInt32(item); - }); - writer.context().pop(); - writer.context().push("map", "Map", "writing property"); - writer.writeString("map"); - writer.writeExtGenericMap(type.map, (writer: Write, key: string) => { - writer.writeString(key); - }, (writer: Write, value: i32): void => { - writer.writeInt32(value); - }); - writer.context().pop(); - writer.context().push("mapOfArr", "Map>", "writing property"); - writer.writeString("mapOfArr"); - writer.writeExtGenericMap(type.mapOfArr, (writer: Write, key: string) => { - writer.writeString(key); - }, (writer: Write, value: Array): void => { - writer.writeArray(value, (writer: Write, item: i32): void => { - writer.writeInt32(item); - }); - }); - writer.context().pop(); - writer.context().push("mapOfObj", "Map", "writing property"); - writer.writeString("mapOfObj"); - writer.writeExtGenericMap(type.mapOfObj, (writer: Write, key: string) => { - writer.writeString(key); - }, (writer: Write, value: Types.AnotherType): void => { - Types.AnotherType.write(writer, value); - }); - writer.context().pop(); - writer.context().push("mapOfArrOfObj", "Map>", "writing property"); - writer.writeString("mapOfArrOfObj"); - writer.writeExtGenericMap(type.mapOfArrOfObj, (writer: Write, key: string) => { - writer.writeString(key); - }, (writer: Write, value: Array): void => { - writer.writeArray(value, (writer: Write, item: Types.AnotherType): void => { - Types.AnotherType.write(writer, item); - }); - }); - writer.context().pop(); - writer.context().push("mapCustomValue", "Map", "writing property"); - writer.writeString("mapCustomValue"); - writer.writeExtGenericMap(type.mapCustomValue, (writer: Write, key: string) => { - writer.writeString(key); - }, (writer: Write, value: Types.CustomMapValue | null): void => { - if (value) { - Types.CustomMapValue.write(writer, value as Types.CustomMapValue); - } else { - writer.writeNil(); - } - }); - writer.context().pop(); -} - -export function deserializeCustomType(buffer: ArrayBuffer): CustomType { - const context: Context = new Context("Deserializing object-type CustomType"); - const reader = new ReadDecoder(buffer, context); - return readCustomType(reader); -} - -export function readCustomType(reader: Read): CustomType { - let numFields = reader.readMapLength(); - - let _str: string = ""; - let _strSet: bool = false; - let _optStr: string | null = null; - let _u: u32 = 0; - let _uSet: bool = false; - let _optU: Box | null = null; - let _u8: u8 = 0; - let _u8Set: bool = false; - let _u16: u16 = 0; - let _u16Set: bool = false; - let _u32: u32 = 0; - let _u32Set: bool = false; - let _i: i32 = 0; - let _iSet: bool = false; - let _i8: i8 = 0; - let _i8Set: bool = false; - let _i16: i16 = 0; - let _i16Set: bool = false; - let _i32: i32 = 0; - let _i32Set: bool = false; - let _bigint: BigInt = BigInt.fromUInt16(0); - let _bigintSet: bool = false; - let _optBigint: BigInt | null = null; - let _bignumber: BigNumber = new BigNumber(BigInt.fromUInt16(0), 0, 0); - let _bignumberSet: bool = false; - let _optBignumber: BigNumber | null = null; - let _json: JSON.Value = JSON.Value.Null(); - let _jsonSet: bool = false; - let _optJson: JSON.Value | null = null; - let _bytes: ArrayBuffer = new ArrayBuffer(0); - let _bytesSet: bool = false; - let _optBytes: ArrayBuffer | null = null; - let _boolean: bool = false; - let _booleanSet: bool = false; - let _optBoolean: Box | null = null; - let _u_array: Array = []; - let _u_arraySet: bool = false; - let _uOpt_array: Array | null = null; - let __opt_uOptArray: Array | null> | null = null; - let _optStrOptArray: Array | null = null; - let _uArrayArray: Array> = []; - let _uArrayArraySet: bool = false; - let _uOptArrayOptArray: Array | null> | null> = []; - let _uOptArrayOptArraySet: bool = false; - let _uArrayOptArrayArray: Array> | null> = []; - let _uArrayOptArrayArraySet: bool = false; - let _crazyArray: Array | null>> | null> | null = null; - let _object: Types.AnotherType | null = null; - let _objectSet: bool = false; - let _optObject: Types.AnotherType | null = null; - let _objectArray: Array = []; - let _objectArraySet: bool = false; - let _optObjectArray: Array | null = null; - let _en: Types.CustomEnum = 0; - let _enSet: bool = false; - let _optEnum: Box | null = null; - let _enumArray: Array = []; - let _enumArraySet: bool = false; - let _optEnumArray: Array | null> | null = null; - let _map: Map = new Map(); - let _mapSet: bool = false; - let _mapOfArr: Map> = new Map>(); - let _mapOfArrSet: bool = false; - let _mapOfObj: Map = new Map(); - let _mapOfObjSet: bool = false; - let _mapOfArrOfObj: Map> = new Map>(); - let _mapOfArrOfObjSet: bool = false; - let _mapCustomValue: Map = new Map(); - let _mapCustomValueSet: bool = false; - - while (numFields > 0) { - numFields--; - const field = reader.readString(); - - reader.context().push(field, "unknown", "searching for property type"); - if (field == "str") { - reader.context().push(field, "string", "type found, reading property"); - _str = reader.readString(); - _strSet = true; - reader.context().pop(); - } - else if (field == "optStr") { - reader.context().push(field, "string | null", "type found, reading property"); - _optStr = reader.readOptionalString(); - reader.context().pop(); - } - else if (field == "u") { - reader.context().push(field, "u32", "type found, reading property"); - _u = reader.readUInt32(); - _uSet = true; - reader.context().pop(); - } - else if (field == "optU") { - reader.context().push(field, "Box | null", "type found, reading property"); - _optU = reader.readOptionalUInt32(); - reader.context().pop(); - } - else if (field == "u8") { - reader.context().push(field, "u8", "type found, reading property"); - _u8 = reader.readUInt8(); - _u8Set = true; - reader.context().pop(); - } - else if (field == "u16") { - reader.context().push(field, "u16", "type found, reading property"); - _u16 = reader.readUInt16(); - _u16Set = true; - reader.context().pop(); - } - else if (field == "u32") { - reader.context().push(field, "u32", "type found, reading property"); - _u32 = reader.readUInt32(); - _u32Set = true; - reader.context().pop(); - } - else if (field == "i") { - reader.context().push(field, "i32", "type found, reading property"); - _i = reader.readInt32(); - _iSet = true; - reader.context().pop(); - } - else if (field == "i8") { - reader.context().push(field, "i8", "type found, reading property"); - _i8 = reader.readInt8(); - _i8Set = true; - reader.context().pop(); - } - else if (field == "i16") { - reader.context().push(field, "i16", "type found, reading property"); - _i16 = reader.readInt16(); - _i16Set = true; - reader.context().pop(); - } - else if (field == "i32") { - reader.context().push(field, "i32", "type found, reading property"); - _i32 = reader.readInt32(); - _i32Set = true; - reader.context().pop(); - } - else if (field == "bigint") { - reader.context().push(field, "BigInt", "type found, reading property"); - _bigint = reader.readBigInt(); - _bigintSet = true; - reader.context().pop(); - } - else if (field == "optBigint") { - reader.context().push(field, "BigInt | null", "type found, reading property"); - _optBigint = reader.readOptionalBigInt(); - reader.context().pop(); - } - else if (field == "bignumber") { - reader.context().push(field, "BigNumber", "type found, reading property"); - _bignumber = reader.readBigNumber(); - _bignumberSet = true; - reader.context().pop(); - } - else if (field == "optBignumber") { - reader.context().push(field, "BigNumber | null", "type found, reading property"); - _optBignumber = reader.readOptionalBigNumber(); - reader.context().pop(); - } - else if (field == "json") { - reader.context().push(field, "JSON.Value", "type found, reading property"); - _json = reader.readJSON(); - _jsonSet = true; - reader.context().pop(); - } - else if (field == "optJson") { - reader.context().push(field, "JSON.Value | null", "type found, reading property"); - _optJson = reader.readOptionalJSON(); - reader.context().pop(); - } - else if (field == "bytes") { - reader.context().push(field, "ArrayBuffer", "type found, reading property"); - _bytes = reader.readBytes(); - _bytesSet = true; - reader.context().pop(); - } - else if (field == "optBytes") { - reader.context().push(field, "ArrayBuffer | null", "type found, reading property"); - _optBytes = reader.readOptionalBytes(); - reader.context().pop(); - } - else if (field == "boolean") { - reader.context().push(field, "bool", "type found, reading property"); - _boolean = reader.readBool(); - _booleanSet = true; - reader.context().pop(); - } - else if (field == "optBoolean") { - reader.context().push(field, "Box | null", "type found, reading property"); - _optBoolean = reader.readOptionalBool(); - reader.context().pop(); - } - else if (field == "u_array") { - reader.context().push(field, "Array", "type found, reading property"); - _u_array = reader.readArray((reader: Read): u32 => { - return reader.readUInt32(); - }); - _u_arraySet = true; - reader.context().pop(); - } - else if (field == "uOpt_array") { - reader.context().push(field, "Array | null", "type found, reading property"); - _uOpt_array = reader.readOptionalArray((reader: Read): u32 => { - return reader.readUInt32(); - }); - reader.context().pop(); - } - else if (field == "_opt_uOptArray") { - reader.context().push(field, "Array | null> | null", "type found, reading property"); - __opt_uOptArray = reader.readOptionalArray((reader: Read): Box | null => { - return reader.readOptionalUInt32(); - }); - reader.context().pop(); - } - else if (field == "optStrOptArray") { - reader.context().push(field, "Array | null", "type found, reading property"); - _optStrOptArray = reader.readOptionalArray((reader: Read): string | null => { - return reader.readOptionalString(); - }); - reader.context().pop(); - } - else if (field == "uArrayArray") { - reader.context().push(field, "Array>", "type found, reading property"); - _uArrayArray = reader.readArray((reader: Read): Array => { - return reader.readArray((reader: Read): u32 => { - return reader.readUInt32(); - }); - }); - _uArrayArraySet = true; - reader.context().pop(); - } - else if (field == "uOptArrayOptArray") { - reader.context().push(field, "Array | null> | null>", "type found, reading property"); - _uOptArrayOptArray = reader.readArray((reader: Read): Array | null> | null => { - return reader.readOptionalArray((reader: Read): Box | null => { - return reader.readOptionalUInt32(); - }); - }); - _uOptArrayOptArraySet = true; - reader.context().pop(); - } - else if (field == "uArrayOptArrayArray") { - reader.context().push(field, "Array> | null>", "type found, reading property"); - _uArrayOptArrayArray = reader.readArray((reader: Read): Array> | null => { - return reader.readOptionalArray((reader: Read): Array => { - return reader.readArray((reader: Read): u32 => { - return reader.readUInt32(); - }); - }); - }); - _uArrayOptArrayArraySet = true; - reader.context().pop(); - } - else if (field == "crazyArray") { - reader.context().push(field, "Array | null>> | null> | null", "type found, reading property"); - _crazyArray = reader.readOptionalArray((reader: Read): Array | null>> | null => { - return reader.readOptionalArray((reader: Read): Array | null> => { - return reader.readArray((reader: Read): Array | null => { - return reader.readOptionalArray((reader: Read): u32 => { - return reader.readUInt32(); - }); - }); - }); - }); - reader.context().pop(); - } - else if (field == "object") { - reader.context().push(field, "Types.AnotherType", "type found, reading property"); - const object = Types.AnotherType.read(reader); - _object = object; - _objectSet = true; - reader.context().pop(); - } - else if (field == "optObject") { - reader.context().push(field, "Types.AnotherType | null", "type found, reading property"); - let object: Types.AnotherType | null = null; - if (!reader.isNextNil()) { - object = Types.AnotherType.read(reader); - } - _optObject = object; - reader.context().pop(); - } - else if (field == "objectArray") { - reader.context().push(field, "Array", "type found, reading property"); - _objectArray = reader.readArray((reader: Read): Types.AnotherType => { - const object = Types.AnotherType.read(reader); - return object; - }); - _objectArraySet = true; - reader.context().pop(); - } - else if (field == "optObjectArray") { - reader.context().push(field, "Array | null", "type found, reading property"); - _optObjectArray = reader.readOptionalArray((reader: Read): Types.AnotherType | null => { - let object: Types.AnotherType | null = null; - if (!reader.isNextNil()) { - object = Types.AnotherType.read(reader); - } - return object; - }); - reader.context().pop(); - } - else if (field == "en") { - reader.context().push(field, "Types.CustomEnum", "type found, reading property"); - let value: Types.CustomEnum; - if (reader.isNextString()) { - value = Types.getCustomEnumValue(reader.readString()); - } else { - value = reader.readInt32(); - Types.sanitizeCustomEnumValue(value); - } - _en = value; - _enSet = true; - reader.context().pop(); - } - else if (field == "optEnum") { - reader.context().push(field, "Box | null", "type found, reading property"); - let value: Box | null; - if (!reader.isNextNil()) { - if (reader.isNextString()) { - value = Box.from( - Types.getCustomEnumValue(reader.readString()) - ); - } else { - value = Box.from( - reader.readInt32() - ); - Types.sanitizeCustomEnumValue(value.unwrap()); - } - } else { - value = null; - } - _optEnum = value; - reader.context().pop(); - } - else if (field == "enumArray") { - reader.context().push(field, "Array", "type found, reading property"); - _enumArray = reader.readArray((reader: Read): Types.CustomEnum => { - let value: Types.CustomEnum; - if (reader.isNextString()) { - value = Types.getCustomEnumValue(reader.readString()); - } else { - value = reader.readInt32(); - Types.sanitizeCustomEnumValue(value); - } - return value; - }); - _enumArraySet = true; - reader.context().pop(); - } - else if (field == "optEnumArray") { - reader.context().push(field, "Array | null> | null", "type found, reading property"); - _optEnumArray = reader.readOptionalArray((reader: Read): Box | null => { - let value: Box | null; - if (!reader.isNextNil()) { - if (reader.isNextString()) { - value = Box.from( - Types.getCustomEnumValue(reader.readString()) - ); - } else { - value = Box.from( - reader.readInt32() - ); - Types.sanitizeCustomEnumValue(value.unwrap()); - } - } else { - value = null; - } - return value; - }); - reader.context().pop(); - } - else if (field == "map") { - reader.context().push(field, "Map", "type found, reading property"); - _map = reader.readExtGenericMap((reader: Read): string => { - return reader.readString(); - }, (reader: Read): i32 => { - return reader.readInt32(); - }); - _mapSet = true; - reader.context().pop(); - } - else if (field == "mapOfArr") { - reader.context().push(field, "Map>", "type found, reading property"); - _mapOfArr = reader.readExtGenericMap((reader: Read): string => { - return reader.readString(); - }, (reader: Read): Array => { - return reader.readArray((reader: Read): i32 => { - return reader.readInt32(); - }); - }); - _mapOfArrSet = true; - reader.context().pop(); - } - else if (field == "mapOfObj") { - reader.context().push(field, "Map", "type found, reading property"); - _mapOfObj = reader.readExtGenericMap((reader: Read): string => { - return reader.readString(); - }, (reader: Read): Types.AnotherType => { - const object = Types.AnotherType.read(reader); - return object; - }); - _mapOfObjSet = true; - reader.context().pop(); - } - else if (field == "mapOfArrOfObj") { - reader.context().push(field, "Map>", "type found, reading property"); - _mapOfArrOfObj = reader.readExtGenericMap((reader: Read): string => { - return reader.readString(); - }, (reader: Read): Array => { - return reader.readArray((reader: Read): Types.AnotherType => { - const object = Types.AnotherType.read(reader); - return object; - }); - }); - _mapOfArrOfObjSet = true; - reader.context().pop(); - } - else if (field == "mapCustomValue") { - reader.context().push(field, "Map", "type found, reading property"); - _mapCustomValue = reader.readExtGenericMap((reader: Read): string => { - return reader.readString(); - }, (reader: Read): Types.CustomMapValue | null => { - let object: Types.CustomMapValue | null = null; - if (!reader.isNextNil()) { - object = Types.CustomMapValue.read(reader); - } - return object; - }); - _mapCustomValueSet = true; - reader.context().pop(); - } - reader.context().pop(); - } - - if (!_strSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'str: String'")); - } - if (!_uSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'u: UInt'")); - } - if (!_u8Set) { - throw new Error(reader.context().printWithContext("Missing required property: 'u8: UInt8'")); - } - if (!_u16Set) { - throw new Error(reader.context().printWithContext("Missing required property: 'u16: UInt16'")); - } - if (!_u32Set) { - throw new Error(reader.context().printWithContext("Missing required property: 'u32: UInt32'")); - } - if (!_iSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'i: Int'")); - } - if (!_i8Set) { - throw new Error(reader.context().printWithContext("Missing required property: 'i8: Int8'")); - } - if (!_i16Set) { - throw new Error(reader.context().printWithContext("Missing required property: 'i16: Int16'")); - } - if (!_i32Set) { - throw new Error(reader.context().printWithContext("Missing required property: 'i32: Int32'")); - } - if (!_bigintSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'bigint: BigInt'")); - } - if (!_bignumberSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'bignumber: BigNumber'")); - } - if (!_jsonSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'json: JSON'")); - } - if (!_bytesSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'bytes: Bytes'")); - } - if (!_booleanSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'boolean: Boolean'")); - } - if (!_u_arraySet) { - throw new Error(reader.context().printWithContext("Missing required property: 'u_array: [UInt]'")); - } - if (!_uArrayArraySet) { - throw new Error(reader.context().printWithContext("Missing required property: 'uArrayArray: [[UInt]]'")); - } - if (!_uOptArrayOptArraySet) { - throw new Error(reader.context().printWithContext("Missing required property: 'uOptArrayOptArray: [[UInt32]]'")); - } - if (!_uArrayOptArrayArraySet) { - throw new Error(reader.context().printWithContext("Missing required property: 'uArrayOptArrayArray: [[[UInt32]]]'")); - } - if (!_object || !_objectSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'object: AnotherType'")); - } - if (!_objectArraySet) { - throw new Error(reader.context().printWithContext("Missing required property: 'objectArray: [AnotherType]'")); - } - if (!_enSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'en: CustomEnum'")); - } - if (!_enumArraySet) { - throw new Error(reader.context().printWithContext("Missing required property: 'enumArray: [CustomEnum]'")); - } - if (!_mapSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'map: Map'")); - } - if (!_mapOfArrSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'mapOfArr: Map'")); - } - if (!_mapOfObjSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'mapOfObj: Map'")); - } - if (!_mapOfArrOfObjSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'mapOfArrOfObj: Map'")); - } - if (!_mapCustomValueSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'mapCustomValue: Map'")); - } - - return { - str: _str, - optStr: _optStr, - u: _u, - optU: _optU, - _u8: _u8, - _u16: _u16, - _u32: _u32, - i: _i, - _i8: _i8, - _i16: _i16, - _i32: _i32, - bigint: _bigint, - optBigint: _optBigint, - bignumber: _bignumber, - optBignumber: _optBignumber, - json: _json, - optJson: _optJson, - bytes: _bytes, - optBytes: _optBytes, - _boolean: _boolean, - optBoolean: _optBoolean, - u_array: _u_array, - uOpt_array: _uOpt_array, - _opt_uOptArray: __opt_uOptArray, - optStrOptArray: _optStrOptArray, - uArrayArray: _uArrayArray, - uOptArrayOptArray: _uOptArrayOptArray, - uArrayOptArrayArray: _uArrayOptArrayArray, - crazyArray: _crazyArray, - object: _object, - optObject: _optObject, - objectArray: _objectArray, - optObjectArray: _optObjectArray, - en: _en, - optEnum: _optEnum, - enumArray: _enumArray, - optEnumArray: _optEnumArray, - map: _map, - mapOfArr: _mapOfArr, - mapOfObj: _mapOfObj, - mapOfArrOfObj: _mapOfArrOfObj, - mapCustomValue: _mapCustomValue - }; -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/Env/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/Env/index.ts deleted file mode 100644 index 6e9417c587..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/Env/index.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { - Read, - Write, - Box, - BigInt, - BigNumber, - JSON -} from "@polywrap/wasm-as"; -import { - serializeEnv, - deserializeEnv, - writeEnv, - readEnv -} from "./serialization"; -import * as Types from ".."; - -export class Env { - prop: string; - optProp: string | null; - optMap: Map | null> | null; - - static toBuffer(type: Env): ArrayBuffer { - return serializeEnv(type); - } - - static fromBuffer(buffer: ArrayBuffer): Env { - return deserializeEnv(buffer); - } - - static write(writer: Write, type: Env): void { - writeEnv(writer, type); - } - - static read(reader: Read): Env { - return readEnv(reader); - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/Env/serialization.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/Env/serialization.ts deleted file mode 100644 index 84186a0ea1..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/Env/serialization.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { - Read, - ReadDecoder, - Write, - WriteSizer, - WriteEncoder, - Box, - BigInt, - BigNumber, - JSON, - Context -} from "@polywrap/wasm-as"; -import { Env } from "./"; -import * as Types from ".."; - -export function serializeEnv(type: Env): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) env-type: Env"); - const sizer = new WriteSizer(sizerContext); - writeEnv(sizer, type); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) env-type: Env"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeEnv(encoder, type); - return buffer; -} - -export function writeEnv(writer: Write, type: Env): void { - writer.writeMapLength(3); - writer.context().push("prop", "string", "writing property"); - writer.writeString("prop"); - writer.writeString(type.prop); - writer.context().pop(); - writer.context().push("optProp", "string | null", "writing property"); - writer.writeString("optProp"); - writer.writeOptionalString(type.optProp); - writer.context().pop(); - writer.context().push("optMap", "Map | null> | null", "writing property"); - writer.writeString("optMap"); - writer.writeOptionalExtGenericMap(type.optMap, (writer: Write, key: string) => { - writer.writeString(key); - }, (writer: Write, value: Box | null): void => { - writer.writeOptionalInt32(value); - }); - writer.context().pop(); -} - -export function deserializeEnv(buffer: ArrayBuffer): Env { - const context: Context = new Context("Deserializing env-type Env"); - const reader = new ReadDecoder(buffer, context); - return readEnv(reader); -} - -export function readEnv(reader: Read): Env { - let numFields = reader.readMapLength(); - - let _prop: string = ""; - let _propSet: bool = false; - let _optProp: string | null = null; - let _optMap: Map | null> | null = null; - - while (numFields > 0) { - numFields--; - const field = reader.readString(); - - reader.context().push(field, "unknown", "searching for property type"); - if (field == "prop") { - reader.context().push(field, "string", "type found, reading property"); - _prop = reader.readString(); - _propSet = true; - reader.context().pop(); - } - else if (field == "optProp") { - reader.context().push(field, "string | null", "type found, reading property"); - _optProp = reader.readOptionalString(); - reader.context().pop(); - } - else if (field == "optMap") { - reader.context().push(field, "Map | null> | null", "type found, reading property"); - _optMap = reader.readOptionalExtGenericMap((reader: Read): string => { - return reader.readString(); - }, (reader: Read): Box | null => { - return reader.readOptionalInt32(); - }); - reader.context().pop(); - } - reader.context().pop(); - } - - if (!_propSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'prop: String'")); - } - - return { - prop: _prop, - optProp: _optProp, - optMap: _optMap - }; -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/Module/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/Module/index.ts deleted file mode 100644 index 2cd8b85ef7..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/Module/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { - Args_moduleMethod, - Args_objectMethod, - Args_optionalEnvMethod, - Args__if -} from "./serialization"; - -export { - Args_moduleMethod, - Args_objectMethod, - Args_optionalEnvMethod, - Args__if -}; -export { ModuleBase } from "./module"; diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/Module/module.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/Module/module.ts deleted file mode 100644 index 71295ecdb2..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/Module/module.ts +++ /dev/null @@ -1,28 +0,0 @@ -import * as Types from ".."; - -import { - BigInt, - BigNumber, - Box, - JSON, -} from "@polywrap/wasm-as"; - -export abstract class ModuleBase { - abstract moduleMethod( - args: Types.Args_moduleMethod - ): i32; - - abstract objectMethod( - args: Types.Args_objectMethod, - env: Types.Env - ): Types.AnotherType | null; - - abstract optionalEnvMethod( - args: Types.Args_optionalEnvMethod, - env: Types.Env | null - ): Types.AnotherType | null; - - abstract _if( - args: Types.Args__if - ): Types._else; -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/Module/serialization.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/Module/serialization.ts deleted file mode 100644 index 3cf8cc78d7..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/Module/serialization.ts +++ /dev/null @@ -1,770 +0,0 @@ -import { - Read, - ReadDecoder, - Write, - WriteSizer, - WriteEncoder, - Box, - BigInt, - BigNumber, - JSON, - Context -} from "@polywrap/wasm-as"; -import * as Types from ".."; - -export class Args_moduleMethod { - str: string; - optStr: string | null; - en: Types.CustomEnum; - optEnum: Box | null; - enumArray: Array; - optEnumArray: Array | null> | null; - map: Map; - mapOfArr: Map>; - mapOfMap: Map>; - mapOfObj: Map; - mapOfArrOfObj: Map>; -} - -export function deserializemoduleMethodArgs(argsBuf: ArrayBuffer): Args_moduleMethod { - const context: Context = new Context("Deserializing module-type: moduleMethod Args"); - const reader = new ReadDecoder(argsBuf, context); - let numFields = reader.readMapLength(); - - let _str: string = ""; - let _strSet: bool = false; - let _optStr: string | null = null; - let _en: Types.CustomEnum = 0; - let _enSet: bool = false; - let _optEnum: Box | null = null; - let _enumArray: Array = []; - let _enumArraySet: bool = false; - let _optEnumArray: Array | null> | null = null; - let _map: Map = new Map(); - let _mapSet: bool = false; - let _mapOfArr: Map> = new Map>(); - let _mapOfArrSet: bool = false; - let _mapOfMap: Map> = new Map>(); - let _mapOfMapSet: bool = false; - let _mapOfObj: Map = new Map(); - let _mapOfObjSet: bool = false; - let _mapOfArrOfObj: Map> = new Map>(); - let _mapOfArrOfObjSet: bool = false; - - while (numFields > 0) { - numFields--; - const field = reader.readString(); - - reader.context().push(field, "unknown", "searching for property type"); - if (field == "str") { - reader.context().push(field, "string", "type found, reading property"); - _str = reader.readString(); - _strSet = true; - reader.context().pop(); - } - else if (field == "optStr") { - reader.context().push(field, "string | null", "type found, reading property"); - _optStr = reader.readOptionalString(); - reader.context().pop(); - } - else if (field == "en") { - reader.context().push(field, "Types.CustomEnum", "type found, reading property"); - let value: Types.CustomEnum; - if (reader.isNextString()) { - value = Types.getCustomEnumValue(reader.readString()); - } else { - value = reader.readInt32(); - Types.sanitizeCustomEnumValue(value); - } - _en = value; - _enSet = true; - reader.context().pop(); - } - else if (field == "optEnum") { - reader.context().push(field, "Box | null", "type found, reading property"); - let value: Box | null; - if (!reader.isNextNil()) { - if (reader.isNextString()) { - value = Box.from( - Types.getCustomEnumValue(reader.readString()) - ); - } else { - value = Box.from( - reader.readInt32() - ); - Types.sanitizeCustomEnumValue(value.unwrap()); - } - } else { - value = null; - } - _optEnum = value; - reader.context().pop(); - } - else if (field == "enumArray") { - reader.context().push(field, "Array", "type found, reading property"); - _enumArray = reader.readArray((reader: Read): Types.CustomEnum => { - let value: Types.CustomEnum; - if (reader.isNextString()) { - value = Types.getCustomEnumValue(reader.readString()); - } else { - value = reader.readInt32(); - Types.sanitizeCustomEnumValue(value); - } - return value; - }); - _enumArraySet = true; - reader.context().pop(); - } - else if (field == "optEnumArray") { - reader.context().push(field, "Array | null> | null", "type found, reading property"); - _optEnumArray = reader.readOptionalArray((reader: Read): Box | null => { - let value: Box | null; - if (!reader.isNextNil()) { - if (reader.isNextString()) { - value = Box.from( - Types.getCustomEnumValue(reader.readString()) - ); - } else { - value = Box.from( - reader.readInt32() - ); - Types.sanitizeCustomEnumValue(value.unwrap()); - } - } else { - value = null; - } - return value; - }); - reader.context().pop(); - } - else if (field == "map") { - reader.context().push(field, "Map", "type found, reading property"); - _map = reader.readExtGenericMap((reader: Read): string => { - return reader.readString(); - }, (reader: Read): i32 => { - return reader.readInt32(); - }); - _mapSet = true; - reader.context().pop(); - } - else if (field == "mapOfArr") { - reader.context().push(field, "Map>", "type found, reading property"); - _mapOfArr = reader.readExtGenericMap((reader: Read): string => { - return reader.readString(); - }, (reader: Read): Array => { - return reader.readArray((reader: Read): i32 => { - return reader.readInt32(); - }); - }); - _mapOfArrSet = true; - reader.context().pop(); - } - else if (field == "mapOfMap") { - reader.context().push(field, "Map>", "type found, reading property"); - _mapOfMap = reader.readExtGenericMap((reader: Read): string => { - return reader.readString(); - }, (reader: Read): Map => { - return reader.readExtGenericMap((reader: Read): string => { - return reader.readString(); - }, (reader: Read): i32 => { - return reader.readInt32(); - }); - }); - _mapOfMapSet = true; - reader.context().pop(); - } - else if (field == "mapOfObj") { - reader.context().push(field, "Map", "type found, reading property"); - _mapOfObj = reader.readExtGenericMap((reader: Read): string => { - return reader.readString(); - }, (reader: Read): Types.AnotherType => { - const object = Types.AnotherType.read(reader); - return object; - }); - _mapOfObjSet = true; - reader.context().pop(); - } - else if (field == "mapOfArrOfObj") { - reader.context().push(field, "Map>", "type found, reading property"); - _mapOfArrOfObj = reader.readExtGenericMap((reader: Read): string => { - return reader.readString(); - }, (reader: Read): Array => { - return reader.readArray((reader: Read): Types.AnotherType => { - const object = Types.AnotherType.read(reader); - return object; - }); - }); - _mapOfArrOfObjSet = true; - reader.context().pop(); - } - reader.context().pop(); - } - - if (!_strSet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'str: String'")); - } - if (!_enSet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'en: CustomEnum'")); - } - if (!_enumArraySet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'enumArray: [CustomEnum]'")); - } - if (!_mapSet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'map: Map'")); - } - if (!_mapOfArrSet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'mapOfArr: Map'")); - } - if (!_mapOfMapSet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'mapOfMap: Map>'")); - } - if (!_mapOfObjSet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'mapOfObj: Map'")); - } - if (!_mapOfArrOfObjSet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'mapOfArrOfObj: Map'")); - } - - return { - str: _str, - optStr: _optStr, - en: _en, - optEnum: _optEnum, - enumArray: _enumArray, - optEnumArray: _optEnumArray, - map: _map, - mapOfArr: _mapOfArr, - mapOfMap: _mapOfMap, - mapOfObj: _mapOfObj, - mapOfArrOfObj: _mapOfArrOfObj - }; -} - -export function serializemoduleMethodArgs(args: Args_moduleMethod): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) module-type: moduleMethod Args"); - const sizer = new WriteSizer(sizerContext); - writemoduleMethodArgs(sizer, args); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) module-type: moduleMethod Args"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writemoduleMethodArgs(encoder, args); - return buffer; -} - -export function writemoduleMethodArgs( - writer: Write, - args: Args_moduleMethod -): void { - writer.writeMapLength(11); - writer.context().push("str", "string", "writing property"); - writer.writeString("str"); - writer.writeString(args.str); - writer.context().pop(); - writer.context().push("optStr", "string | null", "writing property"); - writer.writeString("optStr"); - writer.writeOptionalString(args.optStr); - writer.context().pop(); - writer.context().push("en", "Types.CustomEnum", "writing property"); - writer.writeString("en"); - writer.writeInt32(args.en); - writer.context().pop(); - writer.context().push("optEnum", "Box | null", "writing property"); - writer.writeString("optEnum"); - writer.writeOptionalInt32(args.optEnum); - writer.context().pop(); - writer.context().push("enumArray", "Array", "writing property"); - writer.writeString("enumArray"); - writer.writeArray(args.enumArray, (writer: Write, item: Types.CustomEnum): void => { - writer.writeInt32(item); - }); - writer.context().pop(); - writer.context().push("optEnumArray", "Array | null> | null", "writing property"); - writer.writeString("optEnumArray"); - writer.writeOptionalArray(args.optEnumArray, (writer: Write, item: Box | null): void => { - writer.writeOptionalInt32(item); - }); - writer.context().pop(); - writer.context().push("map", "Map", "writing property"); - writer.writeString("map"); - writer.writeExtGenericMap(args.map, (writer: Write, key: string) => { - writer.writeString(key); - }, (writer: Write, value: i32): void => { - writer.writeInt32(value); - }); - writer.context().pop(); - writer.context().push("mapOfArr", "Map>", "writing property"); - writer.writeString("mapOfArr"); - writer.writeExtGenericMap(args.mapOfArr, (writer: Write, key: string) => { - writer.writeString(key); - }, (writer: Write, value: Array): void => { - writer.writeArray(value, (writer: Write, item: i32): void => { - writer.writeInt32(item); - }); - }); - writer.context().pop(); - writer.context().push("mapOfMap", "Map>", "writing property"); - writer.writeString("mapOfMap"); - writer.writeExtGenericMap(args.mapOfMap, (writer: Write, key: string) => { - writer.writeString(key); - }, (writer: Write, value: Map): void => { - writer.writeExtGenericMap(value, (writer: Write, key: string) => { - writer.writeString(key); - }, (writer: Write, value: i32): void => { - writer.writeInt32(value); - }); - }); - writer.context().pop(); - writer.context().push("mapOfObj", "Map", "writing property"); - writer.writeString("mapOfObj"); - writer.writeExtGenericMap(args.mapOfObj, (writer: Write, key: string) => { - writer.writeString(key); - }, (writer: Write, value: Types.AnotherType): void => { - Types.AnotherType.write(writer, value); - }); - writer.context().pop(); - writer.context().push("mapOfArrOfObj", "Map>", "writing property"); - writer.writeString("mapOfArrOfObj"); - writer.writeExtGenericMap(args.mapOfArrOfObj, (writer: Write, key: string) => { - writer.writeString(key); - }, (writer: Write, value: Array): void => { - writer.writeArray(value, (writer: Write, item: Types.AnotherType): void => { - Types.AnotherType.write(writer, item); - }); - }); - writer.context().pop(); -} - -export function serializemoduleMethodResult(result: i32): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) module-type: moduleMethod Result"); - const sizer = new WriteSizer(sizerContext); - writemoduleMethodResult(sizer, result); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) module-type: moduleMethod Result"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writemoduleMethodResult(encoder, result); - return buffer; -} - -export function writemoduleMethodResult(writer: Write, result: i32): void { - writer.context().push("moduleMethod", "i32", "writing property"); - writer.writeInt32(result); - writer.context().pop(); -} - -export function deserializemoduleMethodResult(buffer: ArrayBuffer): i32 { - const context: Context = new Context("Deserializing module-type: moduleMethod Result"); - const reader = new ReadDecoder(buffer, context); - - reader.context().push("moduleMethod", "i32", "reading function output"); - const res: i32 = reader.readInt32(); - reader.context().pop(); - - return res; -} - -export class Args_objectMethod { - object: Types.AnotherType; - optObject: Types.AnotherType | null; - objectArray: Array; - optObjectArray: Array | null; -} - -export function deserializeobjectMethodArgs(argsBuf: ArrayBuffer): Args_objectMethod { - const context: Context = new Context("Deserializing module-type: objectMethod Args"); - const reader = new ReadDecoder(argsBuf, context); - let numFields = reader.readMapLength(); - - let _object: Types.AnotherType | null = null; - let _objectSet: bool = false; - let _optObject: Types.AnotherType | null = null; - let _objectArray: Array = []; - let _objectArraySet: bool = false; - let _optObjectArray: Array | null = null; - - while (numFields > 0) { - numFields--; - const field = reader.readString(); - - reader.context().push(field, "unknown", "searching for property type"); - if (field == "object") { - reader.context().push(field, "Types.AnotherType", "type found, reading property"); - const object = Types.AnotherType.read(reader); - _object = object; - _objectSet = true; - reader.context().pop(); - } - else if (field == "optObject") { - reader.context().push(field, "Types.AnotherType | null", "type found, reading property"); - let object: Types.AnotherType | null = null; - if (!reader.isNextNil()) { - object = Types.AnotherType.read(reader); - } - _optObject = object; - reader.context().pop(); - } - else if (field == "objectArray") { - reader.context().push(field, "Array", "type found, reading property"); - _objectArray = reader.readArray((reader: Read): Types.AnotherType => { - const object = Types.AnotherType.read(reader); - return object; - }); - _objectArraySet = true; - reader.context().pop(); - } - else if (field == "optObjectArray") { - reader.context().push(field, "Array | null", "type found, reading property"); - _optObjectArray = reader.readOptionalArray((reader: Read): Types.AnotherType | null => { - let object: Types.AnotherType | null = null; - if (!reader.isNextNil()) { - object = Types.AnotherType.read(reader); - } - return object; - }); - reader.context().pop(); - } - reader.context().pop(); - } - - if (!_object || !_objectSet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'object: AnotherType'")); - } - if (!_objectArraySet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'objectArray: [AnotherType]'")); - } - - return { - object: _object, - optObject: _optObject, - objectArray: _objectArray, - optObjectArray: _optObjectArray - }; -} - -export function serializeobjectMethodArgs(args: Args_objectMethod): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) module-type: objectMethod Args"); - const sizer = new WriteSizer(sizerContext); - writeobjectMethodArgs(sizer, args); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) module-type: objectMethod Args"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeobjectMethodArgs(encoder, args); - return buffer; -} - -export function writeobjectMethodArgs( - writer: Write, - args: Args_objectMethod -): void { - writer.writeMapLength(4); - writer.context().push("object", "Types.AnotherType", "writing property"); - writer.writeString("object"); - Types.AnotherType.write(writer, args.object); - writer.context().pop(); - writer.context().push("optObject", "Types.AnotherType | null", "writing property"); - writer.writeString("optObject"); - if (args.optObject) { - Types.AnotherType.write(writer, args.optObject as Types.AnotherType); - } else { - writer.writeNil(); - } - writer.context().pop(); - writer.context().push("objectArray", "Array", "writing property"); - writer.writeString("objectArray"); - writer.writeArray(args.objectArray, (writer: Write, item: Types.AnotherType): void => { - Types.AnotherType.write(writer, item); - }); - writer.context().pop(); - writer.context().push("optObjectArray", "Array | null", "writing property"); - writer.writeString("optObjectArray"); - writer.writeOptionalArray(args.optObjectArray, (writer: Write, item: Types.AnotherType | null): void => { - if (item) { - Types.AnotherType.write(writer, item as Types.AnotherType); - } else { - writer.writeNil(); - } - }); - writer.context().pop(); -} - -export function serializeobjectMethodResult(result: Types.AnotherType | null): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) module-type: objectMethod Result"); - const sizer = new WriteSizer(sizerContext); - writeobjectMethodResult(sizer, result); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) module-type: objectMethod Result"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeobjectMethodResult(encoder, result); - return buffer; -} - -export function writeobjectMethodResult(writer: Write, result: Types.AnotherType | null): void { - writer.context().push("objectMethod", "Types.AnotherType | null", "writing property"); - if (result) { - Types.AnotherType.write(writer, result as Types.AnotherType); - } else { - writer.writeNil(); - } - writer.context().pop(); -} - -export function deserializeobjectMethodResult(buffer: ArrayBuffer): Types.AnotherType | null { - const context: Context = new Context("Deserializing module-type: objectMethod Result"); - const reader = new ReadDecoder(buffer, context); - - reader.context().push("objectMethod", "Types.AnotherType | null", "reading function output"); - let object: Types.AnotherType | null = null; - if (!reader.isNextNil()) { - object = Types.AnotherType.read(reader); - } - const res: Types.AnotherType | null = object; - reader.context().pop(); - - return res; -} - -export class Args_optionalEnvMethod { - object: Types.AnotherType; - optObject: Types.AnotherType | null; - objectArray: Array; - optObjectArray: Array | null; -} - -export function deserializeoptionalEnvMethodArgs(argsBuf: ArrayBuffer): Args_optionalEnvMethod { - const context: Context = new Context("Deserializing module-type: optionalEnvMethod Args"); - const reader = new ReadDecoder(argsBuf, context); - let numFields = reader.readMapLength(); - - let _object: Types.AnotherType | null = null; - let _objectSet: bool = false; - let _optObject: Types.AnotherType | null = null; - let _objectArray: Array = []; - let _objectArraySet: bool = false; - let _optObjectArray: Array | null = null; - - while (numFields > 0) { - numFields--; - const field = reader.readString(); - - reader.context().push(field, "unknown", "searching for property type"); - if (field == "object") { - reader.context().push(field, "Types.AnotherType", "type found, reading property"); - const object = Types.AnotherType.read(reader); - _object = object; - _objectSet = true; - reader.context().pop(); - } - else if (field == "optObject") { - reader.context().push(field, "Types.AnotherType | null", "type found, reading property"); - let object: Types.AnotherType | null = null; - if (!reader.isNextNil()) { - object = Types.AnotherType.read(reader); - } - _optObject = object; - reader.context().pop(); - } - else if (field == "objectArray") { - reader.context().push(field, "Array", "type found, reading property"); - _objectArray = reader.readArray((reader: Read): Types.AnotherType => { - const object = Types.AnotherType.read(reader); - return object; - }); - _objectArraySet = true; - reader.context().pop(); - } - else if (field == "optObjectArray") { - reader.context().push(field, "Array | null", "type found, reading property"); - _optObjectArray = reader.readOptionalArray((reader: Read): Types.AnotherType | null => { - let object: Types.AnotherType | null = null; - if (!reader.isNextNil()) { - object = Types.AnotherType.read(reader); - } - return object; - }); - reader.context().pop(); - } - reader.context().pop(); - } - - if (!_object || !_objectSet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'object: AnotherType'")); - } - if (!_objectArraySet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'objectArray: [AnotherType]'")); - } - - return { - object: _object, - optObject: _optObject, - objectArray: _objectArray, - optObjectArray: _optObjectArray - }; -} - -export function serializeoptionalEnvMethodArgs(args: Args_optionalEnvMethod): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) module-type: optionalEnvMethod Args"); - const sizer = new WriteSizer(sizerContext); - writeoptionalEnvMethodArgs(sizer, args); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) module-type: optionalEnvMethod Args"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeoptionalEnvMethodArgs(encoder, args); - return buffer; -} - -export function writeoptionalEnvMethodArgs( - writer: Write, - args: Args_optionalEnvMethod -): void { - writer.writeMapLength(4); - writer.context().push("object", "Types.AnotherType", "writing property"); - writer.writeString("object"); - Types.AnotherType.write(writer, args.object); - writer.context().pop(); - writer.context().push("optObject", "Types.AnotherType | null", "writing property"); - writer.writeString("optObject"); - if (args.optObject) { - Types.AnotherType.write(writer, args.optObject as Types.AnotherType); - } else { - writer.writeNil(); - } - writer.context().pop(); - writer.context().push("objectArray", "Array", "writing property"); - writer.writeString("objectArray"); - writer.writeArray(args.objectArray, (writer: Write, item: Types.AnotherType): void => { - Types.AnotherType.write(writer, item); - }); - writer.context().pop(); - writer.context().push("optObjectArray", "Array | null", "writing property"); - writer.writeString("optObjectArray"); - writer.writeOptionalArray(args.optObjectArray, (writer: Write, item: Types.AnotherType | null): void => { - if (item) { - Types.AnotherType.write(writer, item as Types.AnotherType); - } else { - writer.writeNil(); - } - }); - writer.context().pop(); -} - -export function serializeoptionalEnvMethodResult(result: Types.AnotherType | null): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) module-type: optionalEnvMethod Result"); - const sizer = new WriteSizer(sizerContext); - writeoptionalEnvMethodResult(sizer, result); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) module-type: optionalEnvMethod Result"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeoptionalEnvMethodResult(encoder, result); - return buffer; -} - -export function writeoptionalEnvMethodResult(writer: Write, result: Types.AnotherType | null): void { - writer.context().push("optionalEnvMethod", "Types.AnotherType | null", "writing property"); - if (result) { - Types.AnotherType.write(writer, result as Types.AnotherType); - } else { - writer.writeNil(); - } - writer.context().pop(); -} - -export function deserializeoptionalEnvMethodResult(buffer: ArrayBuffer): Types.AnotherType | null { - const context: Context = new Context("Deserializing module-type: optionalEnvMethod Result"); - const reader = new ReadDecoder(buffer, context); - - reader.context().push("optionalEnvMethod", "Types.AnotherType | null", "reading function output"); - let object: Types.AnotherType | null = null; - if (!reader.isNextNil()) { - object = Types.AnotherType.read(reader); - } - const res: Types.AnotherType | null = object; - reader.context().pop(); - - return res; -} - -export class Args__if { - _if: Types._else; -} - -export function deserializeifArgs(argsBuf: ArrayBuffer): Args__if { - const context: Context = new Context("Deserializing module-type: if Args"); - const reader = new ReadDecoder(argsBuf, context); - let numFields = reader.readMapLength(); - - let _if: Types._else | null = null; - let _ifSet: bool = false; - - while (numFields > 0) { - numFields--; - const field = reader.readString(); - - reader.context().push(field, "unknown", "searching for property type"); - if (field == "if") { - reader.context().push(field, "Types._else", "type found, reading property"); - const object = Types._else.read(reader); - _if = object; - _ifSet = true; - reader.context().pop(); - } - reader.context().pop(); - } - - if (!_if || !_ifSet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'if: else'")); - } - - return { - _if: _if - }; -} - -export function serializeifArgs(args: Args__if): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) module-type: if Args"); - const sizer = new WriteSizer(sizerContext); - writeifArgs(sizer, args); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) module-type: if Args"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeifArgs(encoder, args); - return buffer; -} - -export function writeifArgs( - writer: Write, - args: Args__if -): void { - writer.writeMapLength(1); - writer.context().push("if", "Types._else", "writing property"); - writer.writeString("if"); - Types._else.write(writer, args._if); - writer.context().pop(); -} - -export function serializeifResult(result: Types._else): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) module-type: if Result"); - const sizer = new WriteSizer(sizerContext); - writeifResult(sizer, result); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) module-type: if Result"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeifResult(encoder, result); - return buffer; -} - -export function writeifResult(writer: Write, result: Types._else): void { - writer.context().push("if", "Types._else", "writing property"); - Types._else.write(writer, result); - writer.context().pop(); -} - -export function deserializeifResult(buffer: ArrayBuffer): Types._else { - const context: Context = new Context("Deserializing module-type: if Result"); - const reader = new ReadDecoder(buffer, context); - - reader.context().push("if", "Types._else", "reading function output"); - const object = Types._else.read(reader); - const res: Types._else = object; - reader.context().pop(); - - return res; -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/Module/wrapped.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/Module/wrapped.ts deleted file mode 100644 index cd9ca3ba74..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/Module/wrapped.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { wrap_load_env } from "@polywrap/wasm-as"; -import { - deserializemoduleMethodArgs, - serializemoduleMethodResult, - deserializeobjectMethodArgs, - serializeobjectMethodResult, - deserializeoptionalEnvMethodArgs, - serializeoptionalEnvMethodResult, - deserializeifArgs, - serializeifResult -} from "./serialization"; -import { ModuleBase } from "./module"; -import * as Types from ".."; - -export function moduleMethodWrapped(module: ModuleBase, argsBuf: ArrayBuffer, env_size: u32): ArrayBuffer { - const args = deserializemoduleMethodArgs(argsBuf); - - const result = module.moduleMethod( - { - str: args.str, - optStr: args.optStr, - en: args.en, - optEnum: args.optEnum, - enumArray: args.enumArray, - optEnumArray: args.optEnumArray, - map: args.map, - mapOfArr: args.mapOfArr, - mapOfMap: args.mapOfMap, - mapOfObj: args.mapOfObj, - mapOfArrOfObj: args.mapOfArrOfObj - } - ); - return serializemoduleMethodResult(result); -} - -export function objectMethodWrapped(module: ModuleBase, argsBuf: ArrayBuffer, env_size: u32): ArrayBuffer { - if (env_size == 0) { - throw new Error("Environment is not set, and it is required by method 'objectMethod'") - } - - const envBuf = wrap_load_env(env_size); - const env = Types.Env.fromBuffer(envBuf); - const args = deserializeobjectMethodArgs(argsBuf); - - const result = module.objectMethod( - { - object: args.object, - optObject: args.optObject, - objectArray: args.objectArray, - optObjectArray: args.optObjectArray - }, - env - ); - return serializeobjectMethodResult(result); -} - -export function optionalEnvMethodWrapped(module: ModuleBase, argsBuf: ArrayBuffer, env_size: u32): ArrayBuffer { - let env: Types.Env | null = null; - if (env_size > 0) { - const envBuf = wrap_load_env(env_size); - env = Types.Env.fromBuffer(envBuf); - } - const args = deserializeoptionalEnvMethodArgs(argsBuf); - - const result = module.optionalEnvMethod( - { - object: args.object, - optObject: args.optObject, - objectArray: args.objectArray, - optObjectArray: args.optObjectArray - }, - env - ); - return serializeoptionalEnvMethodResult(result); -} - -export function ifWrapped(module: ModuleBase, argsBuf: ArrayBuffer, env_size: u32): ArrayBuffer { - const args = deserializeifArgs(argsBuf); - - const result = module._if( - { - _if: args._if - } - ); - return serializeifResult(result); -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/TestImport/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/TestImport/index.ts deleted file mode 100644 index 64521e8cd6..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/TestImport/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { - wrap_getImplementations -} from "@polywrap/wasm-as"; - -export class TestImport { - static uri: string = "testimport.uri.eth" - - public static getImplementations(): string[] { - return wrap_getImplementations(this.uri); - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/else/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/else/index.ts deleted file mode 100644 index 48f590f30b..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/else/index.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { - Read, - Write, - Box, - BigInt, - BigNumber, - JSON -} from "@polywrap/wasm-as"; -import { - serializeelse, - deserializeelse, - writeelse, - readelse -} from "./serialization"; -import * as Types from ".."; - -export class _else { - _else: string; - - static toBuffer(type: _else): ArrayBuffer { - return serializeelse(type); - } - - static fromBuffer(buffer: ArrayBuffer): _else { - return deserializeelse(buffer); - } - - static write(writer: Write, type: _else): void { - writeelse(writer, type); - } - - static read(reader: Read): _else { - return readelse(reader); - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/else/serialization.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/else/serialization.ts deleted file mode 100644 index 08a0df0df3..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/else/serialization.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { - Read, - ReadDecoder, - Write, - WriteSizer, - WriteEncoder, - Box, - BigInt, - BigNumber, - JSON, - Context -} from "@polywrap/wasm-as"; -import { _else } from "./"; -import * as Types from ".."; - -export function serializeelse(type: _else): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) object-type: else"); - const sizer = new WriteSizer(sizerContext); - writeelse(sizer, type); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) object-type: else"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeelse(encoder, type); - return buffer; -} - -export function writeelse(writer: Write, type: _else): void { - writer.writeMapLength(1); - writer.context().push("else", "string", "writing property"); - writer.writeString("else"); - writer.writeString(type._else); - writer.context().pop(); -} - -export function deserializeelse(buffer: ArrayBuffer): _else { - const context: Context = new Context("Deserializing object-type else"); - const reader = new ReadDecoder(buffer, context); - return readelse(reader); -} - -export function readelse(reader: Read): _else { - let numFields = reader.readMapLength(); - - let _else: string = ""; - let _elseSet: bool = false; - - while (numFields > 0) { - numFields--; - const field = reader.readString(); - - reader.context().push(field, "unknown", "searching for property type"); - if (field == "else") { - reader.context().push(field, "string", "type found, reading property"); - _else = reader.readString(); - _elseSet = true; - reader.context().pop(); - } - reader.context().pop(); - } - - if (!_elseSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'else: String'")); - } - - return { - _else: _else - }; -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/entry.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/entry.ts deleted file mode 100644 index b68944d823..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/entry.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { - wrap_invoke_args, - wrap_invoke_result, - wrap_invoke_error, - wrap_abort, - InvokeArgs -} from "@polywrap/wasm-as"; - -import { - moduleMethodWrapped, - objectMethodWrapped, - optionalEnvMethodWrapped, - ifWrapped -} from "./Module/wrapped"; - -import { Module } from "../index"; - -export function _wrap_invoke(method_size: u32, args_size: u32, env_size: u32): bool { - const module = new Module(); - const args: InvokeArgs = wrap_invoke_args( - method_size, - args_size - ); - let result: ArrayBuffer; - if (args.method == "moduleMethod") { - result = moduleMethodWrapped(module, args.args, env_size); - } - else if (args.method == "objectMethod") { - result = objectMethodWrapped(module, args.args, env_size); - } - else if (args.method == "optionalEnvMethod") { - result = optionalEnvMethodWrapped(module, args.args, env_size); - } - else if (args.method == "if") { - result = ifWrapped(module, args.args, env_size); - } - else { - wrap_invoke_error( - `Could not find invoke function "${args.method}"` - ); - return false; - } - wrap_invoke_result(result); - return true; -} - -export function wrapAbort( - msg: string | null, - file: string | null, - line: u32, - column: u32 -): void { - wrap_abort( - msg ? msg : "", - file ? file : "", - line, - column - ); -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_AnotherObject/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_AnotherObject/index.ts deleted file mode 100644 index 54d80f554c..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_AnotherObject/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { - Read, - Write, - Box, - BigInt, - BigNumber, - JSON -} from "@polywrap/wasm-as"; -import { - serializeTestImport_AnotherObject, - deserializeTestImport_AnotherObject, - writeTestImport_AnotherObject, - readTestImport_AnotherObject -} from "./serialization"; -import * as Types from "../.."; - -export class TestImport_AnotherObject { - - public static uri: string = "testimport.uri.eth"; - - prop: string; - - static toBuffer(type: TestImport_AnotherObject): ArrayBuffer { - return serializeTestImport_AnotherObject(type); - } - - static fromBuffer(buffer: ArrayBuffer): TestImport_AnotherObject { - return deserializeTestImport_AnotherObject(buffer); - } - - static write(writer: Write, type: TestImport_AnotherObject): void { - writeTestImport_AnotherObject(writer, type); - } - - static read(reader: Read): TestImport_AnotherObject { - return readTestImport_AnotherObject(reader); - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_AnotherObject/serialization.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_AnotherObject/serialization.ts deleted file mode 100644 index 1835851b49..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_AnotherObject/serialization.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { - Read, - ReadDecoder, - Write, - WriteSizer, - WriteEncoder, - Box, - BigInt, - BigNumber, - JSON, - Context -} from "@polywrap/wasm-as"; -import { TestImport_AnotherObject } from "./"; -import * as Types from "../.."; - -export function serializeTestImport_AnotherObject(type: TestImport_AnotherObject): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) imported object-type: TestImport_AnotherObject"); - const sizer = new WriteSizer(sizerContext); - writeTestImport_AnotherObject(sizer, type); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) import object-type: TestImport_AnotherObject"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeTestImport_AnotherObject(encoder, type); - return buffer; -} - -export function writeTestImport_AnotherObject(writer: Write, type: TestImport_AnotherObject): void { - writer.writeMapLength(1); - writer.context().push("prop", "string", "writing property"); - writer.writeString("prop"); - writer.writeString(type.prop); - writer.context().pop(); -} - -export function deserializeTestImport_AnotherObject(buffer: ArrayBuffer): TestImport_AnotherObject { - const context: Context = new Context("Deserializing imported object-type TestImport_AnotherObject"); - const reader = new ReadDecoder(buffer, context); - return readTestImport_AnotherObject(reader); -} - -export function readTestImport_AnotherObject(reader: Read): TestImport_AnotherObject { - let numFields = reader.readMapLength(); - - let _prop: string = ""; - let _propSet: bool = false; - - while (numFields > 0) { - numFields--; - const field = reader.readString(); - - reader.context().push(field, "unknown", "searching for property type"); - if (field == "prop") { - reader.context().push(field, "string", "type found, reading property"); - _prop = reader.readString(); - _propSet = true; - reader.context().pop(); - } - reader.context().pop(); - } - - if (!_propSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'prop: String'")); - } - - return { - prop: _prop - }; -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Enum/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Enum/index.ts deleted file mode 100644 index b06028d316..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Enum/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -export enum TestImport_Enum { - STRING, - BYTES, - _MAX_ -} - -export function sanitizeTestImport_EnumValue(value: i32): void { - const valid = value >= 0 && value < TestImport_Enum._MAX_; - if (!valid) { - throw new Error("Invalid value for enum 'TestImport_Enum': " + value.toString()); - } -} - -export function getTestImport_EnumValue(key: string): TestImport_Enum { - if (key == "STRING") { - return TestImport_Enum.STRING; - } - if (key == "BYTES") { - return TestImport_Enum.BYTES; - } - - throw new Error("Invalid key for enum 'TestImport_Enum': " + key); -} - -export function getTestImport_EnumKey(value: TestImport_Enum): string { - sanitizeTestImport_EnumValue(value); - - switch (value) { - case TestImport_Enum.STRING: return "STRING"; - case TestImport_Enum.BYTES: return "BYTES"; - default: - throw new Error("Invalid value for enum 'TestImport_Enum': " + value.toString()); - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Enum_Return/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Enum_Return/index.ts deleted file mode 100644 index 6f9f65b1bd..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Enum_Return/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -export enum TestImport_Enum_Return { - STRING, - BYTES, - _MAX_ -} - -export function sanitizeTestImport_Enum_ReturnValue(value: i32): void { - const valid = value >= 0 && value < TestImport_Enum_Return._MAX_; - if (!valid) { - throw new Error("Invalid value for enum 'TestImport_Enum_Return': " + value.toString()); - } -} - -export function getTestImport_Enum_ReturnValue(key: string): TestImport_Enum_Return { - if (key == "STRING") { - return TestImport_Enum_Return.STRING; - } - if (key == "BYTES") { - return TestImport_Enum_Return.BYTES; - } - - throw new Error("Invalid key for enum 'TestImport_Enum_Return': " + key); -} - -export function getTestImport_Enum_ReturnKey(value: TestImport_Enum_Return): string { - sanitizeTestImport_Enum_ReturnValue(value); - - switch (value) { - case TestImport_Enum_Return.STRING: return "STRING"; - case TestImport_Enum_Return.BYTES: return "BYTES"; - default: - throw new Error("Invalid value for enum 'TestImport_Enum_Return': " + value.toString()); - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Env/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Env/index.ts deleted file mode 100644 index 13da9f9059..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Env/index.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { - Read, - Write, - Box, - BigInt, - BigNumber, - JSON, -} from "@polywrap/wasm-as"; -import { - serializeTestImport_Env, - deserializeTestImport_Env, - writeTestImport_Env, - readTestImport_Env -} from "./serialization"; -import * as Types from "../.."; - -@serializable -export class TestImport_Env { - - public static uri: string = "testimport.uri.eth"; - - object: Types.TestImport_AnotherObject; - optObject: Types.TestImport_AnotherObject | null; - objectArray: Array; - optObjectArray: Array | null; - en: Types.TestImport_Enum; - optEnum: Box | null; - enumArray: Array; - optEnumArray: Array | null> | null; - - static toBuffer(type: TestImport_Env): ArrayBuffer { - return serializeTestImport_Env(type); - } - - static fromBuffer(buffer: ArrayBuffer): TestImport_Env { - return deserializeTestImport_Env(buffer); - } - - static write(writer: Write, type: TestImport_Env): void { - writeTestImport_Env(writer, type); - } - - static read(reader: Read): TestImport_Env { - return readTestImport_Env(reader); - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Env/serialization.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Env/serialization.ts deleted file mode 100644 index f86f58f15c..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Env/serialization.ts +++ /dev/null @@ -1,238 +0,0 @@ -import { - Read, - ReadDecoder, - Write, - WriteSizer, - WriteEncoder, - Box, - BigInt, - BigNumber, - JSON, - Context -} from "@polywrap/wasm-as"; -import { TestImport_Env } from "./"; -import * as Types from "../.."; - -export function serializeTestImport_Env(type: TestImport_Env): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) imported env-type: TestImport_Env"); - const sizer = new WriteSizer(sizerContext); - writeTestImport_Env(sizer, type); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) imported env-type: TestImport_Env"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeTestImport_Env(encoder, type); - return buffer; -} - -export function writeTestImport_Env(writer: Write, type: TestImport_Env): void { - writer.writeMapLength(8); - writer.context().push("object", "Types.TestImport_AnotherObject", "writing property"); - writer.writeString("object"); - Types.TestImport_AnotherObject.write(writer, type.object); - writer.context().pop(); - writer.context().push("optObject", "Types.TestImport_AnotherObject | null", "writing property"); - writer.writeString("optObject"); - if (type.optObject) { - Types.TestImport_AnotherObject.write(writer, type.optObject as Types.TestImport_AnotherObject); - } else { - writer.writeNil(); - } - writer.context().pop(); - writer.context().push("objectArray", "Array", "writing property"); - writer.writeString("objectArray"); - writer.writeArray(type.objectArray, (writer: Write, item: Types.TestImport_AnotherObject): void => { - Types.TestImport_AnotherObject.write(writer, item); - }); - writer.context().pop(); - writer.context().push("optObjectArray", "Array | null", "writing property"); - writer.writeString("optObjectArray"); - writer.writeOptionalArray(type.optObjectArray, (writer: Write, item: Types.TestImport_AnotherObject | null): void => { - if (item) { - Types.TestImport_AnotherObject.write(writer, item as Types.TestImport_AnotherObject); - } else { - writer.writeNil(); - } - }); - writer.context().pop(); - writer.context().push("en", "Types.TestImport_Enum", "writing property"); - writer.writeString("en"); - writer.writeInt32(type.en); - writer.context().pop(); - writer.context().push("optEnum", "Box | null", "writing property"); - writer.writeString("optEnum"); - writer.writeOptionalInt32(type.optEnum); - writer.context().pop(); - writer.context().push("enumArray", "Array", "writing property"); - writer.writeString("enumArray"); - writer.writeArray(type.enumArray, (writer: Write, item: Types.TestImport_Enum): void => { - writer.writeInt32(item); - }); - writer.context().pop(); - writer.context().push("optEnumArray", "Array | null> | null", "writing property"); - writer.writeString("optEnumArray"); - writer.writeOptionalArray(type.optEnumArray, (writer: Write, item: Box | null): void => { - writer.writeOptionalInt32(item); - }); - writer.context().pop(); -} - -export function deserializeTestImport_Env(buffer: ArrayBuffer): TestImport_Env { - const context: Context = new Context("Deserializing imported env-type TestImport_Env"); - const reader = new ReadDecoder(buffer, context); - return readTestImport_Env(reader); -} - -export function readTestImport_Env(reader: Read): TestImport_Env { - let numFields = reader.readMapLength(); - - let _object: Types.TestImport_AnotherObject | null = null; - let _objectSet: bool = false; - let _optObject: Types.TestImport_AnotherObject | null = null; - let _objectArray: Array = []; - let _objectArraySet: bool = false; - let _optObjectArray: Array | null = null; - let _en: Types.TestImport_Enum = 0; - let _enSet: bool = false; - let _optEnum: Box | null = null; - let _enumArray: Array = []; - let _enumArraySet: bool = false; - let _optEnumArray: Array | null> | null = null; - - while (numFields > 0) { - numFields--; - const field = reader.readString(); - - reader.context().push(field, "unknown", "searching for property type"); - if (field == "object") { - reader.context().push(field, "Types.TestImport_AnotherObject", "type found, reading property"); - const object = Types.TestImport_AnotherObject.read(reader); - _object = object; - _objectSet = true; - reader.context().pop(); - } - else if (field == "optObject") { - reader.context().push(field, "Types.TestImport_AnotherObject | null", "type found, reading property"); - let object: Types.TestImport_AnotherObject | null = null; - if (!reader.isNextNil()) { - object = Types.TestImport_AnotherObject.read(reader); - } - _optObject = object; - reader.context().pop(); - } - else if (field == "objectArray") { - reader.context().push(field, "Array", "type found, reading property"); - _objectArray = reader.readArray((reader: Read): Types.TestImport_AnotherObject => { - const object = Types.TestImport_AnotherObject.read(reader); - return object; - }); - _objectArraySet = true; - reader.context().pop(); - } - else if (field == "optObjectArray") { - reader.context().push(field, "Array | null", "type found, reading property"); - _optObjectArray = reader.readOptionalArray((reader: Read): Types.TestImport_AnotherObject | null => { - let object: Types.TestImport_AnotherObject | null = null; - if (!reader.isNextNil()) { - object = Types.TestImport_AnotherObject.read(reader); - } - return object; - }); - reader.context().pop(); - } - else if (field == "en") { - reader.context().push(field, "Types.TestImport_Enum", "type found, reading property"); - let value: Types.TestImport_Enum; - if (reader.isNextString()) { - value = Types.getTestImport_EnumValue(reader.readString()); - } else { - value = reader.readInt32(); - Types.sanitizeTestImport_EnumValue(value); - } - _en = value; - _enSet = true; - reader.context().pop(); - } - else if (field == "optEnum") { - reader.context().push(field, "Box | null", "type found, reading property"); - let value: Box | null; - if (!reader.isNextNil()) { - if (reader.isNextString()) { - value = Box.from( - Types.getTestImport_EnumValue(reader.readString()) - ); - } else { - value = Box.from( - reader.readInt32() - ); - Types.sanitizeTestImport_EnumValue(value.unwrap()); - } - } else { - value = null; - } - _optEnum = value; - reader.context().pop(); - } - else if (field == "enumArray") { - reader.context().push(field, "Array", "type found, reading property"); - _enumArray = reader.readArray((reader: Read): Types.TestImport_Enum => { - let value: Types.TestImport_Enum; - if (reader.isNextString()) { - value = Types.getTestImport_EnumValue(reader.readString()); - } else { - value = reader.readInt32(); - Types.sanitizeTestImport_EnumValue(value); - } - return value; - }); - _enumArraySet = true; - reader.context().pop(); - } - else if (field == "optEnumArray") { - reader.context().push(field, "Array | null> | null", "type found, reading property"); - _optEnumArray = reader.readOptionalArray((reader: Read): Box | null => { - let value: Box | null; - if (!reader.isNextNil()) { - if (reader.isNextString()) { - value = Box.from( - Types.getTestImport_EnumValue(reader.readString()) - ); - } else { - value = Box.from( - reader.readInt32() - ); - Types.sanitizeTestImport_EnumValue(value.unwrap()); - } - } else { - value = null; - } - return value; - }); - reader.context().pop(); - } - reader.context().pop(); - } - - if (!_object || !_objectSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'object: TestImport_AnotherObject'")); - } - if (!_objectArraySet) { - throw new Error(reader.context().printWithContext("Missing required property: 'objectArray: [TestImport_AnotherObject]'")); - } - if (!_enSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'en: TestImport_Enum'")); - } - if (!_enumArraySet) { - throw new Error(reader.context().printWithContext("Missing required property: 'enumArray: [TestImport_Enum]'")); - } - - return { - object: _object, - optObject: _optObject, - objectArray: _objectArray, - optObjectArray: _optObjectArray, - en: _en, - optEnum: _optEnum, - enumArray: _enumArray, - optEnumArray: _optEnumArray - }; -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Module/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Module/index.ts deleted file mode 100644 index f924a389c9..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Module/index.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { - wrap_subinvoke, - wrap_subinvokeImplementation, - Box, - BigInt, - BigNumber, - JSON, - Result -} from "@polywrap/wasm-as"; -import { - serializeimportedMethodArgs, - deserializeimportedMethodResult, - Args_importedMethod, - serializeanotherMethodArgs, - deserializeanotherMethodResult, - Args_anotherMethod, - serializereturnsArrayOfEnumsArgs, - deserializereturnsArrayOfEnumsResult, - Args_returnsArrayOfEnums -} from "./serialization"; -import * as Types from "../.."; - -export class TestImport_Module { - - public static interfaceUri: string = "testimport.uri.eth"; - - public uri: string; - - constructor(uri: string) { - this.uri = uri; - } - - public importedMethod( - args: Args_importedMethod - ): Result { - const argsBuf = serializeimportedMethodArgs(args); - const result = wrap_subinvokeImplementation( - "testimport.uri.eth", - this.uri, - "importedMethod", - argsBuf - ); - - if (result.isErr) { - return Result.Err( - result.unwrapErr() - ); - } - - return Result.Ok( - deserializeimportedMethodResult(result.unwrap()) - ); - } - - public anotherMethod( - args: Args_anotherMethod - ): Result { - const argsBuf = serializeanotherMethodArgs(args); - const result = wrap_subinvokeImplementation( - "testimport.uri.eth", - this.uri, - "anotherMethod", - argsBuf - ); - - if (result.isErr) { - return Result.Err( - result.unwrapErr() - ); - } - - return Result.Ok( - deserializeanotherMethodResult(result.unwrap()) - ); - } - - public returnsArrayOfEnums( - args: Args_returnsArrayOfEnums - ): Result | null>, string> { - const argsBuf = serializereturnsArrayOfEnumsArgs(args); - const result = wrap_subinvokeImplementation( - "testimport.uri.eth", - this.uri, - "returnsArrayOfEnums", - argsBuf - ); - - if (result.isErr) { - return Result.Err | null>, string>( - result.unwrapErr() - ); - } - - return Result.Ok | null>, string>( - deserializereturnsArrayOfEnumsResult(result.unwrap()) - ); - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Module/serialization.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Module/serialization.ts deleted file mode 100644 index ff0a51b0db..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Module/serialization.ts +++ /dev/null @@ -1,559 +0,0 @@ -import { - Read, - ReadDecoder, - Write, - WriteSizer, - WriteEncoder, - Box, - BigInt, - BigNumber, - JSON, - Context -} from "@polywrap/wasm-as"; -import * as Types from "../.."; - -export class Args_importedMethod { - str: string; - optStr: string | null; - u: u32; - optU: Box | null; - uArrayArray: Array | null> | null>; - object: Types.TestImport_Object; - optObject: Types.TestImport_Object | null; - objectArray: Array; - optObjectArray: Array | null; - en: Types.TestImport_Enum; - optEnum: Box | null; - enumArray: Array; - optEnumArray: Array | null> | null; -} - -export function deserializeimportedMethodArgs(argsBuf: ArrayBuffer): Args_importedMethod { - const context: Context = new Context("Deserializing imported module-type: importedMethod Args"); - const reader = new ReadDecoder(argsBuf, context); - let numFields = reader.readMapLength(); - - let _str: string = ""; - let _strSet: bool = false; - let _optStr: string | null = null; - let _u: u32 = 0; - let _uSet: bool = false; - let _optU: Box | null = null; - let _uArrayArray: Array | null> | null> = []; - let _uArrayArraySet: bool = false; - let _object: Types.TestImport_Object | null = null; - let _objectSet: bool = false; - let _optObject: Types.TestImport_Object | null = null; - let _objectArray: Array = []; - let _objectArraySet: bool = false; - let _optObjectArray: Array | null = null; - let _en: Types.TestImport_Enum = 0; - let _enSet: bool = false; - let _optEnum: Box | null = null; - let _enumArray: Array = []; - let _enumArraySet: bool = false; - let _optEnumArray: Array | null> | null = null; - - while (numFields > 0) { - numFields--; - const field = reader.readString(); - - reader.context().push(field, "unknown", "searching for property type"); - if (field == "str") { - reader.context().push(field, "string", "type found, reading property"); - _str = reader.readString(); - _strSet = true; - reader.context().pop(); - } - else if (field == "optStr") { - reader.context().push(field, "string | null", "type found, reading property"); - _optStr = reader.readOptionalString(); - reader.context().pop(); - } - else if (field == "u") { - reader.context().push(field, "u32", "type found, reading property"); - _u = reader.readUInt32(); - _uSet = true; - reader.context().pop(); - } - else if (field == "optU") { - reader.context().push(field, "Box | null", "type found, reading property"); - _optU = reader.readOptionalUInt32(); - reader.context().pop(); - } - else if (field == "uArrayArray") { - reader.context().push(field, "Array | null> | null>", "type found, reading property"); - _uArrayArray = reader.readArray((reader: Read): Array | null> | null => { - return reader.readOptionalArray((reader: Read): Box | null => { - return reader.readOptionalUInt32(); - }); - }); - _uArrayArraySet = true; - reader.context().pop(); - } - else if (field == "object") { - reader.context().push(field, "Types.TestImport_Object", "type found, reading property"); - const object = Types.TestImport_Object.read(reader); - _object = object; - _objectSet = true; - reader.context().pop(); - } - else if (field == "optObject") { - reader.context().push(field, "Types.TestImport_Object | null", "type found, reading property"); - let object: Types.TestImport_Object | null = null; - if (!reader.isNextNil()) { - object = Types.TestImport_Object.read(reader); - } - _optObject = object; - reader.context().pop(); - } - else if (field == "objectArray") { - reader.context().push(field, "Array", "type found, reading property"); - _objectArray = reader.readArray((reader: Read): Types.TestImport_Object => { - const object = Types.TestImport_Object.read(reader); - return object; - }); - _objectArraySet = true; - reader.context().pop(); - } - else if (field == "optObjectArray") { - reader.context().push(field, "Array | null", "type found, reading property"); - _optObjectArray = reader.readOptionalArray((reader: Read): Types.TestImport_Object | null => { - let object: Types.TestImport_Object | null = null; - if (!reader.isNextNil()) { - object = Types.TestImport_Object.read(reader); - } - return object; - }); - reader.context().pop(); - } - else if (field == "en") { - reader.context().push(field, "Types.TestImport_Enum", "type found, reading property"); - let value: Types.TestImport_Enum; - if (reader.isNextString()) { - value = Types.getTestImport_EnumValue(reader.readString()); - } else { - value = reader.readInt32(); - Types.sanitizeTestImport_EnumValue(value); - } - _en = value; - _enSet = true; - reader.context().pop(); - } - else if (field == "optEnum") { - reader.context().push(field, "Box | null", "type found, reading property"); - let value: Box | null; - if (!reader.isNextNil()) { - if (reader.isNextString()) { - value = Box.from( - Types.getTestImport_EnumValue(reader.readString()) - ); - } else { - value = Box.from( - reader.readInt32() - ); - Types.sanitizeTestImport_EnumValue(value.unwrap()); - } - } else { - value = null; - } - _optEnum = value; - reader.context().pop(); - } - else if (field == "enumArray") { - reader.context().push(field, "Array", "type found, reading property"); - _enumArray = reader.readArray((reader: Read): Types.TestImport_Enum => { - let value: Types.TestImport_Enum; - if (reader.isNextString()) { - value = Types.getTestImport_EnumValue(reader.readString()); - } else { - value = reader.readInt32(); - Types.sanitizeTestImport_EnumValue(value); - } - return value; - }); - _enumArraySet = true; - reader.context().pop(); - } - else if (field == "optEnumArray") { - reader.context().push(field, "Array | null> | null", "type found, reading property"); - _optEnumArray = reader.readOptionalArray((reader: Read): Box | null => { - let value: Box | null; - if (!reader.isNextNil()) { - if (reader.isNextString()) { - value = Box.from( - Types.getTestImport_EnumValue(reader.readString()) - ); - } else { - value = Box.from( - reader.readInt32() - ); - Types.sanitizeTestImport_EnumValue(value.unwrap()); - } - } else { - value = null; - } - return value; - }); - reader.context().pop(); - } - reader.context().pop(); - } - - if (!_strSet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'str: String'")); - } - if (!_uSet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'u: UInt'")); - } - if (!_uArrayArraySet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'uArrayArray: [[UInt]]'")); - } - if (!_object || !_objectSet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'object: TestImport_Object'")); - } - if (!_objectArraySet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'objectArray: [TestImport_Object]'")); - } - if (!_enSet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'en: TestImport_Enum'")); - } - if (!_enumArraySet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'enumArray: [TestImport_Enum]'")); - } - - return { - str: _str, - optStr: _optStr, - u: _u, - optU: _optU, - uArrayArray: _uArrayArray, - object: _object, - optObject: _optObject, - objectArray: _objectArray, - optObjectArray: _optObjectArray, - en: _en, - optEnum: _optEnum, - enumArray: _enumArray, - optEnumArray: _optEnumArray - }; -} - -export function serializeimportedMethodArgs(args: Args_importedMethod): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) imported module-type: importedMethod Args"); - const sizer = new WriteSizer(sizerContext); - writeimportedMethodArgs(sizer, args); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) imported module-type: importedMethod Args"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeimportedMethodArgs(encoder, args); - return buffer; -} - -export function writeimportedMethodArgs( - writer: Write, - args: Args_importedMethod -): void { - writer.writeMapLength(13); - writer.context().push("str", "string", "writing property"); - writer.writeString("str"); - writer.writeString(args.str); - writer.context().pop(); - writer.context().push("optStr", "string | null", "writing property"); - writer.writeString("optStr"); - writer.writeOptionalString(args.optStr); - writer.context().pop(); - writer.context().push("u", "u32", "writing property"); - writer.writeString("u"); - writer.writeUInt32(args.u); - writer.context().pop(); - writer.context().push("optU", "Box | null", "writing property"); - writer.writeString("optU"); - writer.writeOptionalUInt32(args.optU); - writer.context().pop(); - writer.context().push("uArrayArray", "Array | null> | null>", "writing property"); - writer.writeString("uArrayArray"); - writer.writeArray(args.uArrayArray, (writer: Write, item: Array | null> | null): void => { - writer.writeOptionalArray(item, (writer: Write, item: Box | null): void => { - writer.writeOptionalUInt32(item); - }); - }); - writer.context().pop(); - writer.context().push("object", "Types.TestImport_Object", "writing property"); - writer.writeString("object"); - Types.TestImport_Object.write(writer, args.object); - writer.context().pop(); - writer.context().push("optObject", "Types.TestImport_Object | null", "writing property"); - writer.writeString("optObject"); - if (args.optObject) { - Types.TestImport_Object.write(writer, args.optObject as Types.TestImport_Object); - } else { - writer.writeNil(); - } - writer.context().pop(); - writer.context().push("objectArray", "Array", "writing property"); - writer.writeString("objectArray"); - writer.writeArray(args.objectArray, (writer: Write, item: Types.TestImport_Object): void => { - Types.TestImport_Object.write(writer, item); - }); - writer.context().pop(); - writer.context().push("optObjectArray", "Array | null", "writing property"); - writer.writeString("optObjectArray"); - writer.writeOptionalArray(args.optObjectArray, (writer: Write, item: Types.TestImport_Object | null): void => { - if (item) { - Types.TestImport_Object.write(writer, item as Types.TestImport_Object); - } else { - writer.writeNil(); - } - }); - writer.context().pop(); - writer.context().push("en", "Types.TestImport_Enum", "writing property"); - writer.writeString("en"); - writer.writeInt32(args.en); - writer.context().pop(); - writer.context().push("optEnum", "Box | null", "writing property"); - writer.writeString("optEnum"); - writer.writeOptionalInt32(args.optEnum); - writer.context().pop(); - writer.context().push("enumArray", "Array", "writing property"); - writer.writeString("enumArray"); - writer.writeArray(args.enumArray, (writer: Write, item: Types.TestImport_Enum): void => { - writer.writeInt32(item); - }); - writer.context().pop(); - writer.context().push("optEnumArray", "Array | null> | null", "writing property"); - writer.writeString("optEnumArray"); - writer.writeOptionalArray(args.optEnumArray, (writer: Write, item: Box | null): void => { - writer.writeOptionalInt32(item); - }); - writer.context().pop(); -} - -export function serializeimportedMethodResult(result: Types.TestImport_Object | null): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) imported module-type: importedMethod Result"); - const sizer = new WriteSizer(sizerContext); - writeimportedMethodResult(sizer, result); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) imported module-type: importedMethod Result"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeimportedMethodResult(encoder, result); - return buffer; -} - -export function writeimportedMethodResult(writer: Write, result: Types.TestImport_Object | null): void { - writer.context().push("importedMethod", "Types.TestImport_Object | null", "writing property"); - if (result) { - Types.TestImport_Object.write(writer, result as Types.TestImport_Object); - } else { - writer.writeNil(); - } - writer.context().pop(); -} - -export function deserializeimportedMethodResult(buffer: ArrayBuffer): Types.TestImport_Object | null { - const context: Context = new Context("Deserializing imported module-type: importedMethod Result"); - const reader = new ReadDecoder(buffer, context); - - reader.context().push("importedMethod", "Types.TestImport_Object | null", "reading function output"); - let object: Types.TestImport_Object | null = null; - if (!reader.isNextNil()) { - object = Types.TestImport_Object.read(reader); - } - const res: Types.TestImport_Object | null = object; - reader.context().pop(); - - return res; -} - -export class Args_anotherMethod { - arg: Array; -} - -export function deserializeanotherMethodArgs(argsBuf: ArrayBuffer): Args_anotherMethod { - const context: Context = new Context("Deserializing imported module-type: anotherMethod Args"); - const reader = new ReadDecoder(argsBuf, context); - let numFields = reader.readMapLength(); - - let _arg: Array = []; - let _argSet: bool = false; - - while (numFields > 0) { - numFields--; - const field = reader.readString(); - - reader.context().push(field, "unknown", "searching for property type"); - if (field == "arg") { - reader.context().push(field, "Array", "type found, reading property"); - _arg = reader.readArray((reader: Read): string => { - return reader.readString(); - }); - _argSet = true; - reader.context().pop(); - } - reader.context().pop(); - } - - if (!_argSet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'arg: [String]'")); - } - - return { - arg: _arg - }; -} - -export function serializeanotherMethodArgs(args: Args_anotherMethod): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) imported module-type: anotherMethod Args"); - const sizer = new WriteSizer(sizerContext); - writeanotherMethodArgs(sizer, args); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) imported module-type: anotherMethod Args"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeanotherMethodArgs(encoder, args); - return buffer; -} - -export function writeanotherMethodArgs( - writer: Write, - args: Args_anotherMethod -): void { - writer.writeMapLength(1); - writer.context().push("arg", "Array", "writing property"); - writer.writeString("arg"); - writer.writeArray(args.arg, (writer: Write, item: string): void => { - writer.writeString(item); - }); - writer.context().pop(); -} - -export function serializeanotherMethodResult(result: i32): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) imported module-type: anotherMethod Result"); - const sizer = new WriteSizer(sizerContext); - writeanotherMethodResult(sizer, result); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) imported module-type: anotherMethod Result"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeanotherMethodResult(encoder, result); - return buffer; -} - -export function writeanotherMethodResult(writer: Write, result: i32): void { - writer.context().push("anotherMethod", "i32", "writing property"); - writer.writeInt32(result); - writer.context().pop(); -} - -export function deserializeanotherMethodResult(buffer: ArrayBuffer): i32 { - const context: Context = new Context("Deserializing imported module-type: anotherMethod Result"); - const reader = new ReadDecoder(buffer, context); - - reader.context().push("anotherMethod", "i32", "reading function output"); - const res: i32 = reader.readInt32(); - reader.context().pop(); - - return res; -} - -export class Args_returnsArrayOfEnums { - arg: string; -} - -export function deserializereturnsArrayOfEnumsArgs(argsBuf: ArrayBuffer): Args_returnsArrayOfEnums { - const context: Context = new Context("Deserializing imported module-type: returnsArrayOfEnums Args"); - const reader = new ReadDecoder(argsBuf, context); - let numFields = reader.readMapLength(); - - let _arg: string = ""; - let _argSet: bool = false; - - while (numFields > 0) { - numFields--; - const field = reader.readString(); - - reader.context().push(field, "unknown", "searching for property type"); - if (field == "arg") { - reader.context().push(field, "string", "type found, reading property"); - _arg = reader.readString(); - _argSet = true; - reader.context().pop(); - } - reader.context().pop(); - } - - if (!_argSet) { - throw new Error(reader.context().printWithContext("Missing required argument: 'arg: String'")); - } - - return { - arg: _arg - }; -} - -export function serializereturnsArrayOfEnumsArgs(args: Args_returnsArrayOfEnums): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) imported module-type: returnsArrayOfEnums Args"); - const sizer = new WriteSizer(sizerContext); - writereturnsArrayOfEnumsArgs(sizer, args); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) imported module-type: returnsArrayOfEnums Args"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writereturnsArrayOfEnumsArgs(encoder, args); - return buffer; -} - -export function writereturnsArrayOfEnumsArgs( - writer: Write, - args: Args_returnsArrayOfEnums -): void { - writer.writeMapLength(1); - writer.context().push("arg", "string", "writing property"); - writer.writeString("arg"); - writer.writeString(args.arg); - writer.context().pop(); -} - -export function serializereturnsArrayOfEnumsResult(result: Array | null>): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) imported module-type: returnsArrayOfEnums Result"); - const sizer = new WriteSizer(sizerContext); - writereturnsArrayOfEnumsResult(sizer, result); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) imported module-type: returnsArrayOfEnums Result"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writereturnsArrayOfEnumsResult(encoder, result); - return buffer; -} - -export function writereturnsArrayOfEnumsResult(writer: Write, result: Array | null>): void { - writer.context().push("returnsArrayOfEnums", "Array | null>", "writing property"); - writer.writeArray(result, (writer: Write, item: Box | null): void => { - writer.writeOptionalInt32(item); - }); - writer.context().pop(); -} - -export function deserializereturnsArrayOfEnumsResult(buffer: ArrayBuffer): Array | null> { - const context: Context = new Context("Deserializing imported module-type: returnsArrayOfEnums Result"); - const reader = new ReadDecoder(buffer, context); - - reader.context().push("returnsArrayOfEnums", "Array | null>", "reading function output"); - const res: Array | null> = reader.readArray((reader: Read): Box | null => { - let value: Box | null; - if (!reader.isNextNil()) { - if (reader.isNextString()) { - value = Box.from( - Types.getTestImport_Enum_ReturnValue(reader.readString()) - ); - } else { - value = Box.from( - reader.readInt32() - ); - Types.sanitizeTestImport_Enum_ReturnValue(value.unwrap()); - } - } else { - value = null; - } - return value; - }); - reader.context().pop(); - - return res; -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Object/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Object/index.ts deleted file mode 100644 index 984be2af32..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Object/index.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { - Read, - Write, - Box, - BigInt, - BigNumber, - JSON -} from "@polywrap/wasm-as"; -import { - serializeTestImport_Object, - deserializeTestImport_Object, - writeTestImport_Object, - readTestImport_Object -} from "./serialization"; -import * as Types from "../.."; - -export class TestImport_Object { - - public static uri: string = "testimport.uri.eth"; - - object: Types.TestImport_AnotherObject; - optObject: Types.TestImport_AnotherObject | null; - objectArray: Array; - optObjectArray: Array | null; - en: Types.TestImport_Enum; - optEnum: Box | null; - enumArray: Array; - optEnumArray: Array | null> | null; - - static toBuffer(type: TestImport_Object): ArrayBuffer { - return serializeTestImport_Object(type); - } - - static fromBuffer(buffer: ArrayBuffer): TestImport_Object { - return deserializeTestImport_Object(buffer); - } - - static write(writer: Write, type: TestImport_Object): void { - writeTestImport_Object(writer, type); - } - - static read(reader: Read): TestImport_Object { - return readTestImport_Object(reader); - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Object/serialization.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Object/serialization.ts deleted file mode 100644 index b243ba964a..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/TestImport_Object/serialization.ts +++ /dev/null @@ -1,238 +0,0 @@ -import { - Read, - ReadDecoder, - Write, - WriteSizer, - WriteEncoder, - Box, - BigInt, - BigNumber, - JSON, - Context -} from "@polywrap/wasm-as"; -import { TestImport_Object } from "./"; -import * as Types from "../.."; - -export function serializeTestImport_Object(type: TestImport_Object): ArrayBuffer { - const sizerContext: Context = new Context("Serializing (sizing) imported object-type: TestImport_Object"); - const sizer = new WriteSizer(sizerContext); - writeTestImport_Object(sizer, type); - const buffer = new ArrayBuffer(sizer.length); - const encoderContext: Context = new Context("Serializing (encoding) import object-type: TestImport_Object"); - const encoder = new WriteEncoder(buffer, sizer, encoderContext); - writeTestImport_Object(encoder, type); - return buffer; -} - -export function writeTestImport_Object(writer: Write, type: TestImport_Object): void { - writer.writeMapLength(8); - writer.context().push("object", "Types.TestImport_AnotherObject", "writing property"); - writer.writeString("object"); - Types.TestImport_AnotherObject.write(writer, type.object); - writer.context().pop(); - writer.context().push("optObject", "Types.TestImport_AnotherObject | null", "writing property"); - writer.writeString("optObject"); - if (type.optObject) { - Types.TestImport_AnotherObject.write(writer, type.optObject as Types.TestImport_AnotherObject); - } else { - writer.writeNil(); - } - writer.context().pop(); - writer.context().push("objectArray", "Array", "writing property"); - writer.writeString("objectArray"); - writer.writeArray(type.objectArray, (writer: Write, item: Types.TestImport_AnotherObject): void => { - Types.TestImport_AnotherObject.write(writer, item); - }); - writer.context().pop(); - writer.context().push("optObjectArray", "Array | null", "writing property"); - writer.writeString("optObjectArray"); - writer.writeOptionalArray(type.optObjectArray, (writer: Write, item: Types.TestImport_AnotherObject | null): void => { - if (item) { - Types.TestImport_AnotherObject.write(writer, item as Types.TestImport_AnotherObject); - } else { - writer.writeNil(); - } - }); - writer.context().pop(); - writer.context().push("en", "Types.TestImport_Enum", "writing property"); - writer.writeString("en"); - writer.writeInt32(type.en); - writer.context().pop(); - writer.context().push("optEnum", "Box | null", "writing property"); - writer.writeString("optEnum"); - writer.writeOptionalInt32(type.optEnum); - writer.context().pop(); - writer.context().push("enumArray", "Array", "writing property"); - writer.writeString("enumArray"); - writer.writeArray(type.enumArray, (writer: Write, item: Types.TestImport_Enum): void => { - writer.writeInt32(item); - }); - writer.context().pop(); - writer.context().push("optEnumArray", "Array | null> | null", "writing property"); - writer.writeString("optEnumArray"); - writer.writeOptionalArray(type.optEnumArray, (writer: Write, item: Box | null): void => { - writer.writeOptionalInt32(item); - }); - writer.context().pop(); -} - -export function deserializeTestImport_Object(buffer: ArrayBuffer): TestImport_Object { - const context: Context = new Context("Deserializing imported object-type TestImport_Object"); - const reader = new ReadDecoder(buffer, context); - return readTestImport_Object(reader); -} - -export function readTestImport_Object(reader: Read): TestImport_Object { - let numFields = reader.readMapLength(); - - let _object: Types.TestImport_AnotherObject | null = null; - let _objectSet: bool = false; - let _optObject: Types.TestImport_AnotherObject | null = null; - let _objectArray: Array = []; - let _objectArraySet: bool = false; - let _optObjectArray: Array | null = null; - let _en: Types.TestImport_Enum = 0; - let _enSet: bool = false; - let _optEnum: Box | null = null; - let _enumArray: Array = []; - let _enumArraySet: bool = false; - let _optEnumArray: Array | null> | null = null; - - while (numFields > 0) { - numFields--; - const field = reader.readString(); - - reader.context().push(field, "unknown", "searching for property type"); - if (field == "object") { - reader.context().push(field, "Types.TestImport_AnotherObject", "type found, reading property"); - const object = Types.TestImport_AnotherObject.read(reader); - _object = object; - _objectSet = true; - reader.context().pop(); - } - else if (field == "optObject") { - reader.context().push(field, "Types.TestImport_AnotherObject | null", "type found, reading property"); - let object: Types.TestImport_AnotherObject | null = null; - if (!reader.isNextNil()) { - object = Types.TestImport_AnotherObject.read(reader); - } - _optObject = object; - reader.context().pop(); - } - else if (field == "objectArray") { - reader.context().push(field, "Array", "type found, reading property"); - _objectArray = reader.readArray((reader: Read): Types.TestImport_AnotherObject => { - const object = Types.TestImport_AnotherObject.read(reader); - return object; - }); - _objectArraySet = true; - reader.context().pop(); - } - else if (field == "optObjectArray") { - reader.context().push(field, "Array | null", "type found, reading property"); - _optObjectArray = reader.readOptionalArray((reader: Read): Types.TestImport_AnotherObject | null => { - let object: Types.TestImport_AnotherObject | null = null; - if (!reader.isNextNil()) { - object = Types.TestImport_AnotherObject.read(reader); - } - return object; - }); - reader.context().pop(); - } - else if (field == "en") { - reader.context().push(field, "Types.TestImport_Enum", "type found, reading property"); - let value: Types.TestImport_Enum; - if (reader.isNextString()) { - value = Types.getTestImport_EnumValue(reader.readString()); - } else { - value = reader.readInt32(); - Types.sanitizeTestImport_EnumValue(value); - } - _en = value; - _enSet = true; - reader.context().pop(); - } - else if (field == "optEnum") { - reader.context().push(field, "Box | null", "type found, reading property"); - let value: Box | null; - if (!reader.isNextNil()) { - if (reader.isNextString()) { - value = Box.from( - Types.getTestImport_EnumValue(reader.readString()) - ); - } else { - value = Box.from( - reader.readInt32() - ); - Types.sanitizeTestImport_EnumValue(value.unwrap()); - } - } else { - value = null; - } - _optEnum = value; - reader.context().pop(); - } - else if (field == "enumArray") { - reader.context().push(field, "Array", "type found, reading property"); - _enumArray = reader.readArray((reader: Read): Types.TestImport_Enum => { - let value: Types.TestImport_Enum; - if (reader.isNextString()) { - value = Types.getTestImport_EnumValue(reader.readString()); - } else { - value = reader.readInt32(); - Types.sanitizeTestImport_EnumValue(value); - } - return value; - }); - _enumArraySet = true; - reader.context().pop(); - } - else if (field == "optEnumArray") { - reader.context().push(field, "Array | null> | null", "type found, reading property"); - _optEnumArray = reader.readOptionalArray((reader: Read): Box | null => { - let value: Box | null; - if (!reader.isNextNil()) { - if (reader.isNextString()) { - value = Box.from( - Types.getTestImport_EnumValue(reader.readString()) - ); - } else { - value = Box.from( - reader.readInt32() - ); - Types.sanitizeTestImport_EnumValue(value.unwrap()); - } - } else { - value = null; - } - return value; - }); - reader.context().pop(); - } - reader.context().pop(); - } - - if (!_object || !_objectSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'object: TestImport_AnotherObject'")); - } - if (!_objectArraySet) { - throw new Error(reader.context().printWithContext("Missing required property: 'objectArray: [TestImport_AnotherObject]'")); - } - if (!_enSet) { - throw new Error(reader.context().printWithContext("Missing required property: 'en: TestImport_Enum'")); - } - if (!_enumArraySet) { - throw new Error(reader.context().printWithContext("Missing required property: 'enumArray: [TestImport_Enum]'")); - } - - return { - object: _object, - optObject: _optObject, - objectArray: _objectArray, - optObjectArray: _optObjectArray, - en: _en, - optEnum: _optEnum, - enumArray: _enumArray, - optEnumArray: _optEnumArray - }; -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/index.ts deleted file mode 100644 index f414d6c925..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/imported/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from "./TestImport_Module"; -export * from "./TestImport_Object"; -export * from "./TestImport_AnotherObject"; -export * from "./TestImport_Enum"; -export * from "./TestImport_Enum_Return"; -export * from "./TestImport_Env"; diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/index.ts deleted file mode 100644 index a398b972b9..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/index.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { - Args_moduleMethod, - Args_objectMethod, - Args_optionalEnvMethod, - Args__if -} from "./Module"; -export { - Args_moduleMethod, - Args_objectMethod, - Args_optionalEnvMethod, - Args__if -}; -export { ModuleBase } from "./Module"; -export { CustomType } from "./CustomType"; -export { AnotherType } from "./AnotherType"; -export { CustomMapValue } from "./CustomMapValue"; -export { _else } from "./else"; -export { - CustomEnum, - getCustomEnumKey, - getCustomEnumValue, - sanitizeCustomEnumValue -} from "./CustomEnum"; -export { - _while, - getwhileKey, - getwhileValue, - sanitizewhileValue -} from "./while"; -export { TestImport_Module } from "./imported/TestImport_Module"; -export { TestImport_Object } from "./imported/TestImport_Object"; -export { TestImport_AnotherObject } from "./imported/TestImport_AnotherObject"; -export { TestImport_Env } from "./imported/TestImport_Env"; -export { - TestImport_Enum, - getTestImport_EnumKey, - getTestImport_EnumValue, - sanitizeTestImport_EnumValue -} from "./imported/TestImport_Enum"; -export { - TestImport_Enum_Return, - getTestImport_Enum_ReturnKey, - getTestImport_Enum_ReturnValue, - sanitizeTestImport_Enum_ReturnValue -} from "./imported/TestImport_Enum_Return"; -export { TestImport } from "./TestImport"; -export { Env } from "./Env"; diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-as/while/index.ts b/packages/test-cases/cases/bind/sanity/output/wrap-as/while/index.ts deleted file mode 100644 index d15bc02f7b..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-as/while/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -export enum _while { - _for, - _in, - _MAX_ -} - -export function sanitizewhileValue(value: i32): void { - const valid = value >= 0 && value < _while._MAX_; - if (!valid) { - throw new Error("Invalid value for enum '_while': " + value.toString()); - } -} - -export function getwhileValue(key: string): _while { - if (key == "_for") { - return _while._for; - } - if (key == "_in") { - return _while._in; - } - - throw new Error("Invalid key for enum '_while': " + key); -} - -export function getwhileKey(value: _while): string { - sanitizewhileValue(value); - - switch (value) { - case _while._for: return "_for"; - case _while._in: return "_in"; - default: - throw new Error("Invalid value for enum '_while': " + value.toString()); - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/_else/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/_else/mod.rs deleted file mode 100644 index 1e13036df9..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/_else/mod.rs +++ /dev/null @@ -1,25 +0,0 @@ -use serde::{Serialize, Deserialize}; -use polywrap_msgpack_serde::{ - wrappers::polywrap_json::JSONString, - wrappers::polywrap_bigint::BigIntWrapper -}; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - JSON -}; - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Else { - #[serde(rename = "else")] - pub _else: String, -} - -impl Else { - pub fn new() -> Else { - Else { - _else: String::new(), - } - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/_while/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/_while/mod.rs deleted file mode 100644 index 94f61f4505..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/_while/mod.rs +++ /dev/null @@ -1,53 +0,0 @@ -use polywrap_wasm_rs::{EnumTypeError}; -use serde::{Serialize, Deserialize}; -use std::convert::TryFrom; - -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] -pub enum While { - #[serde(rename = "for")] - _for, - #[serde(rename = "in")] - _in, - _MAX_ -} - -pub fn sanitize_while_value(value: i32) -> Result<(), EnumTypeError> { - if value < 0 && value >= While::_MAX_ as i32 { - return Err(EnumTypeError::EnumProcessingError(format!("Invalid value for enum 'While': {}", value.to_string()))); - } - Ok(()) -} - -pub fn get_while_value(key: &str) -> Result { - match key { - "_for" => Ok(While::_for), - "_in" => Ok(While::_in), - "_MAX_" => Ok(While::_MAX_), - err => Err(EnumTypeError::EnumProcessingError(format!("Invalid key for enum 'While': {}", err))) - } -} - -pub fn get_while_key(value: While) -> Result { - if sanitize_while_value(value as i32).is_ok() { - match value { - While::_for => Ok("_for".to_string()), - While::_in => Ok("_in".to_string()), - While::_MAX_ => Ok("_MAX_".to_string()), - } - } else { - Err(EnumTypeError::EnumProcessingError(format!("Invalid value for enum 'While': {}", (value as i32).to_string()))) - } -} - -impl TryFrom for While { - type Error = EnumTypeError; - - fn try_from(v: i32) -> Result { - match v { - x if x == While::_for as i32 => Ok(While::_for), - x if x == While::_in as i32 => Ok(While::_in), - x if x == While::_MAX_ as i32 => Ok(While::_MAX_), - _ => Err(EnumTypeError::ParseEnumError(format!("Invalid value for enum 'While': {}", (v as i32).to_string()))), - } - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/another_type/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/another_type/mod.rs deleted file mode 100644 index 171fa6448a..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/another_type/mod.rs +++ /dev/null @@ -1,30 +0,0 @@ -use serde::{Serialize, Deserialize}; -use polywrap_msgpack_serde::{ - wrappers::polywrap_json::JSONString, - wrappers::polywrap_bigint::BigIntWrapper -}; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - JSON -}; -use crate::CustomType; - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct AnotherType { - pub prop: Option, - pub circular: Option, - #[serde(rename = "const")] - pub _const: Option, -} - -impl AnotherType { - pub fn new() -> AnotherType { - AnotherType { - prop: None, - circular: None, - _const: None, - } - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_enum/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_enum/mod.rs deleted file mode 100644 index 477827bda7..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_enum/mod.rs +++ /dev/null @@ -1,53 +0,0 @@ -use polywrap_wasm_rs::{EnumTypeError}; -use serde::{Serialize, Deserialize}; -use std::convert::TryFrom; - -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] -pub enum CustomEnum { - #[serde(rename = "STRING")] - STRING, - #[serde(rename = "BYTES")] - BYTES, - _MAX_ -} - -pub fn sanitize_custom_enum_value(value: i32) -> Result<(), EnumTypeError> { - if value < 0 && value >= CustomEnum::_MAX_ as i32 { - return Err(EnumTypeError::EnumProcessingError(format!("Invalid value for enum 'CustomEnum': {}", value.to_string()))); - } - Ok(()) -} - -pub fn get_custom_enum_value(key: &str) -> Result { - match key { - "STRING" => Ok(CustomEnum::STRING), - "BYTES" => Ok(CustomEnum::BYTES), - "_MAX_" => Ok(CustomEnum::_MAX_), - err => Err(EnumTypeError::EnumProcessingError(format!("Invalid key for enum 'CustomEnum': {}", err))) - } -} - -pub fn get_custom_enum_key(value: CustomEnum) -> Result { - if sanitize_custom_enum_value(value as i32).is_ok() { - match value { - CustomEnum::STRING => Ok("STRING".to_string()), - CustomEnum::BYTES => Ok("BYTES".to_string()), - CustomEnum::_MAX_ => Ok("_MAX_".to_string()), - } - } else { - Err(EnumTypeError::EnumProcessingError(format!("Invalid value for enum 'CustomEnum': {}", (value as i32).to_string()))) - } -} - -impl TryFrom for CustomEnum { - type Error = EnumTypeError; - - fn try_from(v: i32) -> Result { - match v { - x if x == CustomEnum::STRING as i32 => Ok(CustomEnum::STRING), - x if x == CustomEnum::BYTES as i32 => Ok(CustomEnum::BYTES), - x if x == CustomEnum::_MAX_ as i32 => Ok(CustomEnum::_MAX_), - _ => Err(EnumTypeError::ParseEnumError(format!("Invalid value for enum 'CustomEnum': {}", (v as i32).to_string()))), - } - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_map_value/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_map_value/mod.rs deleted file mode 100644 index 29689350bb..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_map_value/mod.rs +++ /dev/null @@ -1,24 +0,0 @@ -use serde::{Serialize, Deserialize}; -use polywrap_msgpack_serde::{ - wrappers::polywrap_json::JSONString, - wrappers::polywrap_bigint::BigIntWrapper -}; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - JSON -}; - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CustomMapValue { - pub foo: String, -} - -impl CustomMapValue { - pub fn new() -> CustomMapValue { - CustomMapValue { - foo: String::new(), - } - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_type/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_type/mod.rs deleted file mode 100644 index 2e53a74ff4..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/custom_type/mod.rs +++ /dev/null @@ -1,135 +0,0 @@ -use serde::{Serialize, Deserialize}; -use polywrap_msgpack_serde::{ - wrappers::polywrap_json::JSONString, - wrappers::polywrap_bigint::BigIntWrapper -}; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - JSON -}; -use crate::AnotherType; -use crate::CustomEnum; -use crate::CustomMapValue; - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CustomType { - pub str: String, - #[serde(rename = "optStr")] - pub opt_str: Option, - pub u: u32, - #[serde(rename = "optU")] - pub opt_u: Option, - pub u8: u8, - pub u16: u16, - pub u32: u32, - pub i: i32, - pub i8: i8, - pub i16: i16, - pub i32: i32, - pub bigint: BigIntWrapper, - #[serde(rename = "optBigint")] - pub opt_bigint: Option, - pub bignumber: BigNumber, - #[serde(rename = "optBignumber")] - pub opt_bignumber: Option, - pub json: JSONString, - #[serde(rename = "optJson")] - pub opt_json: Option, - #[serde(with = "serde_bytes")] - pub bytes: Vec, - #[serde(with = "serde_bytes")] - #[serde(rename = "optBytes")] - pub opt_bytes: Option>, - pub boolean: bool, - #[serde(rename = "optBoolean")] - pub opt_boolean: Option, - pub u_array: Vec, - #[serde(rename = "uOpt_array")] - pub u_opt_array: Option>, - #[serde(rename = "_opt_uOptArray")] - pub _opt_u_opt_array: Option>>, - #[serde(rename = "optStrOptArray")] - pub opt_str_opt_array: Option>>, - #[serde(rename = "uArrayArray")] - pub u_array_array: Vec>, - #[serde(rename = "uOptArrayOptArray")] - pub u_opt_array_opt_array: Vec>>>, - #[serde(rename = "uArrayOptArrayArray")] - pub u_array_opt_array_array: Vec>>>, - #[serde(rename = "crazyArray")] - pub crazy_array: Option>>>>>>, - pub object: AnotherType, - #[serde(rename = "optObject")] - pub opt_object: Option, - #[serde(rename = "objectArray")] - pub object_array: Vec, - #[serde(rename = "optObjectArray")] - pub opt_object_array: Option>>, - pub en: CustomEnum, - #[serde(rename = "optEnum")] - pub opt_enum: Option, - #[serde(rename = "enumArray")] - pub enum_array: Vec, - #[serde(rename = "optEnumArray")] - pub opt_enum_array: Option>>, - pub map: Map, - #[serde(rename = "mapOfArr")] - pub map_of_arr: Map>, - #[serde(rename = "mapOfObj")] - pub map_of_obj: Map, - #[serde(rename = "mapOfArrOfObj")] - pub map_of_arr_of_obj: Map>, - #[serde(rename = "mapCustomValue")] - pub map_custom_value: Map>, -} - -impl CustomType { - pub fn new() -> CustomType { - CustomType { - str: String::new(), - opt_str: None, - u: 0, - opt_u: None, - u8: 0, - u16: 0, - u32: 0, - i: 0, - i8: 0, - i16: 0, - i32: 0, - bigint: BigIntWrapper(BigInt::default()), - opt_bigint: None, - bignumber: BigNumber::default(), - opt_bignumber: None, - json: JSONString::from(JSON::Value::Null), - opt_json: None, - bytes: vec![], - opt_bytes: None, - boolean: false, - opt_boolean: None, - u_array: vec![], - u_opt_array: None, - _opt_u_opt_array: None, - opt_str_opt_array: None, - u_array_array: vec![], - u_opt_array_opt_array: vec![], - u_array_opt_array_array: vec![], - crazy_array: None, - object: Option::new(), - opt_object: None, - object_array: vec![], - opt_object_array: None, - en: Option::_MAX_, - opt_enum: None, - enum_array: vec![], - opt_enum_array: None, - map: Map::::new(), - map_of_arr: Map::>::new(), - map_of_obj: Map::::new(), - map_of_arr_of_obj: Map::>::new(), - map_custom_value: Map::>::new(), - } - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/entry.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/entry.rs deleted file mode 100644 index 25d939ff06..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/entry.rs +++ /dev/null @@ -1,41 +0,0 @@ -use crate::{ - module_method_wrapped, - object_method_wrapped, - optional_env_method_wrapped, - if_wrapped -}; -use polywrap_wasm_rs::{ - abort, - invoke, - InvokeArgs, -}; - -#[no_mangle] -pub extern "C" fn _wrap_invoke(method_size: u32, args_size: u32, env_size: u32) -> bool { - // Ensure the abort handler is properly setup - abort::wrap_abort_setup(); - - let args: InvokeArgs = invoke::wrap_invoke_args(method_size, args_size); - let result: Vec; - - match args.method.as_str() { - "moduleMethod" => { - result = module_method_wrapped(args.args.as_slice(), env_size); - } - "objectMethod" => { - result = object_method_wrapped(args.args.as_slice(), env_size); - } - "optionalEnvMethod" => { - result = optional_env_method_wrapped(args.args.as_slice(), env_size); - } - "if" => { - result = if_wrapped(args.args.as_slice(), env_size); - } - _ => { - invoke::wrap_invoke_error(format!("Could not find invoke function {}", args.method)); - return false; - } - }; - invoke::wrap_invoke_result(result); - return true; -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/env/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/env/mod.rs deleted file mode 100644 index cc57defade..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/env/mod.rs +++ /dev/null @@ -1,30 +0,0 @@ -use serde::{Serialize, Deserialize}; -use polywrap_msgpack_serde::{ - wrappers::polywrap_json::JSONString, - wrappers::polywrap_bigint::BigIntWrapper -}; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - JSON -}; - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Env { - pub prop: String, - #[serde(rename = "optProp")] - pub opt_prop: Option, - #[serde(rename = "optMap")] - pub opt_map: Option>>, -} - -impl Env { - pub fn new() -> Env { - Env { - prop: String::new(), - opt_prop: None, - opt_map: None, - } - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/mod.rs deleted file mode 100644 index 6d97b84f52..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/mod.rs +++ /dev/null @@ -1,12 +0,0 @@ -pub mod test_import_object; -pub use test_import_object::*; -pub mod test_import_another_object; -pub use test_import_another_object::*; -pub mod test_import_enum; -pub use test_import_enum::*; -pub mod test_import_enum_return; -pub use test_import_enum_return::*; -pub mod test_import_module; -pub use test_import_module::*; -pub mod test_import_env; -pub use test_import_env::*; diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_another_object/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_another_object/mod.rs deleted file mode 100644 index d5b29d8ab3..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_another_object/mod.rs +++ /dev/null @@ -1,26 +0,0 @@ -use serde::{Serialize, Deserialize}; -use polywrap_msgpack_serde::{ - wrappers::polywrap_json::JSONString, - wrappers::polywrap_bigint::BigIntWrapper -}; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - JSON -}; - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TestImportAnotherObject { - pub prop: String, -} - -impl TestImportAnotherObject { - pub const URI: &'static str = "testimport.uri.eth"; - - pub fn new() -> TestImportAnotherObject { - TestImportAnotherObject { - prop: String::new(), - } - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_enum/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_enum/mod.rs deleted file mode 100644 index 4a22dd0029..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_enum/mod.rs +++ /dev/null @@ -1,53 +0,0 @@ -use polywrap_wasm_rs::EnumTypeError; -use serde::{Serialize, Deserialize}; -use std::convert::TryFrom; - -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] -pub enum TestImportEnum { - #[serde(rename = "STRING")] - STRING, - #[serde(rename = "BYTES")] - BYTES, - _MAX_ -} - -pub fn sanitize_test_import_enum_value(value: i32) -> Result<(), EnumTypeError> { - if value < 0 && value >= TestImportEnum::_MAX_ as i32 { - return Err(EnumTypeError::EnumProcessingError(format!("Invalid value for enum 'TestImportEnum': {}", value.to_string()))); - } - Ok(()) -} - -pub fn get_test_import_enum_value(key: &str) -> Result { - match key { - "STRING" => Ok(TestImportEnum::STRING), - "BYTES" => Ok(TestImportEnum::BYTES), - "_MAX_" => Ok(TestImportEnum::_MAX_), - err => Err(EnumTypeError::EnumProcessingError(format!("Invalid key for enum 'TestImportEnum': {}", err))) - } -} - -pub fn get_test_import_enum_key(value: TestImportEnum) -> Result { - if sanitize_test_import_enum_value(value as i32).is_ok() { - match value { - TestImportEnum::STRING => Ok("STRING".to_string()), - TestImportEnum::BYTES => Ok("BYTES".to_string()), - TestImportEnum::_MAX_ => Ok("_MAX_".to_string()), - } - } else { - Err(EnumTypeError::EnumProcessingError(format!("Invalid value for enum 'TestImportEnum': {}", (value as i32).to_string()))) - } -} - -impl TryFrom for TestImportEnum { - type Error = EnumTypeError; - - fn try_from(v: i32) -> Result { - match v { - x if x == TestImportEnum::STRING as i32 => Ok(TestImportEnum::STRING), - x if x == TestImportEnum::BYTES as i32 => Ok(TestImportEnum::BYTES), - x if x == TestImportEnum::_MAX_ as i32 => Ok(TestImportEnum::_MAX_), - _ => Err(EnumTypeError::ParseEnumError(format!("Invalid value for enum 'TestImportEnum': {}", (v as i32).to_string()))), - } - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_enum_return/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_enum_return/mod.rs deleted file mode 100644 index 8d668d2910..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_enum_return/mod.rs +++ /dev/null @@ -1,53 +0,0 @@ -use polywrap_wasm_rs::EnumTypeError; -use serde::{Serialize, Deserialize}; -use std::convert::TryFrom; - -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] -pub enum TestImportEnumReturn { - #[serde(rename = "STRING")] - STRING, - #[serde(rename = "BYTES")] - BYTES, - _MAX_ -} - -pub fn sanitize_test_import_enum_return_value(value: i32) -> Result<(), EnumTypeError> { - if value < 0 && value >= TestImportEnumReturn::_MAX_ as i32 { - return Err(EnumTypeError::EnumProcessingError(format!("Invalid value for enum 'TestImportEnumReturn': {}", value.to_string()))); - } - Ok(()) -} - -pub fn get_test_import_enum_return_value(key: &str) -> Result { - match key { - "STRING" => Ok(TestImportEnumReturn::STRING), - "BYTES" => Ok(TestImportEnumReturn::BYTES), - "_MAX_" => Ok(TestImportEnumReturn::_MAX_), - err => Err(EnumTypeError::EnumProcessingError(format!("Invalid key for enum 'TestImportEnumReturn': {}", err))) - } -} - -pub fn get_test_import_enum_return_key(value: TestImportEnumReturn) -> Result { - if sanitize_test_import_enum_return_value(value as i32).is_ok() { - match value { - TestImportEnumReturn::STRING => Ok("STRING".to_string()), - TestImportEnumReturn::BYTES => Ok("BYTES".to_string()), - TestImportEnumReturn::_MAX_ => Ok("_MAX_".to_string()), - } - } else { - Err(EnumTypeError::EnumProcessingError(format!("Invalid value for enum 'TestImportEnumReturn': {}", (value as i32).to_string()))) - } -} - -impl TryFrom for TestImportEnumReturn { - type Error = EnumTypeError; - - fn try_from(v: i32) -> Result { - match v { - x if x == TestImportEnumReturn::STRING as i32 => Ok(TestImportEnumReturn::STRING), - x if x == TestImportEnumReturn::BYTES as i32 => Ok(TestImportEnumReturn::BYTES), - x if x == TestImportEnumReturn::_MAX_ as i32 => Ok(TestImportEnumReturn::_MAX_), - _ => Err(EnumTypeError::ParseEnumError(format!("Invalid value for enum 'TestImportEnumReturn': {}", (v as i32).to_string()))), - } - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_env/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_env/mod.rs deleted file mode 100644 index ea2dfd1b40..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_env/mod.rs +++ /dev/null @@ -1,42 +0,0 @@ -use serde::{Serialize, Deserialize}; -use polywrap_msgpack_serde::{ - wrappers::polywrap_json::JSONString, - wrappers::polywrap_bigint::BigIntWrapper -}; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - JSON -}; -use crate::TestImportAnotherObject; -use crate::TestImportEnum; - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TestImportEnv { - pub object: TestImportAnotherObject, - pub opt_object: Option, - pub object_array: Vec, - pub opt_object_array: Option>>, - pub en: TestImportEnum, - pub opt_enum: Option, - pub enum_array: Vec, - pub opt_enum_array: Option>>, -} - -impl TestImportEnv { - pub const URI: &'static str = "testimport.uri.eth"; - - pub fn new() -> TestImportEnv { - TestImportEnv { - object: Option::new(), - opt_object: None, - object_array: vec![], - opt_object_array: None, - en: Option::_MAX_, - opt_enum: None, - enum_array: vec![], - opt_enum_array: None, - } - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_module/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_module/mod.rs deleted file mode 100644 index 873e07c430..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_module/mod.rs +++ /dev/null @@ -1,99 +0,0 @@ -use serde::{Serialize, Deserialize}; -use polywrap_msgpack_serde::{ - from_slice, - to_vec, - wrappers::polywrap_json::JSONString, - wrappers::polywrap_bigint::BigIntWrapper -}; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - JSON, - subinvoke -}; -use crate::TestImportObject; -use crate::TestImportEnum; -use crate::TestImportEnumReturn; - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsImportedMethod { - pub str: String, - #[serde(rename = "optStr")] - pub opt_str: Option, - pub u: u32, - #[serde(rename = "optU")] - pub opt_u: Option, - #[serde(rename = "uArrayArray")] - pub u_array_array: Vec>>>, - pub object: TestImportObject, - #[serde(rename = "optObject")] - pub opt_object: Option, - #[serde(rename = "objectArray")] - pub object_array: Vec, - #[serde(rename = "optObjectArray")] - pub opt_object_array: Option>>, - pub en: TestImportEnum, - #[serde(rename = "optEnum")] - pub opt_enum: Option, - #[serde(rename = "enumArray")] - pub enum_array: Vec, - #[serde(rename = "optEnumArray")] - pub opt_enum_array: Option>>, -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsAnotherMethod { - pub arg: Vec, -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsReturnsArrayOfEnums { - pub arg: String, -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TestImportModule { - uri: String -} - -impl TestImportModule { - pub const INTERFACE_URI: &'static str = "testimport.uri.eth"; - - pub fn new(uri: String) -> TestImportModule { - TestImportModule { uri } - } - - pub fn imported_method(&self, args: &ArgsImportedMethod) -> Result, String> { - let ref uri = self.uri; - let args = to_vec(args).map_err(|e| e.to_string())?; - let result = subinvoke::wrap_subinvoke( - uri.as_str(), - "importedMethod", - args, - )?; - from_slice(result.as_slice()).map_err(|e| e.to_string()) - } - - pub fn another_method(&self, args: &ArgsAnotherMethod) -> Result { - let ref uri = self.uri; - let args = to_vec(args).map_err(|e| e.to_string())?; - let result = subinvoke::wrap_subinvoke( - uri.as_str(), - "anotherMethod", - args, - )?; - from_slice(result.as_slice()).map_err(|e| e.to_string()) - } - - pub fn returns_array_of_enums(&self, args: &ArgsReturnsArrayOfEnums) -> Result>, String> { - let ref uri = self.uri; - let args = to_vec(args).map_err(|e| e.to_string())?; - let result = subinvoke::wrap_subinvoke( - uri.as_str(), - "returnsArrayOfEnums", - args, - )?; - from_slice(result.as_slice()).map_err(|e| e.to_string()) - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_object/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_object/mod.rs deleted file mode 100644 index b40e4db32d..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/imported/test_import_object/mod.rs +++ /dev/null @@ -1,48 +0,0 @@ -use serde::{Serialize, Deserialize}; -use polywrap_msgpack_serde::{ - wrappers::polywrap_json::JSONString, - wrappers::polywrap_bigint::BigIntWrapper -}; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - JSON -}; -use crate::TestImportAnotherObject; -use crate::TestImportEnum; - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TestImportObject { - pub object: TestImportAnotherObject, - #[serde(rename = "optObject")] - pub opt_object: Option, - #[serde(rename = "objectArray")] - pub object_array: Vec, - #[serde(rename = "optObjectArray")] - pub opt_object_array: Option>>, - pub en: TestImportEnum, - #[serde(rename = "optEnum")] - pub opt_enum: Option, - #[serde(rename = "enumArray")] - pub enum_array: Vec, - #[serde(rename = "optEnumArray")] - pub opt_enum_array: Option>>, -} - -impl TestImportObject { - pub const URI: &'static str = "testimport.uri.eth"; - - pub fn new() -> TestImportObject { - TestImportObject { - object: Option::new(), - opt_object: None, - object_array: vec![], - opt_object_array: None, - en: Option::_MAX_, - opt_enum: None, - enum_array: vec![], - opt_enum_array: None, - } - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/mod.rs deleted file mode 100644 index 5fa8c40b25..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/mod.rs +++ /dev/null @@ -1,64 +0,0 @@ -pub mod entry; -pub mod custom_type; -pub use custom_type::CustomType; -pub mod another_type; -pub use another_type::AnotherType; -pub mod custom_map_value; -pub use custom_map_value::CustomMapValue; -pub mod _else; -pub use _else::Else; -pub mod custom_enum; -pub use custom_enum::{ - get_custom_enum_key, - get_custom_enum_value, - sanitize_custom_enum_value, - CustomEnum -}; -pub mod _while; -pub use _while::{ - get_while_key, - get_while_value, - sanitize_while_value, - While -}; -pub mod env; -pub use env::Env; -pub mod imported; - -pub use imported::test_import_object::TestImportObject; -pub use imported::test_import_another_object::TestImportAnotherObject; -pub use imported::test_import_enum::{ - get_test_import_enum_key, - get_test_import_enum_value, - sanitize_test_import_enum_value, - TestImportEnum -}; -pub use imported::test_import_enum_return::{ - get_test_import_enum_return_key, - get_test_import_enum_return_value, - sanitize_test_import_enum_return_value, - TestImportEnumReturn -}; -pub use imported::test_import_env::TestImportEnv; -pub use imported::test_import_module::TestImportModule; -pub mod test_import; -pub use test_import::TestImport; -pub mod module; -pub use module::{ - Module, - ModuleTrait, - module_method_wrapped, - ArgsModuleMethod, - object_method_wrapped, - ArgsObjectMethod, - optional_env_method_wrapped, - ArgsOptionalEnvMethod, - if_wrapped, - ArgsIf -}; - -// Override print!(...) & println!(...) macros -#[macro_export] -macro_rules! println { ($($args:tt)*) => { polywrap_wasm_rs::wrap_debug_log(format!($($args)*).as_str()); } } -#[macro_export] -macro_rules! print { ($($args:tt)*) => { polywrap_wasm_rs::wrap_debug_log(format!($($args)*).as_str()); } } diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/mod.rs deleted file mode 100644 index 1216287feb..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/mod.rs +++ /dev/null @@ -1,14 +0,0 @@ -pub mod wrapped; -pub use wrapped::{ - module_method_wrapped, - ArgsModuleMethod, - object_method_wrapped, - ArgsObjectMethod, - optional_env_method_wrapped, - ArgsOptionalEnvMethod, - if_wrapped, - ArgsIf -}; - -pub mod module; -pub use module::*; diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/module.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/module.rs deleted file mode 100644 index e5cf0918fb..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/module.rs +++ /dev/null @@ -1,32 +0,0 @@ -use polywrap_msgpack_serde::{ - wrappers::polywrap_json::JSONString, - wrappers::polywrap_bigint::BigIntWrapper -}; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - JSON -}; -use crate::{ - ArgsModuleMethod, - ArgsObjectMethod, - ArgsOptionalEnvMethod, - ArgsIf, -}; -use crate::CustomEnum; -use crate::AnotherType; -use crate::Else; -use crate::env::Env; - -pub struct Module; - -pub trait ModuleTrait { - fn module_method(args: ArgsModuleMethod) -> Result; - - fn object_method(args: ArgsObjectMethod, env: Env) -> Result, String>; - - fn optional_env_method(args: ArgsOptionalEnvMethod, env: Option) -> Result, String>; - - fn _if(args: ArgsIf) -> Result; -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/wrapped.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/wrapped.rs deleted file mode 100644 index 16da48c5ba..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/module/wrapped.rs +++ /dev/null @@ -1,183 +0,0 @@ -use serde::{Deserialize, Serialize}; -use polywrap_msgpack_serde::{ - from_slice, - to_vec, - wrappers::polywrap_json::JSONString, - wrappers::polywrap_bigint::BigIntWrapper -}; -use polywrap_wasm_rs::{ - BigInt, - BigNumber, - Map, - JSON, - wrap_load_env -}; -use crate::module::{ModuleTrait, Module}; -use crate::CustomEnum; -use crate::AnotherType; -use crate::Else; -use crate::Env; - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsModuleMethod { - pub str: String, - #[serde(rename = "optStr")] - pub opt_str: Option, - pub en: CustomEnum, - #[serde(rename = "optEnum")] - pub opt_enum: Option, - #[serde(rename = "enumArray")] - pub enum_array: Vec, - #[serde(rename = "optEnumArray")] - pub opt_enum_array: Option>>, - pub map: Map, - #[serde(rename = "mapOfArr")] - pub map_of_arr: Map>, - #[serde(rename = "mapOfMap")] - pub map_of_map: Map>, - #[serde(rename = "mapOfObj")] - pub map_of_obj: Map, - #[serde(rename = "mapOfArrOfObj")] - pub map_of_arr_of_obj: Map>, -} - -pub fn module_method_wrapped(args: &[u8], env_size: u32) -> Vec { - match from_slice::(args) { - Ok(args) => { - let result = Module::module_method(ArgsModuleMethod { - str: args.str, - opt_str: args.opt_str, - en: args.en, - opt_enum: args.opt_enum, - enum_array: args.enum_array, - opt_enum_array: args.opt_enum_array, - map: args.map, - map_of_arr: args.map_of_arr, - map_of_map: args.map_of_map, - map_of_obj: args.map_of_obj, - map_of_arr_of_obj: args.map_of_arr_of_obj, - }); - match result { - Ok(res) => { - to_vec(&res).unwrap() - } - Err(e) => { - panic!("{}", e.to_string()) - } - } - } - Err(e) => { - panic!("{}", e.to_string()) - } - } -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsObjectMethod { - pub object: AnotherType, - #[serde(rename = "optObject")] - pub opt_object: Option, - #[serde(rename = "objectArray")] - pub object_array: Vec, - #[serde(rename = "optObjectArray")] - pub opt_object_array: Option>>, -} - -pub fn object_method_wrapped(args: &[u8], env_size: u32) -> Vec { - if env_size == 0 { - panic!("Environment is not set, and it is required by method 'objectMethod'"); - } - - let env_buf = wrap_load_env(env_size); - let env = Env::from_buffer(&env_buf).unwrap(); - - match from_slice::(args) { - Ok(args) => { - let result = Module::object_method(ArgsObjectMethod { - object: args.object, - opt_object: args.opt_object, - object_array: args.object_array, - opt_object_array: args.opt_object_array, - }, env); - match result { - Ok(res) => { - to_vec(&res).unwrap() - } - Err(e) => { - panic!("{}", e.to_string()) - } - } - } - Err(e) => { - panic!("{}", e.to_string()) - } - } -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsOptionalEnvMethod { - pub object: AnotherType, - #[serde(rename = "optObject")] - pub opt_object: Option, - #[serde(rename = "objectArray")] - pub object_array: Vec, - #[serde(rename = "optObjectArray")] - pub opt_object_array: Option>>, -} - -pub fn optional_env_method_wrapped(args: &[u8], env_size: u32) -> Vec { - let mut env: Option = None; - if env_size > 0 { - let env_buf = wrap_load_env(env_size); - env = Some(Env::from_buffer(&env_buf).unwrap()); - } - - match from_slice::(args) { - Ok(args) => { - let result = Module::optional_env_method(ArgsOptionalEnvMethod { - object: args.object, - opt_object: args.opt_object, - object_array: args.object_array, - opt_object_array: args.opt_object_array, - }, env); - match result { - Ok(res) => { - to_vec(&res).unwrap() - } - Err(e) => { - panic!("{}", e.to_string()) - } - } - } - Err(e) => { - panic!("{}", e.to_string()) - } - } -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsIf { - #[serde(rename = "if")] - pub _if: Else, -} - -pub fn if_wrapped(args: &[u8], env_size: u32) -> Vec { - match from_slice::(args) { - Ok(args) => { - let result = Module::_if(ArgsIf { - _if: args._if, - }); - match result { - Ok(res) => { - to_vec(&res).unwrap() - } - Err(e) => { - panic!("{}", e.to_string()) - } - } - } - Err(e) => { - panic!("{}", e.to_string()) - } - } -} diff --git a/packages/test-cases/cases/bind/sanity/output/wrap-rs/test_import/mod.rs b/packages/test-cases/cases/bind/sanity/output/wrap-rs/test_import/mod.rs deleted file mode 100644 index e50df13ba6..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/wrap-rs/test_import/mod.rs +++ /dev/null @@ -1,11 +0,0 @@ -use polywrap_wasm_rs::wrap_get_implementations; - -pub struct TestImport {} - -impl TestImport { - const uri: &'static str = "testimport.uri.eth"; - - pub fn get_implementations() -> Vec { - wrap_get_implementations(Self::uri) - } -} From bee8a229ad39b6da97f92c2b4810799fb7254f4a Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Wed, 26 Jul 2023 22:06:02 +0200 Subject: [PATCH 09/19] chore: upgrade to 0.12 client --- packages/cli/package.json | 22 +- packages/js/validation/package.json | 2 +- packages/schema/bind/package.json | 4 +- packages/schema/compose/package.json | 2 +- packages/schema/parse/package.json | 2 +- .../templates/app/typescript/package.json | 2 +- .../templates/plugin/typescript/package.json | 6 +- yarn.lock | 593 ++++++++---------- 8 files changed, 278 insertions(+), 355 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 6c79da5bf6..6c3fc17377 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -43,24 +43,24 @@ "@ethersproject/providers": "5.6.8", "@ethersproject/wallet": "5.6.2", "@formatjs/intl": "1.8.2", - "@polywrap/asyncify-js": "0.12.0-pre.1", - "@polywrap/client-config-builder-js": "0.12.0-pre.1", - "@polywrap/client-js": "0.12.0-pre.1", - "@polywrap/core-js": "0.12.0-pre.1", + "@polywrap/asyncify-js": "0.12.0", + "@polywrap/client-config-builder-js": "0.12.0", + "@polywrap/client-js": "0.12.0", + "@polywrap/core-js": "0.12.0", "@polywrap/ethereum-provider-js": "0.3.1", "@polywrap/logging-js": "0.11.0-pre.4", "@polywrap/os-js": "0.11.0-pre.4", "@polywrap/polywrap-manifest-types-js": "0.11.0-pre.4", - "@polywrap/result": "0.12.0-pre.1", + "@polywrap/result": "0.12.0", "@polywrap/schema-bind": "0.11.0-pre.4", "@polywrap/schema-compose": "0.11.0-pre.4", "@polywrap/schema-parse": "0.11.0-pre.4", - "@polywrap/sys-config-bundle-js": "0.12.0-pre.1", - "@polywrap/uri-resolver-extensions-js": "0.12.0-pre.1", - "@polywrap/uri-resolvers-js": "0.12.0-pre.1", - "@polywrap/wasm-js": "0.12.0-pre.1", - "@polywrap/web3-config-bundle-js": "0.12.0-pre.1", - "@polywrap/wrap-manifest-types-js": "0.12.0-pre.1", + "@polywrap/sys-config-bundle-js": "0.12.0", + "@polywrap/uri-resolver-extensions-js": "0.12.0", + "@polywrap/uri-resolvers-js": "0.12.0", + "@polywrap/wasm-js": "0.12.0", + "@polywrap/web3-config-bundle-js": "0.12.0", + "@polywrap/wrap-manifest-types-js": "0.12.0", "axios": "0.21.2", "chalk": "4.1.0", "chokidar": "3.5.1", diff --git a/packages/js/validation/package.json b/packages/js/validation/package.json index 14f3b4182b..fda60ccde7 100644 --- a/packages/js/validation/package.json +++ b/packages/js/validation/package.json @@ -19,7 +19,7 @@ }, "dependencies": { "@polywrap/schema-compose": "0.11.0-pre.4", - "@polywrap/wrap-manifest-types-js": "0.12.0-pre.1" + "@polywrap/wrap-manifest-types-js": "0.12.0" }, "devDependencies": { "@polywrap/msgpack-js": "0.10.0", diff --git a/packages/schema/bind/package.json b/packages/schema/bind/package.json index 4ca365879b..cb329f605f 100644 --- a/packages/schema/bind/package.json +++ b/packages/schema/bind/package.json @@ -19,10 +19,10 @@ "copy:templates": "copyfiles -u 1 src/**/*.mustache build/" }, "dependencies": { - "@polywrap/client-js": "0.12.0-pre.1", + "@polywrap/client-js": "0.12.0", "@polywrap/os-js": "0.11.0-pre.4", "@polywrap/schema-parse": "0.11.0-pre.4", - "@polywrap/wrap-manifest-types-js": "0.12.0-pre.1", + "@polywrap/wrap-manifest-types-js": "0.12.0", "mustache": "4.0.1" }, "devDependencies": { diff --git a/packages/schema/compose/package.json b/packages/schema/compose/package.json index d2bccfcb0d..7f1b396426 100644 --- a/packages/schema/compose/package.json +++ b/packages/schema/compose/package.json @@ -19,7 +19,7 @@ }, "dependencies": { "@polywrap/schema-parse": "0.11.0-pre.4", - "@polywrap/wrap-manifest-types-js": "0.12.0-pre.1", + "@polywrap/wrap-manifest-types-js": "0.12.0", "graphql": "15.5.0", "mustache": "4.0.1" }, diff --git a/packages/schema/parse/package.json b/packages/schema/parse/package.json index 3f2480a104..2163c7a216 100644 --- a/packages/schema/parse/package.json +++ b/packages/schema/parse/package.json @@ -19,7 +19,7 @@ }, "dependencies": { "@dorgjelli/graphql-schema-cycles": "1.1.4", - "@polywrap/wrap-manifest-types-js": "0.12.0-pre.1", + "@polywrap/wrap-manifest-types-js": "0.12.0", "graphql": "15.5.0" }, "devDependencies": { diff --git a/packages/templates/app/typescript/package.json b/packages/templates/app/typescript/package.json index 2ff7666a05..c01d697629 100644 --- a/packages/templates/app/typescript/package.json +++ b/packages/templates/app/typescript/package.json @@ -8,7 +8,7 @@ "test": "ts-node ./src/index.ts" }, "dependencies": { - "@polywrap/client-js": "~0.12.0-pre.1" + "@polywrap/client-js": "~0.12.0" }, "devDependencies": { "@types/node": "18.15.0", diff --git a/packages/templates/plugin/typescript/package.json b/packages/templates/plugin/typescript/package.json index a85e27eea3..677140fe6c 100644 --- a/packages/templates/plugin/typescript/package.json +++ b/packages/templates/plugin/typescript/package.json @@ -11,15 +11,15 @@ "test:watch": "yarn test -- --watch" }, "dependencies": { - "@polywrap/core-js": "~0.12.0-pre.1", - "@polywrap/plugin-js": "~0.12.0-pre.1" + "@polywrap/core-js": "~0.12.0", + "@polywrap/plugin-js": "~0.12.0" }, "peerDependencies": { "@polywrap/core-js": "0.12.x", "@polywrap/plugin-js": "0.12.x" }, "devDependencies": { - "@polywrap/client-js": "~0.12.0-pre.1", + "@polywrap/client-js": "~0.12.0", "@types/jest": "26.0.8", "@types/prettier": "2.6.0", "jest": "26.6.3", diff --git a/yarn.lock b/yarn.lock index 2415cf732f..e0e6b4ae73 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2141,67 +2141,67 @@ resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.6.0.tgz#ed410c9eb0070491cff9fe914246ce41f88d6f74" integrity sha512-aPfcBeLErM/PPiAuAbNFLN5sNbZLc3KZlar27uohllN8Zs6jJbHyJU1y7cMA6W/zuq+thkaG8mujiS+3iD/FWQ== -"@polywrap/asyncify-js@0.12.0-pre.1": - version "0.12.0-pre.1" - resolved "https://registry.yarnpkg.com/@polywrap/asyncify-js/-/asyncify-js-0.12.0-pre.1.tgz#a09d3a1346315737790c36d8aa00e2d31fd849c5" - integrity sha512-E6OfxaOUrtHgp+3pbr5uJPLeoE9UJU7VXeL37n8ETel7LLjPfSfV7xn2x7iqdhvpJd5S+1daczC/g7espLzfLw== - -"@polywrap/client-config-builder-js@0.12.0-pre.1": - version "0.12.0-pre.1" - resolved "https://registry.yarnpkg.com/@polywrap/client-config-builder-js/-/client-config-builder-js-0.12.0-pre.1.tgz#5fca0bfc216de2978b95bea1fd09b54cf6e40afa" - integrity sha512-fQ+i3VTyGWBM8eKamD2uLBK1l0/nV5C06GiaMpIGhU6yWL3ZcQBffl8OOU/uM0tdgpaNxdNMR/XcNzHjkVySjQ== - dependencies: - "@polywrap/config-bundle-types-js" "0.12.0-pre.1" - "@polywrap/core-js" "0.12.0-pre.1" - "@polywrap/plugin-js" "0.12.0-pre.1" - "@polywrap/sys-config-bundle-js" "0.12.0-pre.1" - "@polywrap/uri-resolver-extensions-js" "0.12.0-pre.1" - "@polywrap/uri-resolvers-js" "0.12.0-pre.1" - "@polywrap/wasm-js" "0.12.0-pre.1" - "@polywrap/web3-config-bundle-js" "0.12.0-pre.1" - -"@polywrap/client-js@0.12.0-pre.1", "@polywrap/client-js@~0.12.0-pre.1": - version "0.12.0-pre.1" - resolved "https://registry.yarnpkg.com/@polywrap/client-js/-/client-js-0.12.0-pre.1.tgz#1df47c4eef946dc74ed4025e4726377c89b3b70c" - integrity sha512-BlmDn+wJqDsvpr26959vbO0XobPQ8XTb+qaK9bt2Zgqfb6st10KS9H099WFhGXOAGXsUQFi9SqQPjvUjeMoU1A== - dependencies: - "@polywrap/client-config-builder-js" "0.12.0-pre.1" - "@polywrap/core-client-js" "0.12.0-pre.1" - "@polywrap/core-js" "0.12.0-pre.1" - "@polywrap/msgpack-js" "0.12.0-pre.1" - "@polywrap/plugin-js" "0.12.0-pre.1" - "@polywrap/result" "0.12.0-pre.1" - "@polywrap/tracing-js" "0.12.0-pre.1" - "@polywrap/uri-resolver-extensions-js" "0.12.0-pre.1" - "@polywrap/uri-resolvers-js" "0.12.0-pre.1" - "@polywrap/wrap-manifest-types-js" "0.12.0-pre.1" - -"@polywrap/concurrent-plugin-js@~0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@polywrap/concurrent-plugin-js/-/concurrent-plugin-js-0.10.0.tgz#662e49976f75f30632b302d515bd22c7643afc44" - integrity sha512-sc11ffs34ScBHPB9uHFZuTmF8yPtZT81sBpBj7f4MlmrRDxtJS56Y7k/qL6L1xuwsnmeFipi5JGau1CcBaYmJQ== - dependencies: - "@polywrap/core-js" "0.10.0" - "@polywrap/msgpack-js" "0.10.0" - "@polywrap/plugin-js" "0.10.0" +"@polywrap/asyncify-js@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@polywrap/asyncify-js/-/asyncify-js-0.12.0.tgz#8a7425f021b23e7301cd42955950b1d99673e3a7" + integrity sha512-gIom6pyz6MkE42BvFIAJH+DmCyv3oG8mZXpAx4H0oi34CLW4itzluN0uvkUmNZ744P1c5wMiQOMaCnXqTBZS2A== -"@polywrap/config-bundle-types-js@0.12.0-pre.1": - version "0.12.0-pre.1" - resolved "https://registry.yarnpkg.com/@polywrap/config-bundle-types-js/-/config-bundle-types-js-0.12.0-pre.1.tgz#72a389da3f309d9cfef555a1cbd828ecec0dac8d" - integrity sha512-zef/QxM2AmgEWPc3LuKCJwfn2QK0S9uQ83K+MgTiNHp9hoMmdG9ij4MUZDXpnJTyMn0dgREBpDqCHPfTsCbDLw== +"@polywrap/client-config-builder-js@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@polywrap/client-config-builder-js/-/client-config-builder-js-0.12.0.tgz#24dae5e133442a80de84f02d71e171bd5d5389bd" + integrity sha512-hWs8G0sTBckumvDjsxDymxrE5ggxmYE6kSYoMBtPvPY5Va5y9ElEJAdTtBTlELIugs6/f/3EHLzPyIdwaYaB/Q== + dependencies: + "@polywrap/config-bundle-types-js" "0.12.0" + "@polywrap/core-js" "0.12.0" + "@polywrap/plugin-js" "0.12.0" + "@polywrap/sys-config-bundle-js" "0.12.0" + "@polywrap/uri-resolver-extensions-js" "0.12.0" + "@polywrap/uri-resolvers-js" "0.12.0" + "@polywrap/wasm-js" "0.12.0" + "@polywrap/web3-config-bundle-js" "0.12.0" + +"@polywrap/client-js@0.12.0", "@polywrap/client-js@~0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@polywrap/client-js/-/client-js-0.12.0.tgz#c57348f5a760311fcd682b663be4a2a6edfe860b" + integrity sha512-ACdjwA+l3udCgpbDZlRiTzvQftajmb0OFLDZ0KzD/iLFqbNksMp1rFb4Cju3wKKVww6WB48pusgnBWFTdXP2Pw== + dependencies: + "@polywrap/client-config-builder-js" "0.12.0" + "@polywrap/core-client-js" "0.12.0" + "@polywrap/core-js" "0.12.0" + "@polywrap/msgpack-js" "0.12.0" + "@polywrap/plugin-js" "0.12.0" + "@polywrap/result" "0.12.0" + "@polywrap/tracing-js" "0.12.0" + "@polywrap/uri-resolver-extensions-js" "0.12.0" + "@polywrap/uri-resolvers-js" "0.12.0" + "@polywrap/wrap-manifest-types-js" "0.12.0" + +"@polywrap/concurrent-plugin-js@~0.12.0-pre.0": + version "0.12.0-pre.0" + resolved "https://registry.yarnpkg.com/@polywrap/concurrent-plugin-js/-/concurrent-plugin-js-0.12.0-pre.0.tgz#0cd41ff41c2be2f555432bd514392ed8e8448889" + integrity sha512-0+DJ9KO0oX+JxIC5UxNWmaXS6IH6mNUOh1bpMM34jaL+QUXjehZVtwnNpifFsaKd71Xf5DkozAkn3mSDscUgFw== + dependencies: + "@polywrap/core-js" "~0.12.0-pre.0" + "@polywrap/msgpack-js" "~0.12.0-pre.0" + "@polywrap/plugin-js" "~0.12.0-pre.0" + +"@polywrap/config-bundle-types-js@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@polywrap/config-bundle-types-js/-/config-bundle-types-js-0.12.0.tgz#fa8d023d470c1d793526339514e4bd59a2e3c518" + integrity sha512-JDihS10m+ncE42QZSP7ujuz4S9ZsSQsUPOZbyhqCZ6sw5LCmCxuR5ogVX6uF9Visd5L92ylQsoxFQk/jLoo0iQ== dependencies: - "@polywrap/core-js" "0.12.0-pre.1" + "@polywrap/core-js" "0.12.0" -"@polywrap/core-client-js@0.12.0-pre.1": - version "0.12.0-pre.1" - resolved "https://registry.yarnpkg.com/@polywrap/core-client-js/-/core-client-js-0.12.0-pre.1.tgz#9d4962e660ea467a98f4ff000ca1e00245dc305f" - integrity sha512-KQd/NLtdyksBGbnM8tLn+C+lugWaJT9q41nd+XNzbvH+CoDC4mdvZxAzzTusYRzNiHXvxz4/5hb/RfJRT5R2wA== +"@polywrap/core-client-js@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@polywrap/core-client-js/-/core-client-js-0.12.0.tgz#8e032bd11dc9608b1b14d371222a53041a4643dc" + integrity sha512-jHDVlBPGujhBbhJ5IjZwc+W4UfdMRc3xZ9RqOkJxp0MG7QFjiBoHhY/UHNNDMahXg7mWxpU1nZyCzcIx+/hO8w== dependencies: - "@polywrap/core-js" "0.12.0-pre.1" - "@polywrap/msgpack-js" "0.12.0-pre.1" - "@polywrap/result" "0.12.0-pre.1" - "@polywrap/tracing-js" "0.12.0-pre.1" - "@polywrap/wrap-manifest-types-js" "0.12.0-pre.1" + "@polywrap/core-js" "0.12.0" + "@polywrap/msgpack-js" "0.12.0" + "@polywrap/result" "0.12.0" + "@polywrap/tracing-js" "0.12.0" + "@polywrap/wrap-manifest-types-js" "0.12.0" "@polywrap/core-js@0.10.0": version "0.10.0" @@ -2212,53 +2212,24 @@ "@polywrap/tracing-js" "0.10.0" "@polywrap/wrap-manifest-types-js" "0.10.0" -"@polywrap/core-js@0.10.0-pre.10": - version "0.10.0-pre.10" - resolved "https://registry.yarnpkg.com/@polywrap/core-js/-/core-js-0.10.0-pre.10.tgz#3209dbcd097d3533574f1231c10ef633c2466d5c" - integrity sha512-a/1JtfrHafRh2y0XgK5dNc82gVzjCbXSdKof7ojDghCSRSHUxTw/cJ+pcLrPJhrsTi7VfTM0BFjw3/wC5RutuA== - dependencies: - "@polywrap/result" "0.10.0-pre.10" - "@polywrap/tracing-js" "0.10.0-pre.10" - "@polywrap/wrap-manifest-types-js" "0.10.0-pre.10" - -"@polywrap/core-js@0.10.1", "@polywrap/core-js@~0.10.1": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@polywrap/core-js/-/core-js-0.10.1.tgz#09405c745f591d5f7ec243db95a61540a05296cb" - integrity sha512-BJpWDikfd/6h64Lf7FKy0g5O3a5OKaL915boni1pHP54wF4xBWdHkKixLGD8w4BZWRiW9v42PpYBhWqYZwSNGg== - dependencies: - "@polywrap/result" "0.10.1" - "@polywrap/tracing-js" "0.10.1" - "@polywrap/wrap-manifest-types-js" "0.10.1" - -"@polywrap/core-js@0.12.0-pre.1", "@polywrap/core-js@~0.12.0-pre.1": - version "0.12.0-pre.1" - resolved "https://registry.yarnpkg.com/@polywrap/core-js/-/core-js-0.12.0-pre.1.tgz#b376db87e0e60bd5940941b80c8cd064c44dc142" - integrity sha512-BMxp5nEJGGIerFsRR7x+CMSthIF0BjFFTTmWmpy3s5aTizKUfTtw5XIMnSeUAswA7+4beo8GSkS2u6L+T+u7YA== - dependencies: - "@polywrap/result" "0.12.0-pre.1" - "@polywrap/tracing-js" "0.12.0-pre.1" - "@polywrap/wrap-manifest-types-js" "0.12.0-pre.1" - -"@polywrap/datetime-plugin-js@~0.10.0": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@polywrap/datetime-plugin-js/-/datetime-plugin-js-0.10.1.tgz#8042673034c09155f3d0972eef87d87cb53b1914" - integrity sha512-eB6osYgISVQjnz6SDJ+02Z5HIC3Qg82hU6m1b02fTCsAsJqIDTSoe5AUugd0KqQ3C+MHv03TlGuFn6ekjyutGg== +"@polywrap/core-js@0.12.0", "@polywrap/core-js@~0.12.0", "@polywrap/core-js@~0.12.0-pre.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@polywrap/core-js/-/core-js-0.12.0.tgz#ec68d6d6489df55bfa7a6bc0d5910a5ff9eb157a" + integrity sha512-wWQQ/pb+A4bM3U9bF6pVvwlKWLjF1nkbO3pJ5AKoHIe/5glFYAM/zCq/CTZlTsFzpNsczcru0mbQY5C8wK8aOw== dependencies: - "@polywrap/core-js" "~0.10.1" - "@polywrap/plugin-js" "~0.10.1" + "@polywrap/result" "0.12.0" + "@polywrap/tracing-js" "0.12.0" + "@polywrap/wrap-manifest-types-js" "0.12.0" -"@polywrap/ethereum-provider-js-v1@npm:@polywrap/ethereum-provider-js@~0.2.4": - version "0.2.4" - resolved "https://registry.yarnpkg.com/@polywrap/ethereum-provider-js/-/ethereum-provider-js-0.2.4.tgz#3df1a6548da191618bb5cae7928c7427e69e0030" - integrity sha512-64xRnniboxxHNZ4/gD6SS4T+QmJPUMbIYZ2hyLODb2QgH3qDBiU+i4gdiQ/BL3T8Sn/0iOxvTIgZalVDJRh2iw== +"@polywrap/datetime-plugin-js@~0.12.0-pre.0": + version "0.12.0-pre.0" + resolved "https://registry.yarnpkg.com/@polywrap/datetime-plugin-js/-/datetime-plugin-js-0.12.0-pre.0.tgz#72fa082e6485e1fc259c48fe89a351d69272ae0b" + integrity sha512-BKE5gZlL8LlVl9WSodkdFnIBSkKM4QSxYdTR5JhpMOPiStHFLqsZWQPCpgtRtTy+pyK/rdXxfKihoL5P9ee6oQ== dependencies: - "@ethersproject/address" "5.7.0" - "@ethersproject/providers" "5.7.0" - "@polywrap/core-js" "0.10.0-pre.10" - "@polywrap/plugin-js" "0.10.0-pre.10" - ethers "5.7.0" + "@polywrap/core-js" "~0.12.0-pre.0" + "@polywrap/plugin-js" "~0.12.0-pre.0" -"@polywrap/ethereum-provider-js@0.3.1", "@polywrap/ethereum-provider-js@npm:@polywrap/ethereum-provider-js@~0.3.1": +"@polywrap/ethereum-provider-js@0.3.1": version "0.3.1" resolved "https://registry.yarnpkg.com/@polywrap/ethereum-provider-js/-/ethereum-provider-js-0.3.1.tgz#ffdb9425c819ee76d3e3d5ade7d1b044077037e0" integrity sha512-El2d3gE2CFdGNzKQhO+IPP79lhyQmkAGlpQadaW/EDyFDjERLckYDLPrwUCXG0agUcQZcNY1nHn2hknumw/yWg== @@ -2269,31 +2240,42 @@ "@polywrap/plugin-js" "0.10.0" ethers "5.7.0" -"@polywrap/file-system-plugin-js@~0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@polywrap/file-system-plugin-js/-/file-system-plugin-js-0.10.0.tgz#7814e0b1c0bb170ab85500f67aca6af4c17ec19f" - integrity sha512-QWDpeVBACeK8PqZUwby/zlozG/07fpvJN5kQtw5e7ha4K5blX1j1i6ixgLKlYyQsaaTBxS6aAF3C0ryt4BsJcQ== +"@polywrap/ethereum-wallet-js@~0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@polywrap/ethereum-wallet-js/-/ethereum-wallet-js-0.1.0.tgz#1af5800aab3c4cedfcd1e4e5e305d5d5ef733bea" + integrity sha512-GTg4X0gyFHXNAHSDxe6QfiWJv8z/pwobnVyKw4rcmBLw7tqcTiYXk4kU0QfWV3JLV/8rvzESl+FtXPC68dUMIA== dependencies: - "@polywrap/core-js" "0.10.0" - "@polywrap/plugin-js" "0.10.0" + "@ethersproject/address" "5.7.0" + "@ethersproject/providers" "5.7.0" + "@polywrap/core-js" "~0.12.0-pre.0" + "@polywrap/plugin-js" "~0.12.0-pre.0" + ethers "5.7.0" -"@polywrap/http-plugin-js@~0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@polywrap/http-plugin-js/-/http-plugin-js-0.10.0.tgz#930ec9dbaa762b71d8905ad02a77d5d574707642" - integrity sha512-t/yvoOAGUwsuS37ZQkkBZOogNbeJadtHwitMMA6XGs1jDANP1Xim/xWXWBYC3W1YJ8pbUeO8bHZHTBaJ7SC0cA== +"@polywrap/file-system-plugin-js@~0.12.0-pre.0": + version "0.12.0-pre.0" + resolved "https://registry.yarnpkg.com/@polywrap/file-system-plugin-js/-/file-system-plugin-js-0.12.0-pre.0.tgz#ca6395d36c65b9a185f63233ce31c82578b9dc81" + integrity sha512-qu1lLoZQhf8tSz9844tjI6d1ndyjrXpQ+P4ZPIKGtPFVnUOLwtVJCfE9eQtY4MAMz/yRBJ9saWEuaoZHI7zUXg== dependencies: - "@polywrap/core-js" "0.10.0" - "@polywrap/plugin-js" "0.10.0" + "@polywrap/core-js" "~0.12.0-pre.0" + "@polywrap/plugin-js" "~0.12.0-pre.0" + +"@polywrap/http-plugin-js@~0.12.0-pre.0": + version "0.12.0-pre.0" + resolved "https://registry.yarnpkg.com/@polywrap/http-plugin-js/-/http-plugin-js-0.12.0-pre.0.tgz#7e276c5ffd62500b0736444bd95862b133e809b9" + integrity sha512-kB6gwMliDjaoKMIWSetLBusV8QXiAwFbw6dDhiTKhIBkVFSWRdRWLbA2VY3apnSeXkrbwfTX6iIgxS9D8LoOrw== + dependencies: + "@polywrap/core-js" "~0.12.0-pre.0" + "@polywrap/plugin-js" "~0.12.0-pre.0" axios "0.21.4" form-data "4.0.0" -"@polywrap/logger-plugin-js@~0.10.0": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@polywrap/logger-plugin-js/-/logger-plugin-js-0.10.1.tgz#220cc248cb1381aa46c1f773ed8ce77da420280c" - integrity sha512-ipqS7A6Mc0Fp0e/qg8RyGIulfk6mGS9acKii3kQoJ59/Zf/Yy4Eg3HWDtnlgBIdIgwyZKD8amiF42VKRO6R3Ig== +"@polywrap/logger-plugin-js@~0.12.0-pre.0": + version "0.12.0-pre.0" + resolved "https://registry.yarnpkg.com/@polywrap/logger-plugin-js/-/logger-plugin-js-0.12.0-pre.0.tgz#ebc6f6f7a80bcbe8f24608303e1c4d63e9f157cf" + integrity sha512-aY3R07nK2svxiBxkJstHHfDak/Gin/23iCDFce4qWISEvsMPA0krte7Ll2VAsAAEBuwX1y1fACQ/xk01xLxmGg== dependencies: - "@polywrap/core-js" "0.10.0" - "@polywrap/plugin-js" "0.10.0" + "@polywrap/core-js" "~0.12.0-pre.0" + "@polywrap/plugin-js" "~0.12.0-pre.0" "@polywrap/msgpack-js@0.10.0": version "0.10.0" @@ -2302,24 +2284,10 @@ dependencies: "@msgpack/msgpack" "2.7.2" -"@polywrap/msgpack-js@0.10.0-pre.10": - version "0.10.0-pre.10" - resolved "https://registry.yarnpkg.com/@polywrap/msgpack-js/-/msgpack-js-0.10.0-pre.10.tgz#ac15d960dba2912f7ed657634f873e3c22c71843" - integrity sha512-z+lMVYKIYRyDrRDW5jFxt8Q6rVXBfMohI48Ht79X9DU1g6FdJInxhgXwVnUUQfrgtVoSgDLChdFlqnpi2JkEaQ== - dependencies: - "@msgpack/msgpack" "2.7.2" - -"@polywrap/msgpack-js@0.10.1": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@polywrap/msgpack-js/-/msgpack-js-0.10.1.tgz#c3552eb51373164a78abfa80b52d9b02798ffd95" - integrity sha512-EI4Vak4Yi6NqM71eChWc3APe2svoR6BEeCVsxGAGI6p6x04r27J6+C3o1ptwHxiwyy8+J7B5W+ynaVo8qn5Zrw== - dependencies: - "@msgpack/msgpack" "2.7.2" - -"@polywrap/msgpack-js@0.12.0-pre.1": - version "0.12.0-pre.1" - resolved "https://registry.yarnpkg.com/@polywrap/msgpack-js/-/msgpack-js-0.12.0-pre.1.tgz#e87f6951a5a1ba98c07dc534bec695f46880a38e" - integrity sha512-/ea7M1hUC3+SJIdcvrfmrM/w8DVnRScok1Xdkkv20CTUDP/sDElSssB+DTtzAv/UCjhpiHzi4MRlA/AcjR1ODw== +"@polywrap/msgpack-js@0.12.0", "@polywrap/msgpack-js@~0.12.0-pre.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@polywrap/msgpack-js/-/msgpack-js-0.12.0.tgz#87dc9fc83c1e8cbe889cca2f6c992141f6324c8f" + integrity sha512-7XVT5jqPkdgiN9Ql1quvkXf6lWxMPWeyEAaMPhrxRb45l5z9E8wFgarvUSRQ3htG1WpAvG5FdXY3/STqvCKXuw== dependencies: "@msgpack/msgpack" "2.7.2" @@ -2334,71 +2302,39 @@ "@polywrap/tracing-js" "0.10.0" "@polywrap/wrap-manifest-types-js" "0.10.0" -"@polywrap/plugin-js@0.10.0-pre.10": - version "0.10.0-pre.10" - resolved "https://registry.yarnpkg.com/@polywrap/plugin-js/-/plugin-js-0.10.0-pre.10.tgz#090c1963f40ab862a09deda8c18e6d522fd2e3f2" - integrity sha512-J/OEGEdalP83MnO4bBTeqC7eX+NBMQq6TxmUf68iNIydl8fgN7MNB7+koOTKdkTtNzrwXOnhavHecdSRZxuhDA== - dependencies: - "@polywrap/core-js" "0.10.0-pre.10" - "@polywrap/msgpack-js" "0.10.0-pre.10" - "@polywrap/result" "0.10.0-pre.10" - "@polywrap/tracing-js" "0.10.0-pre.10" - "@polywrap/wrap-manifest-types-js" "0.10.0-pre.10" - -"@polywrap/plugin-js@0.12.0-pre.1", "@polywrap/plugin-js@~0.12.0-pre.1": - version "0.12.0-pre.1" - resolved "https://registry.yarnpkg.com/@polywrap/plugin-js/-/plugin-js-0.12.0-pre.1.tgz#86865f63545086b47ebfbd546ed18ab0ce146752" - integrity sha512-juHMEUsuoY/ZpbsVWZ9puMkX83PcCeT/hKKWxVl+CfmoWpmFiatorgdS3kMgr/O19+o/b6eyd/sqKyWSxmVdQw== - dependencies: - "@polywrap/core-js" "0.12.0-pre.1" - "@polywrap/msgpack-js" "0.12.0-pre.1" - "@polywrap/result" "0.12.0-pre.1" - "@polywrap/tracing-js" "0.12.0-pre.1" - "@polywrap/wrap-manifest-types-js" "0.12.0-pre.1" - -"@polywrap/plugin-js@~0.10.1": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@polywrap/plugin-js/-/plugin-js-0.10.1.tgz#e11ce19dde01245750c297a62f2f75fd58ef9ced" - integrity sha512-WBk4ZUrI5m6FG4bIocLHo7XS+QMeNa23odli6Ss6onUyo7mPIo1wlceEgw7Cu4gd/3bmuc6VGoCKRA1/glBT3g== - dependencies: - "@polywrap/core-js" "0.10.1" - "@polywrap/msgpack-js" "0.10.1" - "@polywrap/result" "0.10.1" - "@polywrap/tracing-js" "0.10.1" - "@polywrap/wrap-manifest-types-js" "0.10.1" +"@polywrap/plugin-js@0.12.0", "@polywrap/plugin-js@~0.12.0", "@polywrap/plugin-js@~0.12.0-pre.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@polywrap/plugin-js/-/plugin-js-0.12.0.tgz#90482acaaec4547aaaea6f9acc3d18adf69751ac" + integrity sha512-ly8bvdJGgQVAXuGuHRJPzdtmUVRpjK1amVwZvzcD4Oaz6mr65l9VtYN79DQK9UXhIZ7hYpxtSBeLFKXZ4hmbOg== + dependencies: + "@polywrap/core-js" "0.12.0" + "@polywrap/msgpack-js" "0.12.0" + "@polywrap/result" "0.12.0" + "@polywrap/tracing-js" "0.12.0" + "@polywrap/wrap-manifest-types-js" "0.12.0" "@polywrap/result@0.10.0": version "0.10.0" resolved "https://registry.yarnpkg.com/@polywrap/result/-/result-0.10.0.tgz#712339223fba524dfabfb0bf868411f357d52e34" integrity sha512-IxTBfGP89/OPNlUPMkjOrdYt/hwyvgI7TsYap6S35MHo4pXkR9mskzrHJ/AGE5DyGqP81CIIJNSYfooF97KY3A== -"@polywrap/result@0.10.0-pre.10": - version "0.10.0-pre.10" - resolved "https://registry.yarnpkg.com/@polywrap/result/-/result-0.10.0-pre.10.tgz#6e88ac447d92d8a10c7e7892a6371af29a072240" - integrity sha512-SqNnEbXky4dFXgps2B2juFShq1024do0f1HLUbuj3MlIPp5aW9g9sfBslsy3YTnpg2QW7LFVT15crrJMgbowIQ== - -"@polywrap/result@0.10.1": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@polywrap/result/-/result-0.10.1.tgz#e60122396521fc07edda6951915ada4aaa5f6694" - integrity sha512-9EoS/JUgKFwRk396lQ+3tDAGbZExsOf26SUG4l41HJv4FZLLLOL5ksppJK8StvjtbpQOIgFls23c83CXzS1hBQ== - -"@polywrap/result@0.12.0-pre.1": - version "0.12.0-pre.1" - resolved "https://registry.yarnpkg.com/@polywrap/result/-/result-0.12.0-pre.1.tgz#5b5ea8b4e3b0be65ee27e66050acd3f0fb6096c0" - integrity sha512-OgBmuuwCcQ8zCX+FbG01RQ402xfnwarHR7zoc9+7EXhd+jd0BdbUCg026bK43VjRZT5cQPbh0XWh5YzK1ozkGA== - -"@polywrap/sys-config-bundle-js@0.12.0-pre.1": - version "0.12.0-pre.1" - resolved "https://registry.yarnpkg.com/@polywrap/sys-config-bundle-js/-/sys-config-bundle-js-0.12.0-pre.1.tgz#7487c5e5d181aa4140ab8d7015fcb0779a4af9f8" - integrity sha512-upyi2kwIr4/sL6bPL/ECqJpisaSFtIm5wwwl8PoUE5Ib+T/O2WUZxc4A3JNczV0Y1UnqPh6cTbfDH8qXqviAdQ== - dependencies: - "@polywrap/concurrent-plugin-js" "~0.10.0" - "@polywrap/config-bundle-types-js" "0.12.0-pre.1" - "@polywrap/datetime-plugin-js" "~0.10.0" - "@polywrap/file-system-plugin-js" "~0.10.0" - "@polywrap/http-plugin-js" "~0.10.0" - "@polywrap/logger-plugin-js" "~0.10.0" - "@polywrap/uri-resolver-extensions-js" "0.12.0-pre.1" +"@polywrap/result@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@polywrap/result/-/result-0.12.0.tgz#8cd72fa989098848b56316dfd7ed428831c5b540" + integrity sha512-CdZa21Pa+D9HdxoPwaUoLSlxbBppGiaoldnH4GfbeE/iWOCHQ2qnsVecV+jcQdM9Ih/o+Hpl7cqT5VzV9LEzsA== + +"@polywrap/sys-config-bundle-js@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@polywrap/sys-config-bundle-js/-/sys-config-bundle-js-0.12.0.tgz#e65efc5b3a080b7e01ed0131882456dbb3439d24" + integrity sha512-6qsH3rgXyfBDE/1xFK1bKwwnqjz3CJvlpr3SHLCm+Y+wS9hVtr0L/t/XdCrlS+gWblU8/GpkpI100RUJJRpPlQ== + dependencies: + "@polywrap/concurrent-plugin-js" "~0.12.0-pre.0" + "@polywrap/config-bundle-types-js" "0.12.0" + "@polywrap/datetime-plugin-js" "~0.12.0-pre.0" + "@polywrap/file-system-plugin-js" "~0.12.0-pre.0" + "@polywrap/http-plugin-js" "~0.12.0-pre.0" + "@polywrap/logger-plugin-js" "~0.12.0-pre.0" + "@polywrap/uri-resolver-extensions-js" "0.12.0" base64-to-uint8array "1.0.0" "@polywrap/tracing-js@0.10.0": @@ -2413,10 +2349,10 @@ "@opentelemetry/sdk-trace-base" "1.6.0" "@opentelemetry/sdk-trace-web" "1.6.0" -"@polywrap/tracing-js@0.10.0-pre.10": - version "0.10.0-pre.10" - resolved "https://registry.yarnpkg.com/@polywrap/tracing-js/-/tracing-js-0.10.0-pre.10.tgz#f50fb01883dcba4217a1711718aa53f3dd61cb1c" - integrity sha512-6wFw/zANVPG0tWMTSxwDzIpABVSSR9wO4/XxhCnKKgXwW6YANhtLj86uSRMTWqXeX2rpHwpMoWh4MDgYeAf+ng== +"@polywrap/tracing-js@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@polywrap/tracing-js/-/tracing-js-0.12.0.tgz#750238d92f6f29a4e8fc7e1b08cb27c7150c3279" + integrity sha512-wtvhBisczaMf4SAqIpmQlWjkaZmy+psZtRyVf3EDNmnn6gVfXEEqz/+Ewo+HfmBjDhLg7QC/x9XDo/eRgwHrcA== dependencies: "@fetsorn/opentelemetry-console-exporter" "0.0.3" "@opentelemetry/api" "1.2.0" @@ -2425,73 +2361,48 @@ "@opentelemetry/sdk-trace-base" "1.6.0" "@opentelemetry/sdk-trace-web" "1.6.0" -"@polywrap/tracing-js@0.10.1": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@polywrap/tracing-js/-/tracing-js-0.10.1.tgz#488dd505f3c5232cb292e848de7a182c83a4405a" - integrity sha512-4ZjPgNBFbX4DIzqRbzyMq64FvYv51JLuFIxL0EweI5paEbR69a1m4iN4BLxJc+jBjDYpWgy399+tYGnc94aM6A== +"@polywrap/uri-resolver-extensions-js@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@polywrap/uri-resolver-extensions-js/-/uri-resolver-extensions-js-0.12.0.tgz#5819a447ae780e4f1092e613bc709741ef9c25e4" + integrity sha512-EE/JaVAH5Zt521kuCMGMRgdrHUlFqTk6f85e0UJo+DX6PcerJVj/KrfHQUKt/rM9SVD4mQaQA53k7/3DJhFnaw== dependencies: - "@fetsorn/opentelemetry-console-exporter" "0.0.3" - "@opentelemetry/api" "1.2.0" - "@opentelemetry/exporter-trace-otlp-http" "0.32.0" - "@opentelemetry/resources" "1.6.0" - "@opentelemetry/sdk-trace-base" "1.6.0" - "@opentelemetry/sdk-trace-web" "1.6.0" + "@polywrap/core-js" "0.12.0" + "@polywrap/result" "0.12.0" + "@polywrap/uri-resolvers-js" "0.12.0" + "@polywrap/wasm-js" "0.12.0" + "@polywrap/wrap-manifest-types-js" "0.12.0" -"@polywrap/tracing-js@0.12.0-pre.1": - version "0.12.0-pre.1" - resolved "https://registry.yarnpkg.com/@polywrap/tracing-js/-/tracing-js-0.12.0-pre.1.tgz#53794c111a42fca5921e3ac1bade7acbe025140d" - integrity sha512-TbLJisZujA9XbSPAvBrC0iTsJiqC1DDF3BKIP1m9d6Bs4KX4zS2UhZzQAJZFKaAo/acoUW9NgXd6O8PtixZmGw== +"@polywrap/uri-resolvers-js@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@polywrap/uri-resolvers-js/-/uri-resolvers-js-0.12.0.tgz#2a62a3af134cc091d69c4344f5e151830377b275" + integrity sha512-s1FoSjpmPpycmHYEYFQeZPE/JPh2cvq4ALHmMw/CBgd/6ornmzYc2XQE28zeF1sNBglmZIhB10MEkT7A0J8PDw== dependencies: - "@fetsorn/opentelemetry-console-exporter" "0.0.3" - "@opentelemetry/api" "1.2.0" - "@opentelemetry/exporter-trace-otlp-http" "0.32.0" - "@opentelemetry/resources" "1.6.0" - "@opentelemetry/sdk-trace-base" "1.6.0" - "@opentelemetry/sdk-trace-web" "1.6.0" + "@polywrap/core-js" "0.12.0" + "@polywrap/result" "0.12.0" + "@polywrap/wrap-manifest-types-js" "0.12.0" -"@polywrap/uri-resolver-extensions-js@0.12.0-pre.1": - version "0.12.0-pre.1" - resolved "https://registry.yarnpkg.com/@polywrap/uri-resolver-extensions-js/-/uri-resolver-extensions-js-0.12.0-pre.1.tgz#d62ab34b859a74924a139e94a22b30a6b09759af" - integrity sha512-sRT7I7RYkijQpuD+0+gDsUTJsVSL9M9caowfFOPkDhHuTcoIct/Fte/hAD5ncDChSUc84MZgHZPWcQxOz12zzg== - dependencies: - "@polywrap/core-js" "0.12.0-pre.1" - "@polywrap/result" "0.12.0-pre.1" - "@polywrap/uri-resolvers-js" "0.12.0-pre.1" - "@polywrap/wasm-js" "0.12.0-pre.1" - "@polywrap/wrap-manifest-types-js" "0.12.0-pre.1" - -"@polywrap/uri-resolvers-js@0.12.0-pre.1": - version "0.12.0-pre.1" - resolved "https://registry.yarnpkg.com/@polywrap/uri-resolvers-js/-/uri-resolvers-js-0.12.0-pre.1.tgz#58b6238cde9380dbb302e3a0c00f7a493a679765" - integrity sha512-tVqTWRS4rtlq3JKQHyOPqE2lql/qCWT+cy7IYT/VN/jaD6nHLMI+tWwp9spDlibotOn/6Bwtk+v6HOPS6SkiOg== - dependencies: - "@polywrap/core-js" "0.12.0-pre.1" - "@polywrap/result" "0.12.0-pre.1" - "@polywrap/wrap-manifest-types-js" "0.12.0-pre.1" - -"@polywrap/wasm-js@0.12.0-pre.1": - version "0.12.0-pre.1" - resolved "https://registry.yarnpkg.com/@polywrap/wasm-js/-/wasm-js-0.12.0-pre.1.tgz#d1641b12692f7d90dc16c8687b6a8e2f70153124" - integrity sha512-ItIJnvz9DuCifaiYy+ZQiTXU5gotUUcSA/BmO+joe1b96c5b1n7gbiU3eqaYWPDpzNxo417/Utwr8RHtZ4248Q== - dependencies: - "@polywrap/asyncify-js" "0.12.0-pre.1" - "@polywrap/core-js" "0.12.0-pre.1" - "@polywrap/msgpack-js" "0.12.0-pre.1" - "@polywrap/result" "0.12.0-pre.1" - "@polywrap/tracing-js" "0.12.0-pre.1" - "@polywrap/wrap-manifest-types-js" "0.12.0-pre.1" - -"@polywrap/web3-config-bundle-js@0.12.0-pre.1": - version "0.12.0-pre.1" - resolved "https://registry.yarnpkg.com/@polywrap/web3-config-bundle-js/-/web3-config-bundle-js-0.12.0-pre.1.tgz#477a64fa4912f5ac5edb94037315e0f6cdaa92d7" - integrity sha512-L+yZBfooyGgOLdoNcMiEHexpNf+3OnxzVpFlHtR9JdHJmOv4VxqI0LFuVoBDCBwv6m/zxzSYw9C/v8LzIPQLgA== - dependencies: - "@polywrap/config-bundle-types-js" "0.12.0-pre.1" - "@polywrap/ethereum-provider-js" "npm:@polywrap/ethereum-provider-js@~0.3.1" - "@polywrap/ethereum-provider-js-v1" "npm:@polywrap/ethereum-provider-js@~0.2.4" - "@polywrap/sys-config-bundle-js" "0.12.0-pre.1" - "@polywrap/uri-resolver-extensions-js" "0.12.0-pre.1" - "@polywrap/wasm-js" "0.12.0-pre.1" +"@polywrap/wasm-js@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@polywrap/wasm-js/-/wasm-js-0.12.0.tgz#e65320428976fb21eca16f0a499afb3fb12d86f6" + integrity sha512-NLu8AGewxSOq3Wv8eLgWn6y0TMho4nn3E5WFbE1ePgoPm6pm3FalVOrBJi04mUv1INm2Ty/VJTfQrzNVjIKJdQ== + dependencies: + "@polywrap/asyncify-js" "0.12.0" + "@polywrap/core-js" "0.12.0" + "@polywrap/msgpack-js" "0.12.0" + "@polywrap/result" "0.12.0" + "@polywrap/tracing-js" "0.12.0" + "@polywrap/wrap-manifest-types-js" "0.12.0" + +"@polywrap/web3-config-bundle-js@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@polywrap/web3-config-bundle-js/-/web3-config-bundle-js-0.12.0.tgz#e9e2002ca05c913b8ed8a8b1750057b9bc478ec1" + integrity sha512-srhHT+xG4+2EbKmER26RNNJJmoy4LNsYbFRtUOXbjkG9rXRFxNA5gWs2p9ZMozyBGac0X+RQySU6DR5PvqnsGg== + dependencies: + "@polywrap/config-bundle-types-js" "0.12.0" + "@polywrap/ethereum-wallet-js" "~0.1.0" + "@polywrap/sys-config-bundle-js" "0.12.0" + "@polywrap/uri-resolver-extensions-js" "0.12.0" + "@polywrap/wasm-js" "0.12.0" base64-to-uint8array "1.0.0" "@polywrap/wrap-manifest-types-js@0.10.0": @@ -2503,31 +2414,12 @@ jsonschema "1.4.0" semver "7.4.0" -"@polywrap/wrap-manifest-types-js@0.10.0-pre.10": - version "0.10.0-pre.10" - resolved "https://registry.yarnpkg.com/@polywrap/wrap-manifest-types-js/-/wrap-manifest-types-js-0.10.0-pre.10.tgz#81b339f073c48880b34f06f151aa41373f442f88" - integrity sha512-Hgsa6nJIh0cCqKO14ufjAsN0WEKuLuvFBfBycjoRLfkwD3fcxP/xrvWgE2NRSvwQ77aV6PGMbhlSMDGI5jahrw== - dependencies: - "@apidevtools/json-schema-ref-parser" "9.0.9" - jsonschema "1.4.0" - semver "7.3.8" - -"@polywrap/wrap-manifest-types-js@0.10.1": - version "0.10.1" - resolved "https://registry.yarnpkg.com/@polywrap/wrap-manifest-types-js/-/wrap-manifest-types-js-0.10.1.tgz#df7099357af2ccdbb61a6fb42ebaa047c6d97d70" - integrity sha512-0UxTZY6AcQpEkeL9HMMZvHv5a0OXXSRr4clPVyyo7BAmUjwJRE0veKY2hy0bR0Je7rZjxlwR5uS9+CToqYAd9g== - dependencies: - "@apidevtools/json-schema-ref-parser" "9.0.9" - "@polywrap/msgpack-js" "0.10.1" - jsonschema "1.4.0" - semver "7.5.0" - -"@polywrap/wrap-manifest-types-js@0.12.0-pre.1": - version "0.12.0-pre.1" - resolved "https://registry.yarnpkg.com/@polywrap/wrap-manifest-types-js/-/wrap-manifest-types-js-0.12.0-pre.1.tgz#81ea326c2ccebf3761425a44fda26b171fad4409" - integrity sha512-BdM1QrSb2gEbFqeMyh1UPa1zUdilwkNyMr5A8Pfw1nYv93W9/UK8O2IYXeh1WUWAnsPSgjNbtM0bbdXMqqDyHQ== +"@polywrap/wrap-manifest-types-js@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@polywrap/wrap-manifest-types-js/-/wrap-manifest-types-js-0.12.0.tgz#5ca209cdcad2f35e2064aa6b8174c2fbbc9fbcbc" + integrity sha512-s5CZ/UNihiQ+zgC8tuJgBBiiAg/5iAE8vjnqq8993nSJ8XtoO9t6NO93ANXUFirPxNtrCK2qQzbrt/HygtdCuA== dependencies: - "@polywrap/msgpack-js" "0.12.0-pre.1" + "@polywrap/msgpack-js" "0.12.0" ajv "8.12.0" semver "7.5.0" @@ -2735,9 +2627,9 @@ integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw== "@types/lodash@^4.14.182": - version "4.14.195" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.195.tgz#bafc975b252eb6cea78882ce8a7b6bf22a6de632" - integrity sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg== + version "4.14.196" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.196.tgz#a7c3d6fc52d8d71328b764e28e080b4169ec7a95" + integrity sha512-22y3o88f4a94mKljsZcanlNWPzO0uBsBdzLAngf2tp533LzZcQzb6+eZPJ+vCTt+bqF2XnvT9gejTLsAcJAJyQ== "@types/minimatch@*", "@types/minimatch@^5.1.2": version "5.1.2" @@ -3232,6 +3124,18 @@ array.prototype.reduce@^1.0.5: es-array-method-boxes-properly "^1.0.0" is-string "^1.0.7" +arraybuffer.prototype.slice@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz#9b5ea3868a6eebc30273da577eb888381c0044bb" + integrity sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.2" + define-properties "^1.2.0" + get-intrinsic "^1.2.1" + is-array-buffer "^3.0.2" + is-shared-array-buffer "^1.0.2" + arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -3661,9 +3565,9 @@ camelcase@^6.0.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001503: - version "1.0.30001515" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001515.tgz#418aefeed9d024cd3129bfae0ccc782d4cb8f12b" - integrity sha512-eEFDwUOZbE24sb+Ecsx3+OvNETqjWIdabMy52oOkIgcUtAsQifjUG9q4U9dgTHJM2mfk4uEPxc0+xuFdJ629QA== + version "1.0.30001517" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz#90fabae294215c3495807eb24fc809e11dc2f0a8" + integrity sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA== capture-exit@^2.0.0: version "2.0.0" @@ -4438,9 +4342,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" electron-to-chromium@^1.4.431: - version "1.4.460" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.460.tgz#f360a5059c039c4a5fb4dfa99680ad8129dd9f84" - integrity sha512-kKiHnbrHME7z8E6AYaw0ehyxY5+hdaRmeUbjBO22LZMdqTYCO29EvF0T1cQ3pJ1RN5fyMcHl1Lmcsdt9WWJpJQ== + 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== elliptic@6.5.4: version "6.5.4" @@ -4485,11 +4389,12 @@ end-of-stream@^1.1.0: once "^1.4.0" enquirer@^2.3.5: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== + version "2.4.0" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.0.tgz#4f36f6c644137cc4fd2891da407ede2b1fea904a" + integrity sha512-ehu97t6FTYK2I3ZYtnp0BZ9vt0mvEL/cnHBds7Ct6jo9VX1VIkiFhOvVRWh6eblQqd7KOoICIQV+syZ3neXO/Q== dependencies: ansi-colors "^4.1.1" + strip-ansi "^6.0.1" env-paths@^2.2.0: version "2.2.1" @@ -4514,11 +4419,12 @@ error-ex@^1.2.0, error-ex@^1.3.1: is-arrayish "^0.2.1" es-abstract@^1.19.0, es-abstract@^1.20.4, es-abstract@^1.21.2: - version "1.21.3" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.21.3.tgz#8aaa0ffc080e8a6fef6ace72631dc1ec5d47bf94" - integrity sha512-ZU4miiY1j3sGPFLJ34VJXEqhpmL+HGByCinGHv4HC+Fxl2fI2Z4yR6tl0mORnDr6PA8eihWo4LmSWDbvhALckg== + version "1.22.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.1.tgz#8b4e5fc5cefd7f1660f0f8e1a52900dfbc9d9ccc" + integrity sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw== dependencies: array-buffer-byte-length "^1.0.0" + arraybuffer.prototype.slice "^1.0.1" available-typed-arrays "^1.0.5" call-bind "^1.0.2" es-set-tostringtag "^2.0.1" @@ -4545,10 +4451,13 @@ es-abstract@^1.19.0, es-abstract@^1.20.4, es-abstract@^1.21.2: object-keys "^1.1.1" object.assign "^4.1.4" regexp.prototype.flags "^1.5.0" + safe-array-concat "^1.0.0" safe-regex-test "^1.0.0" string.prototype.trim "^1.2.7" string.prototype.trimend "^1.0.6" string.prototype.trimstart "^1.0.6" + typed-array-buffer "^1.0.0" + typed-array-byte-length "^1.0.0" typed-array-byte-offset "^1.0.0" typed-array-length "^1.0.4" unbox-primitive "^1.0.2" @@ -5034,9 +4943,9 @@ fast-diff@^1.1.2: integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== fast-glob@^3.2.5, fast-glob@^3.2.9: - version "3.3.0" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.0.tgz#7c40cb491e1e2ed5664749e87bfb516dbe8727c0" - integrity sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA== + version "3.3.1" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" + integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" @@ -6158,15 +6067,11 @@ is-text-path@^1.0.1: text-extensions "^1.0.0" is-typed-array@^1.1.10, is-typed-array@^1.1.9: - version "1.1.10" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.10.tgz#36a5b5cb4189b575d1a3e4b08536bfb485801e3f" - integrity sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A== + version "1.1.12" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" + integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" - for-each "^0.3.3" - gopd "^1.0.1" - has-tostringtag "^1.0.0" + which-typed-array "^1.1.11" is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" @@ -6263,12 +6168,12 @@ istanbul-lib-instrument@^5.0.4: semver "^6.3.0" istanbul-lib-report@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" - integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== + version "3.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" + integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== dependencies: istanbul-lib-coverage "^3.0.0" - make-dir "^3.0.0" + make-dir "^4.0.0" supports-color "^7.1.0" istanbul-lib-source-maps@^4.0.0: @@ -6281,9 +6186,9 @@ istanbul-lib-source-maps@^4.0.0: source-map "^0.6.1" istanbul-reports@^3.0.2: - version "3.1.5" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.5.tgz#cc9a6ab25cb25659810e4785ed9d9fb742578bae" - integrity sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w== + version "3.1.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.6.tgz#2544bcab4768154281a2f0870471902704ccaa1a" + integrity sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" @@ -7103,6 +7008,13 @@ make-dir@^3.0.0: dependencies: semver "^6.0.0" +make-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" + integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== + dependencies: + semver "^7.5.3" + make-error@1.x, make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" @@ -8867,13 +8779,6 @@ scrypt-js@3.0.1: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -semver@7.3.8: - version "7.3.8" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" - integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== - dependencies: - lru-cache "^6.0.0" - semver@7.4.0: version "7.4.0" resolved "https://registry.yarnpkg.com/semver/-/semver-7.4.0.tgz#8481c92feffc531ab1e012a8ffc15bdd3a0f4318" @@ -8895,7 +8800,7 @@ semver@7.5.3: dependencies: lru-cache "^6.0.0" -semver@7.x, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: +semver@7.x, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.5.3: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== @@ -9662,9 +9567,9 @@ tslib@^1.8.1, tslib@^1.9.0: integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== tslib@^2.1.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.0.tgz#b295854684dbda164e181d259a22cd779dcd7bc3" - integrity sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA== + version "2.6.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410" + integrity sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig== tsutils@^3.17.1: version "3.21.0" @@ -9732,6 +9637,25 @@ type@^2.7.2: resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== +typed-array-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz#18de3e7ed7974b0a729d3feecb94338d1472cd60" + integrity sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + is-typed-array "^1.1.10" + +typed-array-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz#d787a24a995711611fb2b87a4052799517b230d0" + integrity sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + typed-array-byte-offset@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz#cbbe89b51fdef9cd6aaf07ad4707340abbc4ea0b" @@ -10091,17 +10015,16 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409" integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ== -which-typed-array@^1.1.10: - version "1.1.10" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.10.tgz#74baa2789991905c2076abb317103b866c64e69e" - integrity sha512-uxoA5vLUfRPdjCuJ1h5LlYdmTLbYfums398v3WLkM+i/Wltl2/XyZpQWKbN++ck5L64SR/grOHqtXCUKmlZPNA== +which-typed-array@^1.1.10, which-typed-array@^1.1.11: + version "1.1.11" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.11.tgz#99d691f23c72aab6768680805a271b69761ed61a" + integrity sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew== dependencies: available-typed-arrays "^1.0.5" call-bind "^1.0.2" for-each "^0.3.3" gopd "^1.0.1" has-tostringtag "^1.0.0" - is-typed-array "^1.1.10" which@^1.2.9, which@^1.3.1: version "1.3.1" From bd98bbd7a02df787de93a2633153508c86b26f2e Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Wed, 26 Jul 2023 22:12:03 +0200 Subject: [PATCH 10/19] chore: remove ethereum-provider --- packages/cli/package.json | 2 +- .../ens-recursive-name-register/index.ts | 8 +-- .../lib/defaults/deploy-modules/ens/index.ts | 8 +-- .../cli/src/lib/test-env/client-config.ts | 6 +- scripts/patch-peer-deps.ts | 3 +- yarn.lock | 64 ------------------- 6 files changed, 13 insertions(+), 78 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 6c3fc17377..1015854d74 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -47,7 +47,7 @@ "@polywrap/client-config-builder-js": "0.12.0", "@polywrap/client-js": "0.12.0", "@polywrap/core-js": "0.12.0", - "@polywrap/ethereum-provider-js": "0.3.1", + "@polywrap/ethereum-wallet-js": "~0.1.0", "@polywrap/logging-js": "0.11.0-pre.4", "@polywrap/os-js": "0.11.0-pre.4", "@polywrap/polywrap-manifest-types-js": "0.11.0-pre.4", 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 index 666bf4088f..5fe609c689 100644 --- 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 @@ -14,8 +14,8 @@ import * as Web3 from "@polywrap/web3-config-bundle-js"; import { Connection, Connections, - ethereumProviderPlugin, -} from "@polywrap/ethereum-provider-js"; + ethereumWalletPlugin, +} from "@polywrap/ethereum-wallet-js"; class ENSRecursiveNameRegisterPublisher implements DeployModule { async execute( @@ -68,8 +68,8 @@ class ENSRecursiveNameRegisterPublisher implements DeployModule { const clientConfig = new PolywrapClientConfigBuilder() .addDefaults() .setPackage( - Web3.bundle.ethereumProviderV2.uri, - ethereumProviderPlugin({ + Web3.bundle.ethereumWallet.uri, + ethereumWalletPlugin({ connections: connections, }) as IWrapPackage ) diff --git a/packages/cli/src/lib/defaults/deploy-modules/ens/index.ts b/packages/cli/src/lib/defaults/deploy-modules/ens/index.ts index 9090b31cbf..1e8cc7416c 100644 --- a/packages/cli/src/lib/defaults/deploy-modules/ens/index.ts +++ b/packages/cli/src/lib/defaults/deploy-modules/ens/index.ts @@ -14,8 +14,8 @@ import * as Web3 from "@polywrap/web3-config-bundle-js"; import { Connection, Connections, - ethereumProviderPlugin, -} from "@polywrap/ethereum-provider-js"; + ethereumWalletPlugin, +} from "@polywrap/ethereum-wallet-js"; const contentHash = require("content-hash"); @@ -65,8 +65,8 @@ class ENSPublisher implements DeployModule { const clientConfig = new PolywrapClientConfigBuilder() .addDefaults() .setPackage( - Web3.bundle.ethereumProviderV2.uri, - ethereumProviderPlugin({ + Web3.bundle.ethereumWallet.uri, + ethereumWalletPlugin({ connections: connections, }) as IWrapPackage ) diff --git a/packages/cli/src/lib/test-env/client-config.ts b/packages/cli/src/lib/test-env/client-config.ts index 47ea1ad141..a6fe391beb 100644 --- a/packages/cli/src/lib/test-env/client-config.ts +++ b/packages/cli/src/lib/test-env/client-config.ts @@ -9,10 +9,10 @@ import * as Web3 from "@polywrap/web3-config-bundle-js"; import * as Sys from "@polywrap/sys-config-bundle-js"; import { ExtendableUriResolver } from "@polywrap/uri-resolver-extensions-js"; import { - ethereumProviderPlugin, + ethereumWalletPlugin, Connections, Connection, -} from "@polywrap/ethereum-provider-js"; +} from "@polywrap/ethereum-wallet-js"; import { IWrapPackage } from "@polywrap/core-js"; export function getTestEnvClientConfig(): Partial { @@ -44,7 +44,7 @@ export function getTestEnvClientConfig(): Partial { "ens/wraps.eth:ens-uri-resolver-ext@1.0.1", }) .setPackages({ - [Web3.bundle.ethereumProviderV2.uri]: ethereumProviderPlugin({ + [Web3.bundle.ethereumWallet.uri]: ethereumWalletPlugin({ connections: new Connections({ networks: { testnet: new Connection({ diff --git a/scripts/patch-peer-deps.ts b/scripts/patch-peer-deps.ts index 7e8538c8b1..b9d386e7bf 100644 --- a/scripts/patch-peer-deps.ts +++ b/scripts/patch-peer-deps.ts @@ -3,8 +3,7 @@ import path from "path"; const packagesToPatch = [ "@polywrap/concurrent-plugin-js", - "@polywrap/ethereum-provider-js-v1", - "@polywrap/ethereum-provider-js", + "@polywrap/ethereum-wallet-js", "@polywrap/file-system-plugin-js", "@polywrap/http-plugin-js", "@polywrap/logger-plugin-js", diff --git a/yarn.lock b/yarn.lock index e0e6b4ae73..7031e9235a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2203,15 +2203,6 @@ "@polywrap/tracing-js" "0.12.0" "@polywrap/wrap-manifest-types-js" "0.12.0" -"@polywrap/core-js@0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@polywrap/core-js/-/core-js-0.10.0.tgz#5ddc31ff47019342659a2208eec05299b072b216" - integrity sha512-fx9LqRFnxAxLOhDK4M+ymrxMnXQbwuNPMLjCk5Ve5CPa9RFms0/Fzvj5ayMLidZSPSt/dLISkbDgW44vfv6wwA== - dependencies: - "@polywrap/result" "0.10.0" - "@polywrap/tracing-js" "0.10.0" - "@polywrap/wrap-manifest-types-js" "0.10.0" - "@polywrap/core-js@0.12.0", "@polywrap/core-js@~0.12.0", "@polywrap/core-js@~0.12.0-pre.0": version "0.12.0" resolved "https://registry.yarnpkg.com/@polywrap/core-js/-/core-js-0.12.0.tgz#ec68d6d6489df55bfa7a6bc0d5910a5ff9eb157a" @@ -2229,17 +2220,6 @@ "@polywrap/core-js" "~0.12.0-pre.0" "@polywrap/plugin-js" "~0.12.0-pre.0" -"@polywrap/ethereum-provider-js@0.3.1": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@polywrap/ethereum-provider-js/-/ethereum-provider-js-0.3.1.tgz#ffdb9425c819ee76d3e3d5ade7d1b044077037e0" - integrity sha512-El2d3gE2CFdGNzKQhO+IPP79lhyQmkAGlpQadaW/EDyFDjERLckYDLPrwUCXG0agUcQZcNY1nHn2hknumw/yWg== - dependencies: - "@ethersproject/address" "5.7.0" - "@ethersproject/providers" "5.7.0" - "@polywrap/core-js" "0.10.0" - "@polywrap/plugin-js" "0.10.0" - ethers "5.7.0" - "@polywrap/ethereum-wallet-js@~0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@polywrap/ethereum-wallet-js/-/ethereum-wallet-js-0.1.0.tgz#1af5800aab3c4cedfcd1e4e5e305d5d5ef733bea" @@ -2291,17 +2271,6 @@ dependencies: "@msgpack/msgpack" "2.7.2" -"@polywrap/plugin-js@0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@polywrap/plugin-js/-/plugin-js-0.10.0.tgz#e3bc81bf7832df9c84a4a319515228b159a05ba5" - integrity sha512-f0bjAKnveSu7u68NzWznYLWlzWo4MT8D6fudAF/wlV6S6R1euNJtIb8CTpAzfs6N173f81fzM/4OLS0pSYWdgQ== - dependencies: - "@polywrap/core-js" "0.10.0" - "@polywrap/msgpack-js" "0.10.0" - "@polywrap/result" "0.10.0" - "@polywrap/tracing-js" "0.10.0" - "@polywrap/wrap-manifest-types-js" "0.10.0" - "@polywrap/plugin-js@0.12.0", "@polywrap/plugin-js@~0.12.0", "@polywrap/plugin-js@~0.12.0-pre.0": version "0.12.0" resolved "https://registry.yarnpkg.com/@polywrap/plugin-js/-/plugin-js-0.12.0.tgz#90482acaaec4547aaaea6f9acc3d18adf69751ac" @@ -2313,11 +2282,6 @@ "@polywrap/tracing-js" "0.12.0" "@polywrap/wrap-manifest-types-js" "0.12.0" -"@polywrap/result@0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@polywrap/result/-/result-0.10.0.tgz#712339223fba524dfabfb0bf868411f357d52e34" - integrity sha512-IxTBfGP89/OPNlUPMkjOrdYt/hwyvgI7TsYap6S35MHo4pXkR9mskzrHJ/AGE5DyGqP81CIIJNSYfooF97KY3A== - "@polywrap/result@0.12.0": version "0.12.0" resolved "https://registry.yarnpkg.com/@polywrap/result/-/result-0.12.0.tgz#8cd72fa989098848b56316dfd7ed428831c5b540" @@ -2337,18 +2301,6 @@ "@polywrap/uri-resolver-extensions-js" "0.12.0" base64-to-uint8array "1.0.0" -"@polywrap/tracing-js@0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@polywrap/tracing-js/-/tracing-js-0.10.0.tgz#31d7ca9cc73a1dbd877fc684000652aa2c22acdc" - integrity sha512-077oN9VfbCNsYMRjX9NA6D1vFV+Y3TH92LjZATKQ2W2fRx/IGRARamAjhNfR4qRKstrOCd9D4E2DmaqFax3QIg== - dependencies: - "@fetsorn/opentelemetry-console-exporter" "0.0.3" - "@opentelemetry/api" "1.2.0" - "@opentelemetry/exporter-trace-otlp-http" "0.32.0" - "@opentelemetry/resources" "1.6.0" - "@opentelemetry/sdk-trace-base" "1.6.0" - "@opentelemetry/sdk-trace-web" "1.6.0" - "@polywrap/tracing-js@0.12.0": version "0.12.0" resolved "https://registry.yarnpkg.com/@polywrap/tracing-js/-/tracing-js-0.12.0.tgz#750238d92f6f29a4e8fc7e1b08cb27c7150c3279" @@ -2405,15 +2357,6 @@ "@polywrap/wasm-js" "0.12.0" base64-to-uint8array "1.0.0" -"@polywrap/wrap-manifest-types-js@0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@polywrap/wrap-manifest-types-js/-/wrap-manifest-types-js-0.10.0.tgz#f009a69d1591ee770dd13d67989d88f51e345d36" - integrity sha512-T3G/7NvNTuS1XyguRggTF4k7/h7yZCOcCbbUOTVoyVNfiNUY31hlrNZaFL4iriNqQ9sBDl9x6oRdOuFB7L9mlw== - dependencies: - "@apidevtools/json-schema-ref-parser" "9.0.9" - jsonschema "1.4.0" - semver "7.4.0" - "@polywrap/wrap-manifest-types-js@0.12.0": version "0.12.0" resolved "https://registry.yarnpkg.com/@polywrap/wrap-manifest-types-js/-/wrap-manifest-types-js-0.12.0.tgz#5ca209cdcad2f35e2064aa6b8174c2fbbc9fbcbc" @@ -8779,13 +8722,6 @@ scrypt-js@3.0.1: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -semver@7.4.0: - version "7.4.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.4.0.tgz#8481c92feffc531ab1e012a8ffc15bdd3a0f4318" - integrity sha512-RgOxM8Mw+7Zus0+zcLEUn8+JfoLpj/huFTItQy2hsM4khuC1HYRDp0cU482Ewn/Fcy6bCjufD8vAj7voC66KQw== - dependencies: - lru-cache "^6.0.0" - semver@7.5.0: version "7.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.0.tgz#ed8c5dc8efb6c629c88b23d41dc9bf40c1d96cd0" From 9540953737eb1d971f8c8b1ce8f3baf45b65a1df Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Wed, 26 Jul 2023 22:52:20 +0200 Subject: [PATCH 11/19] chore: fix ens deploy test --- package.json | 1 + .../deploy-modules/ens-recursive-name-register/index.ts | 4 ++-- packages/cli/src/lib/defaults/deploy-modules/ens/index.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e2bca69c73..05017b5635 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "test:core": "lerna run test --no-private --ignore polywrap* --concurrency 1", "test:cli": "yarn test:cli:unit && yarn test:cli:e2e", "test:cli:unit": "lerna run test:unit --no-private --scope polywrap --concurrency 1", + "test:cli:e2e": "yarn test:cli:e2e:p1 && yarn test:cli:e2e:p2", "test:cli:e2e:p1": "lerna run test:e2e:p1 --no-private --scope polywrap --concurrency 1", "test:cli:e2e:p2": "lerna run test:e2e:p2 --no-private --scope polywrap --concurrency 1", "version:apply": "lerna version $(cat VERSION) --exact --no-git-tag-version --yes", 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 index 5fe609c689..41c451aa24 100644 --- 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 @@ -83,7 +83,7 @@ class ENSRecursiveNameRegisterPublisher implements DeployModule { const signerAddress = await client.invoke({ method: "getSignerAddress", - uri: "ens/ethers.wraps.eth:0.1.0", + uri: "wrapscan.io/polywrap/ethers@1.0", args: { connection: { networkNameOrChainId: network, @@ -126,7 +126,7 @@ class ENSRecursiveNameRegisterPublisher implements DeployModule { client, { method: "awaitTransaction", - uri: Uri.from("ens/ethers.wraps.eth:0.1.0"), + uri: Uri.from("wrapscan.io/polywrap/ethers@1.0"), args: { txHash: registerData.value[0].tx.hash, connection: { diff --git a/packages/cli/src/lib/defaults/deploy-modules/ens/index.ts b/packages/cli/src/lib/defaults/deploy-modules/ens/index.ts index 1e8cc7416c..e7297d81a3 100644 --- a/packages/cli/src/lib/defaults/deploy-modules/ens/index.ts +++ b/packages/cli/src/lib/defaults/deploy-modules/ens/index.ts @@ -125,7 +125,7 @@ class ENSPublisher implements DeployModule { client, { method: "awaitTransaction", - uri: Uri.from("ens/ethers.wraps.eth:0.1.0"), + uri: Uri.from("wrapscan.io/polywrap/ethers@1.0"), args: { txHash: setContenthashData.value.hash, connection: { From a029f7d136ac42c839158537e90884ca8330c4b4 Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Thu, 27 Jul 2023 04:02:02 +0200 Subject: [PATCH 12/19] chore: update testing order --- .github/workflows/ci-javascript.yaml | 72 +++++++++++++++---- package.json | 12 ++-- .../cli/src/__tests__/e2e/p1/deploy.spec.ts | 13 ++-- 3 files changed, 75 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci-javascript.yaml b/.github/workflows/ci-javascript.yaml index 2fba40ed31..e7cd22da9a 100644 --- a/.github/workflows/ci-javascript.yaml +++ b/.github/workflows/ci-javascript.yaml @@ -83,9 +83,8 @@ jobs: CI-WRAP-Test-Harness: uses: ./.github/workflows/ci-wrap-test-harness.yaml - Test-Core: + Test-Templates: runs-on: ubuntu-latest - needs: CI-WRAP-Test-Harness timeout-minutes: 60 if: ${{ always() }} steps: @@ -139,18 +138,63 @@ jobs: - name: Build run: yarn build - - name: Get updated wrappers - if: ${{ needs.CI-WRAP-Test-Harness.outputs.rebuild_required == 'true' }} - uses: actions/download-artifact@v3 - id: get-wrappers + - name: Test + run: yarn test:templates + + Test-Core: + runs-on: ubuntu-latest + timeout-minutes: 60 + if: ${{ always() }} + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Read .nvmrc + run: echo ::set-output name=NVMRC::$(cat .nvmrc) + id: nvm + + - name: Setup Node.js + uses: actions/setup-node@master with: - name: rebuilt-wrappers - path: ./wrappers + node-version: '${{ steps.nvm.outputs.NVMRC }}' - - if: ${{ needs.CI-WRAP-Test-Harness.outputs.rebuild_required == 'true' }} - run: | - rm -rf packages/test-cases/cases/wrappers - mv wrappers packages/test-cases/cases + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Setup Poetry + uses: abatilo/actions-poetry@v2 + with: + poetry-version: '1.4.2' + + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: '^1.13.1' + + - name: Install cue lang + run: go install cuelang.org/go/cmd/cue@latest + + - name: Check if cue is installed + run: cue version + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install dependencies + run: yarn install --nonInteractive --frozen-lockfile --prefer-offline + + - name: Build + run: yarn build - name: Test run: yarn test:core @@ -224,3 +268,7 @@ jobs: - name: Test cli:e2e:p2 run: yarn test:e2e:p2 working-directory: ./packages/cli + + - name: Test CLI JS + run: yarn test + working-directory: ./packages/js/cli diff --git a/package.json b/package.json index 05017b5635..cba5f7b4a3 100644 --- a/package.json +++ b/package.json @@ -31,12 +31,14 @@ "lint:fix": "lerna run lint -- --fix", "lint:ci": "yarn lint", "test": "lerna run test --no-private --concurrency 1", - "test:core": "lerna run test --no-private --ignore polywrap* --concurrency 1", - "test:cli": "yarn test:cli:unit && yarn test:cli:e2e", - "test:cli:unit": "lerna run test:unit --no-private --scope polywrap --concurrency 1", + "test:core": "lerna run test --no-private --ignore polywrap* --ignore @polywrap/cli-js --ignore @polywrap/templates --concurrency 1", + "test:cli": "yarn test:cli:unit && yarn test:cli:e2e && yarn test:cli:js", + "test:cli:unit": "lerna run test:unit --scope polywrap --concurrency 1", "test:cli:e2e": "yarn test:cli:e2e:p1 && yarn test:cli:e2e:p2", - "test:cli:e2e:p1": "lerna run test:e2e:p1 --no-private --scope polywrap --concurrency 1", - "test:cli:e2e:p2": "lerna run test:e2e:p2 --no-private --scope polywrap --concurrency 1", + "test:cli:e2e:p1": "lerna run test:e2e:p1 --scope polywrap --concurrency 1", + "test:cli:e2e:p2": "lerna run test:e2e:p2 --scope polywrap --concurrency 1", + "test:cli:js": "lerna run test --scope @polywrap/cli-js --concurrency 1", + "test:templates": "lerna run test --no-private --scope @polywrap/templates --concurrency 1", "version:apply": "lerna version $(cat VERSION) --exact --no-git-tag-version --yes", "postversion:apply": "git add . && git commit -m \"build(release): migrate to `cat ./VERSION`\"", "publish:npm": "lerna exec --no-private --concurrency 1 -- yarn publish --access public --non-interactive --verbose", diff --git a/packages/cli/src/__tests__/e2e/p1/deploy.spec.ts b/packages/cli/src/__tests__/e2e/p1/deploy.spec.ts index cbce429c9b..468afdde43 100644 --- a/packages/cli/src/__tests__/e2e/p1/deploy.spec.ts +++ b/packages/cli/src/__tests__/e2e/p1/deploy.spec.ts @@ -77,8 +77,8 @@ describe("e2e tests for deploy command", () => { expect(clearStyle(output)).toEqual(HELP); }); - it("Should deploy the project successfully", async () => { - const { exitCode: code, stdout: output } = await Commands.deploy({}, { + it.skip("Should deploy the project successfully", async () => { + const { exitCode: code, stdout: output, stderr } = await Commands.deploy({}, { cwd: getTestCaseDir(0), cli: polywrapCli, env: process.env as Record @@ -86,6 +86,9 @@ describe("e2e tests for deploy command", () => { const sanitizedOutput = clearStyle(output); + console.log(output) + console.error(stderr); + expect(code).toEqual(0); expect(sanitizedOutput).toContain( "Successfully executed step 'ipfs_deploy'" @@ -107,7 +110,7 @@ describe("e2e tests for deploy command", () => { ); }); - it("Should output the deployment uri to URI.txt", async () => { + it.skip("Should output the deployment uri to URI.txt", async () => { const deploymentFilePath = path.join(getTestCaseDir(0), "URI.txt"); if (fs.existsSync(deploymentFilePath)) { fs.unlinkSync(deploymentFilePath); @@ -133,7 +136,7 @@ describe("e2e tests for deploy command", () => { ); }); - it("Should record successful deployments in the deployment log", async () => { + it.skip("Should record successful deployments in the deployment log", async () => { const deploymentFilePath = path.join(getTestCaseDir(0), "URI.txt"); const deployLogFilePath = path.join(getTestCaseDir(0), "/.polywrap/deploy/deploy.log"); @@ -159,7 +162,7 @@ describe("e2e tests for deploy command", () => { expect(lastLogEntry).toContain(deploymentUri); }); - it("Should output the results to a file if -o is passed", async () => { + it.skip("Should output the results to a file if -o is passed", async () => { const yamlRes = await Commands.deploy({ outputFile: "./output.yaml", }, { From 0fba350863204bd3be7ef4bad49956faaccf8569 Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Thu, 27 Jul 2023 04:20:06 +0200 Subject: [PATCH 13/19] chore: enable deploy tests --- packages/cli/src/__tests__/e2e/p1/deploy.spec.ts | 8 ++++---- .../unit/option-parsers/option-parsers.spec.ts | 10 +++++----- .../unit/option-parsers/samples/wrapper-envs.json | 12 +++++------- .../unit/option-parsers/samples/wrapper-envs.yaml | 10 +++++----- packages/cli/src/lib/test-env/client-config.ts | 9 +++++---- 5 files changed, 24 insertions(+), 25 deletions(-) diff --git a/packages/cli/src/__tests__/e2e/p1/deploy.spec.ts b/packages/cli/src/__tests__/e2e/p1/deploy.spec.ts index 468afdde43..cf656e185c 100644 --- a/packages/cli/src/__tests__/e2e/p1/deploy.spec.ts +++ b/packages/cli/src/__tests__/e2e/p1/deploy.spec.ts @@ -77,7 +77,7 @@ describe("e2e tests for deploy command", () => { expect(clearStyle(output)).toEqual(HELP); }); - it.skip("Should deploy the project successfully", async () => { + it("Should deploy the project successfully", async () => { const { exitCode: code, stdout: output, stderr } = await Commands.deploy({}, { cwd: getTestCaseDir(0), cli: polywrapCli, @@ -110,7 +110,7 @@ describe("e2e tests for deploy command", () => { ); }); - it.skip("Should output the deployment uri to URI.txt", async () => { + it("Should output the deployment uri to URI.txt", async () => { const deploymentFilePath = path.join(getTestCaseDir(0), "URI.txt"); if (fs.existsSync(deploymentFilePath)) { fs.unlinkSync(deploymentFilePath); @@ -136,7 +136,7 @@ describe("e2e tests for deploy command", () => { ); }); - it.skip("Should record successful deployments in the deployment log", async () => { + it("Should record successful deployments in the deployment log", async () => { const deploymentFilePath = path.join(getTestCaseDir(0), "URI.txt"); const deployLogFilePath = path.join(getTestCaseDir(0), "/.polywrap/deploy/deploy.log"); @@ -162,7 +162,7 @@ describe("e2e tests for deploy command", () => { expect(lastLogEntry).toContain(deploymentUri); }); - it.skip("Should output the results to a file if -o is passed", async () => { + it("Should output the results to a file if -o is passed", async () => { const yamlRes = await Commands.deploy({ outputFile: "./output.yaml", }, { diff --git a/packages/cli/src/__tests__/unit/option-parsers/option-parsers.spec.ts b/packages/cli/src/__tests__/unit/option-parsers/option-parsers.spec.ts index 6307f00310..eba9f4a74e 100644 --- a/packages/cli/src/__tests__/unit/option-parsers/option-parsers.spec.ts +++ b/packages/cli/src/__tests__/unit/option-parsers/option-parsers.spec.ts @@ -4,13 +4,13 @@ import { parseWrapperEnvsOption } from "../../../lib"; describe("unit tests for option-parsers", () => { describe("wrapper-envs", () => { const sampleFileEnvs = { - "wrap://ens/wraps.eth:ethereum@1.0.0": { - connection: { - networkNameOrChainId: "mainnet", - node: "https://mainnet.infura.io/v3/some_api_key", + "wrap://authority/wrap": { + prop: { + value: "bar", + value2: 2, }, }, - "wrap://ens/hello-world.polywrap.eth": { foo: "bar" }, + "wrap://authority/some-wrap": { foo: "bar" }, }; it("Should return undefined when undefined is provided for wrapperEnvsPath", async () => { diff --git a/packages/cli/src/__tests__/unit/option-parsers/samples/wrapper-envs.json b/packages/cli/src/__tests__/unit/option-parsers/samples/wrapper-envs.json index 9e7ae61386..63792dfc71 100644 --- a/packages/cli/src/__tests__/unit/option-parsers/samples/wrapper-envs.json +++ b/packages/cli/src/__tests__/unit/option-parsers/samples/wrapper-envs.json @@ -1,11 +1,9 @@ { - "ens/hello-world.polywrap.eth": { - "foo": "bar" - }, - "ens/wraps.eth:ethereum@1.0.0": { - "connection": { - "node": "https://mainnet.infura.io/v3/some_api_key", - "networkNameOrChainId": "mainnet" + "authority/some-wrap": { "foo": "bar" }, + "authority/wrap": { + "prop": { + "value": "bar", + "value2": 2 } } } diff --git a/packages/cli/src/__tests__/unit/option-parsers/samples/wrapper-envs.yaml b/packages/cli/src/__tests__/unit/option-parsers/samples/wrapper-envs.yaml index dcaa2a8649..2a6f6fa121 100644 --- a/packages/cli/src/__tests__/unit/option-parsers/samples/wrapper-envs.yaml +++ b/packages/cli/src/__tests__/unit/option-parsers/samples/wrapper-envs.yaml @@ -1,6 +1,6 @@ -ens/hello-world.polywrap.eth: +authority/some-wrap: foo: bar -ens/wraps.eth:ethereum@1.0.0: - connection: - node: https://mainnet.infura.io/v3/some_api_key - networkNameOrChainId: mainnet +authority/wrap: + prop: + value: bar + value2: 2 diff --git a/packages/cli/src/lib/test-env/client-config.ts b/packages/cli/src/lib/test-env/client-config.ts index a6fe391beb..a969c05e8c 100644 --- a/packages/cli/src/lib/test-env/client-config.ts +++ b/packages/cli/src/lib/test-env/client-config.ts @@ -27,6 +27,7 @@ export function getTestEnvClientConfig(): Partial { } const ensAddress = ETH_ENS_IPFS_MODULE_CONSTANTS.ensAddresses.ensAddress; + const testnetEnsResolverUri = "proxy/testnet-ens-contenthash-uri-resolver"; const builder = new PolywrapClientConfigBuilder() .addDefaults() @@ -35,13 +36,13 @@ export function getTestEnvClientConfig(): Partial { provider: ipfsProvider, retries: { tryResolveUri: 1, getFile: 1 }, }, - "proxy/testnet-ens-uri-resolver-ext": { + [testnetEnsResolverUri]: { registryAddress: ensAddress, }, }) .setRedirects({ - "proxy/testnet-ens-uri-resolver-ext": - "ens/wraps.eth:ens-uri-resolver-ext@1.0.1", + [testnetEnsResolverUri]: + Web3.bundle.ensContenthashResolver.uri }) .setPackages({ [Web3.bundle.ethereumWallet.uri]: ethereumWalletPlugin({ @@ -70,7 +71,7 @@ export function getTestEnvClientConfig(): Partial { builder.addInterfaceImplementations( ExtendableUriResolver.defaultExtInterfaceUris[0].uri, - ["proxy/testnet-ens-uri-resolver-ext", ...resolverExtensions] + [testnetEnsResolverUri, ...resolverExtensions] ); return builder.config; From 3fdaaf322c8c8e736adab3e6a9556a87432af025 Mon Sep 17 00:00:00 2001 From: Pileks Date: Thu, 27 Jul 2023 18:54:43 +0200 Subject: [PATCH 14/19] 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 15/19] 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 16/19] 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 From efe2af4dda29c46f8fbeaeeb4593da1b77e52fb1 Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Sat, 29 Jul 2023 22:03:05 +0200 Subject: [PATCH 17/19] chore: remove plugin-rs bind test case --- .../bind/sanity/output/plugin-rs/module.rs | 82 ----- .../bind/sanity/output/plugin-rs/types.rs | 305 ------------------ 2 files changed, 387 deletions(-) delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs delete mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs deleted file mode 100644 index fc34f4f43a..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs +++ /dev/null @@ -1,82 +0,0 @@ -/// NOTE: This is an auto-generated file. -/// All modifications will be overwritten. - -use std::sync::Arc; -use polywrap_core::invoker::Invoker; -use polywrap_plugin::{error::PluginError, module::PluginModule}; -use polywrap_msgpack_serde::{ - to_vec, - from_slice, - BigInt, - BigNumber, - JSON, - bytes, - wrappers::{ - polywrap_bigint as bigint, - polywrap_json as json - } -}; -use std::collections::BTreeMap; -use serde::{Serialize, Deserialize}; -use super::types::*; - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsModuleMethod { - pub str: String, - #[serde(rename = "optStr")] - pub opt_str: Option, - pub en: CustomEnum, - #[serde(rename = "optEnum")] - pub opt_enum: Option, - #[serde(rename = "enumArray")] - pub enum_array: Vec, - #[serde(rename = "optEnumArray")] - pub opt_enum_array: Option>>, - pub map: BTreeMap, - #[serde(rename = "mapOfArr")] - pub map_of_arr: BTreeMap>, - #[serde(rename = "mapOfMap")] - pub map_of_map: BTreeMap>, - #[serde(rename = "mapOfObj")] - pub map_of_obj: BTreeMap, - #[serde(rename = "mapOfArrOfObj")] - pub map_of_arr_of_obj: BTreeMap>, -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsObjectMethod { - pub object: AnotherType, - #[serde(rename = "optObject")] - pub opt_object: Option, - #[serde(rename = "objectArray")] - pub object_array: Vec, - #[serde(rename = "optObjectArray")] - pub opt_object_array: Option>>, -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsOptionalEnvMethod { - pub object: AnotherType, - #[serde(rename = "optObject")] - pub opt_object: Option, - #[serde(rename = "objectArray")] - pub object_array: Vec, - #[serde(rename = "optObjectArray")] - pub opt_object_array: Option>>, -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct ArgsIf { - #[serde(rename = "if")] - pub _if: Else, -} - -pub trait Module: PluginModule { - fn module_method(&mut self, args: &ArgsModuleMethod, invoker: Arc) -> Result; - - fn object_method(&mut self, args: &ArgsObjectMethod, invoker: Arc, env: Env) -> Result, PluginError>; - - fn optional_env_method(&mut self, args: &ArgsOptionalEnvMethod, invoker: Arc, env: Option) -> Result, PluginError>; - - fn _if(&mut self, args: &ArgsIf, invoker: Arc) -> Result; -} diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs deleted file mode 100644 index a673af6952..0000000000 --- a/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs +++ /dev/null @@ -1,305 +0,0 @@ -#![allow(unused_imports)] -#![allow(non_camel_case_types)] - -// NOTE: This is an auto-generated file. -// All modifications will be overwritten. -use polywrap_core::{invoker::Invoker, uri::Uri}; -use polywrap_plugin::error::PluginError; -use polywrap_msgpack_serde::{ - to_vec, - from_slice, - BigInt, - BigNumber, - JSON, - bytes, - wrappers::{ - polywrap_bigint as bigint, - polywrap_json as json - } -}; -use std::collections::BTreeMap; -use serde::{Serialize, Deserialize}; -use std::sync::Arc; - -// Env START // - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Env { - pub prop: String, - #[serde(rename = "optProp")] - pub opt_prop: Option, - #[serde(rename = "optMap")] - pub opt_map: Option>>, -} -// Env END // - -// Objects START // - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CustomType { - pub str: String, - #[serde(rename = "optStr")] - pub opt_str: Option, - pub u: u32, - #[serde(rename = "optU")] - pub opt_u: Option, - pub u8: u8, - pub u16: u16, - pub u32: u32, - pub i: i32, - pub i8: i8, - pub i16: i16, - pub i32: i32, - #[serde(with = "bigint")] - pub bigint: BigInt, - #[serde(with = "bigint")] - #[serde(rename = "optBigint")] - pub opt_bigint: Option, - pub bignumber: BigNumber, - #[serde(rename = "optBignumber")] - pub opt_bignumber: Option, - #[serde(with = "json")] - pub json: JSON::Value, - #[serde(with = "json")] - #[serde(rename = "optJson")] - pub opt_json: Option, - #[serde(with = "bytes")] - pub bytes: Vec, - #[serde(with = "bytes")] - #[serde(rename = "optBytes")] - pub opt_bytes: Option>, - pub boolean: bool, - #[serde(rename = "optBoolean")] - pub opt_boolean: Option, - pub u_array: Vec, - #[serde(rename = "uOpt_array")] - pub u_opt_array: Option>, - #[serde(rename = "_opt_uOptArray")] - pub _opt_u_opt_array: Option>>, - #[serde(rename = "optStrOptArray")] - pub opt_str_opt_array: Option>>, - #[serde(rename = "uArrayArray")] - pub u_array_array: Vec>, - #[serde(rename = "uOptArrayOptArray")] - pub u_opt_array_opt_array: Vec>>>, - #[serde(rename = "uArrayOptArrayArray")] - pub u_array_opt_array_array: Vec>>>, - #[serde(rename = "crazyArray")] - pub crazy_array: Option>>>>>>, - pub object: AnotherType, - #[serde(rename = "optObject")] - pub opt_object: Option, - #[serde(rename = "objectArray")] - pub object_array: Vec, - #[serde(rename = "optObjectArray")] - pub opt_object_array: Option>>, - pub en: CustomEnum, - #[serde(rename = "optEnum")] - pub opt_enum: Option, - #[serde(rename = "enumArray")] - pub enum_array: Vec, - #[serde(rename = "optEnumArray")] - pub opt_enum_array: Option>>, - pub map: BTreeMap, - #[serde(rename = "mapOfArr")] - pub map_of_arr: BTreeMap>, - #[serde(rename = "mapOfObj")] - pub map_of_obj: BTreeMap, - #[serde(rename = "mapOfArrOfObj")] - pub map_of_arr_of_obj: BTreeMap>, - #[serde(rename = "mapCustomValue")] - pub map_custom_value: BTreeMap>, -} -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct AnotherType { - pub prop: Option, - pub circular: Option, - #[serde(rename = "const")] - pub _const: Option, -} -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct CustomMapValue { - pub foo: String, -} -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Else { - #[serde(rename = "else")] - pub _else: String, -} -// Objects END // - -// Enums START // - -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] -pub enum CustomEnum { - STRING, - BYTES, - _MAX_ -} -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] -pub enum While { - _for, - _in, - _MAX_ -} -// Enums END // - -// Imported objects START // - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TestImportObject { - pub object: TestImportAnotherObject, - #[serde(rename = "optObject")] - pub opt_object: Option, - #[serde(rename = "objectArray")] - pub object_array: Vec, - #[serde(rename = "optObjectArray")] - pub opt_object_array: Option>>, - pub en: TestImportEnum, - #[serde(rename = "optEnum")] - pub opt_enum: Option, - #[serde(rename = "enumArray")] - pub enum_array: Vec, - #[serde(rename = "optEnumArray")] - pub opt_enum_array: Option>>, -} -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TestImportAnotherObject { - pub prop: String, -} -// Imported objects END // - -// Imported envs START // - -// Imported envs END // - -// Imported enums START // - -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] -pub enum TestImportEnum { - STRING, - BYTES, - _MAX_ -} -#[derive(Clone, Copy, Debug, Deserialize, Serialize)] -pub enum TestImportEnumReturn { - STRING, - BYTES, - _MAX_ -} -// Imported enums END // - -// Imported Modules START // - -// URI: "testimport.uri.eth" // -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TestImportModuleArgsImportedMethod { - pub str: String, - #[serde(rename = "optStr")] - pub opt_str: Option, - pub u: u32, - #[serde(rename = "optU")] - pub opt_u: Option, - #[serde(rename = "uArrayArray")] - pub u_array_array: Vec>>>, - pub object: TestImportObject, - #[serde(rename = "optObject")] - pub opt_object: Option, - #[serde(rename = "objectArray")] - pub object_array: Vec, - #[serde(rename = "optObjectArray")] - pub opt_object_array: Option>>, - pub en: TestImportEnum, - #[serde(rename = "optEnum")] - pub opt_enum: Option, - #[serde(rename = "enumArray")] - pub enum_array: Vec, - #[serde(rename = "optEnumArray")] - pub opt_enum_array: Option>>, -} - -// URI: "testimport.uri.eth" // -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TestImportModuleArgsAnotherMethod { - pub arg: Vec, -} - -// URI: "testimport.uri.eth" // -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TestImportModuleArgsReturnsArrayOfEnums { - pub arg: String, -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TestImportModule<'a> { - uri: &'a str -} - -impl<'a> TestImportModule<'a> { - pub const INTERFACE_URI: &'static str = "testimport.uri.eth"; - - pub fn new(uri: &'a str) -> TestImportModule<'a> { - TestImportModule { uri: uri } - } - - pub fn imported_method(&self, args: &TestImportModuleArgsImportedMethod) -> Result, PluginError> { - let uri = self.uri; - let serialized_args = to_vec(args.clone()).unwrap(); - let result = invoker.invoke_raw( - uri, - "importedMethod", - serialized_args, - None, - None - ) - .map_err(|e| PluginError::SubinvocationError { - uri: uri.to_string(), - method: "importedMethod".to_string(), - args: JSON::to_string(&args).unwrap(), - exception: e.to_string(), - })?; - - Ok(Some(from_slice(result.as_slice())?)) - } - - pub fn another_method(&self, args: &TestImportModuleArgsAnotherMethod) -> Result { - let uri = self.uri; - let serialized_args = to_vec(args.clone()).unwrap(); - let result = invoker.invoke_raw( - uri, - "anotherMethod", - serialized_args, - None, - None - ) - .map_err(|e| PluginError::SubinvocationError { - uri: uri.to_string(), - method: "anotherMethod".to_string(), - args: JSON::to_string(&args).unwrap(), - exception: e.to_string(), - })?; - - Ok(from_slice(result.as_slice())?) - } - - pub fn returns_array_of_enums(&self, args: &TestImportModuleArgsReturnsArrayOfEnums) -> Result>, PluginError> { - let uri = self.uri; - let serialized_args = to_vec(args.clone()).unwrap(); - let result = invoker.invoke_raw( - uri, - "returnsArrayOfEnums", - serialized_args, - None, - None - ) - .map_err(|e| PluginError::SubinvocationError { - uri: uri.to_string(), - method: "returnsArrayOfEnums".to_string(), - args: JSON::to_string(&args).unwrap(), - exception: e.to_string(), - })?; - - Ok(from_slice(result.as_slice())?) - } -} -// Imported Modules END // From 1d65a1363de53bd48a49a2057cff4cd6310fcdc6 Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Sat, 29 Jul 2023 22:18:11 +0200 Subject: [PATCH 18/19] chore: fix js cli test --- packages/js/cli/src/__tests__/commands.spec.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/js/cli/src/__tests__/commands.spec.ts b/packages/js/cli/src/__tests__/commands.spec.ts index 1d94776636..fbe5c0d2c0 100644 --- a/packages/js/cli/src/__tests__/commands.spec.ts +++ b/packages/js/cli/src/__tests__/commands.spec.ts @@ -148,17 +148,13 @@ const testData: CommandTestCaseData = { env: { PATH: process.env.PATH || "", 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, }, before: async () => { await Commands.infra("down", { modules: ["eth-ens-ipfs"]}); await Commands.infra("up", { modules: ["eth-ens-ipfs"]}); // Wait a little longer just in case - await new Promise((resolve) => setTimeout(resolve, 3000)); + await new Promise((resolve) => setTimeout(resolve, 15000)); }, after: async (_, stdout) => { expect(stdout).toContain( From d58ef1080844a8c6ab9da8c44c5963aeb689a9da Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Sat, 29 Jul 2023 22:31:25 +0200 Subject: [PATCH 19/19] chore: fix validation tests --- .../validation/src/__tests__/wrappers/missing-abi/wrap.info | 2 +- .../src/__tests__/wrappers/missing-abi/wrap.info.json | 1 + packages/js/validation/src/types/WasmPackageValidator.ts | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/js/validation/src/__tests__/wrappers/missing-abi/wrap.info b/packages/js/validation/src/__tests__/wrappers/missing-abi/wrap.info index eb1db54e61..b00b8bda6b 100644 --- a/packages/js/validation/src/__tests__/wrappers/missing-abi/wrap.info +++ b/packages/js/validation/src/__tests__/wrappers/missing-abi/wrap.info @@ -1 +1 @@ -‚¤name¤test§version„0.1.0 \ No newline at end of file +ƒ¤name¤test¤type¤wasm§version„0.1.0 \ No newline at end of file diff --git a/packages/js/validation/src/__tests__/wrappers/missing-abi/wrap.info.json b/packages/js/validation/src/__tests__/wrappers/missing-abi/wrap.info.json index d4a0e5fa0a..77ab3f4429 100644 --- a/packages/js/validation/src/__tests__/wrappers/missing-abi/wrap.info.json +++ b/packages/js/validation/src/__tests__/wrappers/missing-abi/wrap.info.json @@ -1,4 +1,5 @@ { "name": "test", + "type": "wasm", "version": "0.1.0" } diff --git a/packages/js/validation/src/types/WasmPackageValidator.ts b/packages/js/validation/src/types/WasmPackageValidator.ts index 97b5096503..2047e6a593 100644 --- a/packages/js/validation/src/types/WasmPackageValidator.ts +++ b/packages/js/validation/src/types/WasmPackageValidator.ts @@ -135,10 +135,10 @@ export class WasmPackageValidator { manifest: await deserializeWrapManifest(info), }; } catch (e) { - if (e.message.includes('instance requires property "abi"')) { + if (e.message.includes('"missingProperty": "abi"')) { return this._fail(ValidationFailReason.AbiNotFound); } else if ( - e.message.includes("instance.abi") && + e.message.includes("abi") && e.message.includes("Validation errors encountered") ) { return this._fail(ValidationFailReason.InvalidAbi);