diff --git a/aqua/examples/if.aqua b/aqua/examples/if.aqua index bec053f..594810e 100644 --- a/aqua/examples/if.aqua +++ b/aqua/examples/if.aqua @@ -1,5 +1,8 @@ import "println.aqua" +service OpR("op"): + identity(s: string) -> string + func ifElseCall(condition: bool): if condition: Println.print("it is true") @@ -11,3 +14,13 @@ func ifElseNumCall(condition: u32): Println.print("it is 1") else: Println.print("it is not 1") + +func ifCorrectXorWrap(node: string) -> string: + service_id: *string + on node: + res <- OpR.identity("1234") + if res == "": + service_id <<- "0x" + else: + service_id <<- "1x" + <- service_id! diff --git a/package-lock.json b/package-lock.json index 816de44..7a09a43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "fldist": "dist/index.js" }, "devDependencies": { - "@fluencelabs/aqua": "0.6.0-261", + "@fluencelabs/aqua": "0.6.0-263", "@fluencelabs/aqua-dht": "0.2.4", "@fluencelabs/aqua-lib": "0.3.2", "@types/jest": "^27.0.2", @@ -697,9 +697,9 @@ "integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==" }, "node_modules/@fluencelabs/aqua": { - "version": "0.6.0-261", - "resolved": "https://registry.npmjs.org/@fluencelabs/aqua/-/aqua-0.6.0-261.tgz", - "integrity": "sha512-kRToC5f5xxMfQQkSlAGZMNFJpweDnuWqCLHVLXPgu4JKbpFZov0oc/QL+WqLOsunxUAJRMaC/dcpXc0Z+6yZ1A==", + "version": "0.6.0-263", + "resolved": "https://registry.npmjs.org/@fluencelabs/aqua/-/aqua-0.6.0-263.tgz", + "integrity": "sha512-E9ynPrkboKgyYEE6M+WDyroFJ0k0FTs1w9Gu/hOqFYnE63106VNZz/RrKtjK0o202MqhCpoOlSG0HsV3B5CzVA==", "dev": true, "dependencies": { "@fluencelabs/aqua-ipfs": "0.5.2", @@ -9462,9 +9462,9 @@ } }, "@fluencelabs/aqua": { - "version": "0.6.0-261", - "resolved": "https://registry.npmjs.org/@fluencelabs/aqua/-/aqua-0.6.0-261.tgz", - "integrity": "sha512-kRToC5f5xxMfQQkSlAGZMNFJpweDnuWqCLHVLXPgu4JKbpFZov0oc/QL+WqLOsunxUAJRMaC/dcpXc0Z+6yZ1A==", + "version": "0.6.0-263", + "resolved": "https://registry.npmjs.org/@fluencelabs/aqua/-/aqua-0.6.0-263.tgz", + "integrity": "sha512-E9ynPrkboKgyYEE6M+WDyroFJ0k0FTs1w9Gu/hOqFYnE63106VNZz/RrKtjK0o202MqhCpoOlSG0HsV3B5CzVA==", "dev": true, "requires": { "@fluencelabs/aqua-ipfs": "0.5.2", diff --git a/package.json b/package.json index c81ebe4..5d83d5d 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "aqua": "aqua" }, "devDependencies": { - "@fluencelabs/aqua": "0.6.0-261", + "@fluencelabs/aqua": "0.6.0-263", "@fluencelabs/aqua-dht": "0.2.4", "@fluencelabs/aqua-lib": "0.3.2", "@types/jest": "^27.0.2", diff --git a/src/__test__/examples.spec.ts b/src/__test__/examples.spec.ts index a8dee3a..6115f98 100644 --- a/src/__test__/examples.spec.ts +++ b/src/__test__/examples.spec.ts @@ -6,7 +6,7 @@ import { onCall } from '../examples/onCall'; import { funcCall } from '../examples/funcCall'; import { helloWorldCall } from '../examples/helloWorldCall'; import { foldCall } from '../examples/foldCall'; -import { ifCall } from '../examples/if'; +import {ifCall, ifWrapCall} from '../examples/if'; import { parCall } from '../examples/parCall'; import { complexCall } from '../examples/complex'; import { constantsCall } from '../examples/constantsCall'; @@ -87,6 +87,11 @@ describe('Testing examples', () => { await ifCall(); }); + it('if.aqua xor wrap', async () => { + let res = await ifWrapCall(peer2.getStatus().peerId); + expect(res).toBe('0x'); + }); + it(' par.aqua', async () => { let parCallResult = await parCall(); expect(parCallResult).toBe('hello'); diff --git a/src/compiled/dht/dht-example.ts b/src/compiled/dht/dht-example.ts index 9d43c7c..13350fe 100644 --- a/src/compiled/dht/dht-example.ts +++ b/src/compiled/dht/dht-example.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/aliases.ts b/src/compiled/examples/aliases.ts index b752e97..c5c4e18 100644 --- a/src/compiled/examples/aliases.ts +++ b/src/compiled/examples/aliases.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/assignment.ts b/src/compiled/examples/assignment.ts index f1e1790..2c01f91 100644 --- a/src/compiled/examples/assignment.ts +++ b/src/compiled/examples/assignment.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/callArrow.ts b/src/compiled/examples/callArrow.ts index 1d73572..2a1f77a 100644 --- a/src/compiled/examples/callArrow.ts +++ b/src/compiled/examples/callArrow.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/closures.ts b/src/compiled/examples/closures.ts index 7d19448..6d00742 100644 --- a/src/compiled/examples/closures.ts +++ b/src/compiled/examples/closures.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/co.ts b/src/compiled/examples/co.ts index c9b3dd3..02642c7 100644 --- a/src/compiled/examples/co.ts +++ b/src/compiled/examples/co.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/complex.ts b/src/compiled/examples/complex.ts index 9d5d8a7..2a96fa6 100644 --- a/src/compiled/examples/complex.ts +++ b/src/compiled/examples/complex.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/constants.ts b/src/compiled/examples/constants.ts index 207d372..6c09556 100644 --- a/src/compiled/examples/constants.ts +++ b/src/compiled/examples/constants.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/dataAlias.ts b/src/compiled/examples/dataAlias.ts index c804c38..82e23df 100644 --- a/src/compiled/examples/dataAlias.ts +++ b/src/compiled/examples/dataAlias.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/example.ts b/src/compiled/examples/example.ts index e7adbc5..5957608 100644 --- a/src/compiled/examples/example.ts +++ b/src/compiled/examples/example.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/fldist-sample.ts b/src/compiled/examples/fldist-sample.ts index 68833ce..5d29ef1 100644 --- a/src/compiled/examples/fldist-sample.ts +++ b/src/compiled/examples/fldist-sample.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/fold.ts b/src/compiled/examples/fold.ts index fc79e49..3378ee2 100644 --- a/src/compiled/examples/fold.ts +++ b/src/compiled/examples/fold.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/foldJoin.ts b/src/compiled/examples/foldJoin.ts index d2a14d4..ecdff90 100644 --- a/src/compiled/examples/foldJoin.ts +++ b/src/compiled/examples/foldJoin.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/func.ts b/src/compiled/examples/func.ts index 2a8631b..0b2a301 100644 --- a/src/compiled/examples/func.ts +++ b/src/compiled/examples/func.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/helloWorld.ts b/src/compiled/examples/helloWorld.ts index f8dd2f2..6dd5fd5 100644 --- a/src/compiled/examples/helloWorld.ts +++ b/src/compiled/examples/helloWorld.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/if.ts b/src/compiled/examples/if.ts index 207da94..91f3cc5 100644 --- a/src/compiled/examples/if.ts +++ b/src/compiled/examples/if.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; @@ -16,6 +16,40 @@ import { // Services +export interface OpRDef { + identity: (s: string, callParams: CallParams<'s'>) => string | Promise; +} +export function registerOpR(service: OpRDef): void; +export function registerOpR(serviceId: string, service: OpRDef): void; +export function registerOpR(peer: FluencePeer, service: OpRDef): void; +export function registerOpR(peer: FluencePeer, serviceId: string, service: OpRDef): void; + + +export function registerOpR(...args: any) { + registerService( + args, + { + "defaultServiceId" : "op", + "functions" : [ + { + "functionName" : "identity", + "argDefs" : [ + { + "name" : "s", + "argType" : { + "tag" : "primitive" + } + } + ], + "returnType" : { + "tag" : "primitive" + } + } + ] +} + ); +} + // Functions @@ -144,3 +178,99 @@ export function ifElseNumCall(...args: any) { script ) } + + + +export function ifCorrectXorWrap( + node: string, + config?: {ttl?: number} +): Promise; + +export function ifCorrectXorWrap( + peer: FluencePeer, + node: string, + config?: {ttl?: number} +): Promise; + +export function ifCorrectXorWrap(...args: any) { + + let script = ` + (xor + (seq + (seq + (seq + (call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-) + (call %init_peer_id% ("getDataSrv" "node") [] node) + ) + (new $service_id + (seq + (seq + (call -relay- ("op" "noop") []) + (xor + (seq + (call node ("op" "identity") ["1234"] res) + (xor + (match res "" + (xor + (seq + (ap "0x" $service_id) + (call -relay- ("op" "noop") []) + ) + (seq + (call -relay- ("op" "noop") []) + (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) + ) + ) + ) + (seq + (seq + (call -relay- ("op" "noop") []) + (ap "1x" $service_id) + ) + (call -relay- ("op" "noop") []) + ) + ) + ) + (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) + ) + ) + (call %init_peer_id% ("op" "identity") [$service_id.$.[0]!] service_id-fix) + ) + ) + ) + (xor + (call %init_peer_id% ("callbackSrv" "response") [service_id-fix]) + (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3]) + ) + ) + (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 4]) + ) + ` + return callFunction( + args, + { + "functionName" : "ifCorrectXorWrap", + "returnType" : { + "tag" : "primitive" + }, + "argDefs" : [ + { + "name" : "node", + "argType" : { + "tag" : "primitive" + } + } + ], + "names" : { + "relay" : "-relay-", + "getDataSrv" : "getDataSrv", + "callbackSrv" : "callbackSrv", + "responseSrv" : "callbackSrv", + "responseFnName" : "response", + "errorHandlingSrv" : "errorHandlingSrv", + "errorFnName" : "error" + } +}, + script + ) +} diff --git a/src/compiled/examples/imports_exports/declare.ts b/src/compiled/examples/imports_exports/declare.ts index d65e05e..dc271e7 100644 --- a/src/compiled/examples/imports_exports/declare.ts +++ b/src/compiled/examples/imports_exports/declare.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/imports_exports/exports.ts b/src/compiled/examples/imports_exports/exports.ts index 5d2637a..07e72ac 100644 --- a/src/compiled/examples/imports_exports/exports.ts +++ b/src/compiled/examples/imports_exports/exports.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/imports_exports/gen/OneMore.ts b/src/compiled/examples/imports_exports/gen/OneMore.ts index 25869ba..f2acd48 100644 --- a/src/compiled/examples/imports_exports/gen/OneMore.ts +++ b/src/compiled/examples/imports_exports/gen/OneMore.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/imports_exports/import2.ts b/src/compiled/examples/imports_exports/import2.ts index 7f12705..6ef739f 100644 --- a/src/compiled/examples/imports_exports/import2.ts +++ b/src/compiled/examples/imports_exports/import2.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/imports_exports/import3.ts b/src/compiled/examples/imports_exports/import3.ts index a331978..d96af39 100644 --- a/src/compiled/examples/imports_exports/import3.ts +++ b/src/compiled/examples/imports_exports/import3.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/imports_exports/imports.ts b/src/compiled/examples/imports_exports/imports.ts index 9496a4a..0d547a7 100644 --- a/src/compiled/examples/imports_exports/imports.ts +++ b/src/compiled/examples/imports_exports/imports.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/imports_exports/subImport.ts b/src/compiled/examples/imports_exports/subImport.ts index dc10a98..8297e27 100644 --- a/src/compiled/examples/imports_exports/subImport.ts +++ b/src/compiled/examples/imports_exports/subImport.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/join.ts b/src/compiled/examples/join.ts index 63a5448..c32d7bd 100644 --- a/src/compiled/examples/join.ts +++ b/src/compiled/examples/join.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/multiReturn.ts b/src/compiled/examples/multiReturn.ts index f444074..af80c5d 100644 --- a/src/compiled/examples/multiReturn.ts +++ b/src/compiled/examples/multiReturn.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/nestedFuncs.ts b/src/compiled/examples/nestedFuncs.ts index ad649a2..f449bd2 100644 --- a/src/compiled/examples/nestedFuncs.ts +++ b/src/compiled/examples/nestedFuncs.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/new-api-full.ts b/src/compiled/examples/new-api-full.ts index 8184406..6aca807 100644 --- a/src/compiled/examples/new-api-full.ts +++ b/src/compiled/examples/new-api-full.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/new-api.ts b/src/compiled/examples/new-api.ts index cf912a2..b680868 100644 --- a/src/compiled/examples/new-api.ts +++ b/src/compiled/examples/new-api.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/on.ts b/src/compiled/examples/on.ts index 01ff7e1..446c172 100644 --- a/src/compiled/examples/on.ts +++ b/src/compiled/examples/on.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/option.ts b/src/compiled/examples/option.ts index 29d4fac..1a12b87 100644 --- a/src/compiled/examples/option.ts +++ b/src/compiled/examples/option.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/options/option_gen.ts b/src/compiled/examples/options/option_gen.ts index 9053974..f2c9121 100644 --- a/src/compiled/examples/options/option_gen.ts +++ b/src/compiled/examples/options/option_gen.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/par.ts b/src/compiled/examples/par.ts index 187c545..9ba0602 100644 --- a/src/compiled/examples/par.ts +++ b/src/compiled/examples/par.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/passArgs.ts b/src/compiled/examples/passArgs.ts index 968b5a8..4842b6e 100644 --- a/src/compiled/examples/passArgs.ts +++ b/src/compiled/examples/passArgs.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/println.ts b/src/compiled/examples/println.ts index 6a8a79f..cffcf67 100644 --- a/src/compiled/examples/println.ts +++ b/src/compiled/examples/println.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/pushToStream.ts b/src/compiled/examples/pushToStream.ts index 57b8259..f741145 100644 --- a/src/compiled/examples/pushToStream.ts +++ b/src/compiled/examples/pushToStream.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/returnLiteral.ts b/src/compiled/examples/returnLiteral.ts index 3cc342c..eabf02d 100644 --- a/src/compiled/examples/returnLiteral.ts +++ b/src/compiled/examples/returnLiteral.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/stream.ts b/src/compiled/examples/stream.ts index 8d70f45..a3892f8 100644 --- a/src/compiled/examples/stream.ts +++ b/src/compiled/examples/stream.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/streamArgs.ts b/src/compiled/examples/streamArgs.ts index fabcc47..3b807bf 100644 --- a/src/compiled/examples/streamArgs.ts +++ b/src/compiled/examples/streamArgs.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/streamCallback.ts b/src/compiled/examples/streamCallback.ts index bd4f7d8..27576ff 100644 --- a/src/compiled/examples/streamCallback.ts +++ b/src/compiled/examples/streamCallback.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/streamCan.ts b/src/compiled/examples/streamCan.ts index f26ca29..bf7255d 100644 --- a/src/compiled/examples/streamCan.ts +++ b/src/compiled/examples/streamCan.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/streamRestriction.ts b/src/compiled/examples/streamRestriction.ts index 3c5ddaa..1ab3570 100644 --- a/src/compiled/examples/streamRestriction.ts +++ b/src/compiled/examples/streamRestriction.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/streamResults.ts b/src/compiled/examples/streamResults.ts index 4325d00..8e02997 100644 --- a/src/compiled/examples/streamResults.ts +++ b/src/compiled/examples/streamResults.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/subImportUsage.ts b/src/compiled/examples/subImportUsage.ts index 39271b8..116a632 100644 --- a/src/compiled/examples/subImportUsage.ts +++ b/src/compiled/examples/subImportUsage.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/topology.ts b/src/compiled/examples/topology.ts index ef1bb71..b7d3455 100644 --- a/src/compiled/examples/topology.ts +++ b/src/compiled/examples/topology.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/tryCatch.ts b/src/compiled/examples/tryCatch.ts index 1146678..129b1cb 100644 --- a/src/compiled/examples/tryCatch.ts +++ b/src/compiled/examples/tryCatch.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/tryOtherwise.ts b/src/compiled/examples/tryOtherwise.ts index dc08c66..47aadca 100644 --- a/src/compiled/examples/tryOtherwise.ts +++ b/src/compiled/examples/tryOtherwise.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/compiled/examples/via.ts b/src/compiled/examples/via.ts index 2872d80..0beecb2 100644 --- a/src/compiled/examples/via.ts +++ b/src/compiled/examples/via.ts @@ -3,7 +3,7 @@ * This file is auto-generated. Do not edit manually: changes may be erased. * Generated by Aqua compiler: https://github.com/fluencelabs/aqua/. * If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues - * Aqua version: 0.6.0-SNAPSHOT + * Aqua version: 0.6.0-263 * */ import { Fluence, FluencePeer } from '@fluencelabs/fluence'; diff --git a/src/examples/if.ts b/src/examples/if.ts index ad9a80c..ff309e5 100644 --- a/src/examples/if.ts +++ b/src/examples/if.ts @@ -1,5 +1,5 @@ import { FluencePeer } from '@fluencelabs/fluence'; -import { ifElseCall, ifElseNumCall } from '../compiled/examples/if'; +import {ifCorrectXorWrap, ifElseCall, ifElseNumCall} from '../compiled/examples/if'; export async function ifCall() { await ifElseCall(false); @@ -8,3 +8,7 @@ export async function ifCall() { await ifElseNumCall(1); await ifElseNumCall(5); } + +export async function ifWrapCall(node: string) { + return ifCorrectXorWrap(node) +}