mirror of
https://github.com/fluencelabs/aqua-playground
synced 2025-06-22 17:21:47 +00:00
add closures test
This commit is contained in:
33
aqua/examples/closures.aqua
Normal file
33
aqua/examples/closures.aqua
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
module Closure declares *
|
||||||
|
|
||||||
|
import "@fluencelabs/aqua-lib/builtin.aqua"
|
||||||
|
|
||||||
|
export LocalSrv, closureIn, closureOut
|
||||||
|
|
||||||
|
service MyOp("op"):
|
||||||
|
identity(s: string) -> string
|
||||||
|
|
||||||
|
service LocalSrv("local_srv"):
|
||||||
|
inside: -> ()
|
||||||
|
|
||||||
|
func closureIn(peer1: string) -> string:
|
||||||
|
variable = "const"
|
||||||
|
co on peer1:
|
||||||
|
p1Id <- MyOp.identity("co on")
|
||||||
|
closure = (s: string) -> string:
|
||||||
|
if s == "in":
|
||||||
|
LocalSrv.inside()
|
||||||
|
p2Id <- MyOp.identity(s)
|
||||||
|
<- p2Id
|
||||||
|
p <- closure("in")
|
||||||
|
<- p
|
||||||
|
|
||||||
|
func closureOut(peer2: string) -> Info:
|
||||||
|
closure = (s: string) -> Info:
|
||||||
|
if s == "in":
|
||||||
|
LocalSrv.inside()
|
||||||
|
p2Id <- Peer.identify()
|
||||||
|
<- p2Id
|
||||||
|
on peer2:
|
||||||
|
p2Id <- closure("on")
|
||||||
|
<- p2Id
|
@ -184,6 +184,12 @@ describe('Testing examples', () => {
|
|||||||
expect(nestedFuncsResult).toBe('some-str');
|
expect(nestedFuncsResult).toBe('some-str');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('closures.aqua', async () => {
|
||||||
|
let closuresResult = await closuresCall();
|
||||||
|
let res = ["/ip4/164.90.164.229/tcp/7001", "/ip4/164.90.164.229/tcp/9001/ws"]
|
||||||
|
expect(closuresResult).toStrictEqual(["in", res]);
|
||||||
|
});
|
||||||
|
|
||||||
it('assignment.aqua', async () => {
|
it('assignment.aqua', async () => {
|
||||||
let assignmentResult = await assignmentCall();
|
let assignmentResult = await assignmentCall();
|
||||||
expect(assignmentResult).toStrictEqual(['abc', 'hello']);
|
expect(assignmentResult).toStrictEqual(['abc', 'hello']);
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
@ -116,11 +116,8 @@ export function doStuff(...args: any) {
|
|||||||
)
|
)
|
||||||
(par
|
(par
|
||||||
(par
|
(par
|
||||||
(seq
|
|
||||||
(seq
|
(seq
|
||||||
(call %init_peer_id% ("some-id" "t") [str] $stream)
|
(call %init_peer_id% ("some-id" "t") [str] $stream)
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call b ("op" "noop") [])
|
(call b ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call %init_peer_id% ("println-service-id" "print") [a])
|
(call %init_peer_id% ("println-service-id" "print") [a])
|
||||||
@ -129,13 +126,10 @@ export function doStuff(...args: any) {
|
|||||||
(call -relay- ("op" "noop") [])
|
(call -relay- ("op" "noop") [])
|
||||||
(xor
|
(xor
|
||||||
(call a ("peer" "identify") [])
|
(call a ("peer" "identify") [])
|
||||||
(seq
|
|
||||||
(seq
|
(seq
|
||||||
(call -relay- ("op" "noop") [])
|
(call -relay- ("op" "noop") [])
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
@ -17,6 +17,7 @@ import {
|
|||||||
// Services
|
// Services
|
||||||
|
|
||||||
export interface SomeSDef {
|
export interface SomeSDef {
|
||||||
|
checkU32: (u: number | null, callParams: CallParams<'u'>) => void | Promise<void>;
|
||||||
getStr: (arg0: string | null, callParams: CallParams<'arg0'>) => string | null | Promise<string | null>;
|
getStr: (arg0: string | null, callParams: CallParams<'arg0'>) => string | null | Promise<string | null>;
|
||||||
getStr1: (callParams: CallParams<null>) => string | null | Promise<string | null>;
|
getStr1: (callParams: CallParams<null>) => string | null | Promise<string | null>;
|
||||||
getStr2: (arg0: string, callParams: CallParams<'arg0'>) => string | Promise<string>;
|
getStr2: (arg0: string, callParams: CallParams<'arg0'>) => string | Promise<string>;
|
||||||
@ -33,6 +34,20 @@ export function registerSomeS(...args: any) {
|
|||||||
{
|
{
|
||||||
"defaultServiceId" : "test2",
|
"defaultServiceId" : "test2",
|
||||||
"functions" : [
|
"functions" : [
|
||||||
|
{
|
||||||
|
"functionName" : "checkU32",
|
||||||
|
"argDefs" : [
|
||||||
|
{
|
||||||
|
"name" : "u",
|
||||||
|
"argType" : {
|
||||||
|
"tag" : "optional"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returnType" : {
|
||||||
|
"tag" : "void"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"functionName" : "getStr",
|
"functionName" : "getStr",
|
||||||
"argDefs" : [
|
"argDefs" : [
|
||||||
@ -77,6 +92,53 @@ export function registerSomeS(...args: any) {
|
|||||||
// Functions
|
// Functions
|
||||||
|
|
||||||
|
|
||||||
|
export function checkU32AndU8(a: number | null, config?: {ttl?: number}): Promise<void>;
|
||||||
|
export function checkU32AndU8(peer: FluencePeer, a: number | null, config?: {ttl?: number}): Promise<void>;
|
||||||
|
export function checkU32AndU8(...args: any) {
|
||||||
|
|
||||||
|
let script = `
|
||||||
|
(xor
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "a") [] a)
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("test2" "checkU32") [a])
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
)
|
||||||
|
`
|
||||||
|
return callFunction(
|
||||||
|
args,
|
||||||
|
{
|
||||||
|
"functionName" : "checkU32AndU8",
|
||||||
|
"returnType" : {
|
||||||
|
"tag" : "void"
|
||||||
|
},
|
||||||
|
"argDefs" : [
|
||||||
|
{
|
||||||
|
"name" : "a",
|
||||||
|
"argType" : {
|
||||||
|
"tag" : "optional"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"names" : {
|
||||||
|
"relay" : "-relay-",
|
||||||
|
"getDataSrv" : "getDataSrv",
|
||||||
|
"callbackSrv" : "callbackSrv",
|
||||||
|
"responseSrv" : "callbackSrv",
|
||||||
|
"responseFnName" : "response",
|
||||||
|
"errorHandlingSrv" : "errorHandlingSrv",
|
||||||
|
"errorFnName" : "error"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
script
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function useOptional(opt: string | null, config?: {ttl?: number}): Promise<string>;
|
export function useOptional(opt: string | null, config?: {ttl?: number}): Promise<string>;
|
||||||
export function useOptional(peer: FluencePeer, opt: string | null, config?: {ttl?: number}): Promise<string>;
|
export function useOptional(peer: FluencePeer, opt: string | null, config?: {ttl?: number}): Promise<string>;
|
||||||
export function useOptional(...args: any) {
|
export function useOptional(...args: any) {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
@ -145,9 +145,9 @@ export function returnNil(...args: any) {
|
|||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
(call %init_peer_id% ("op" "identity") [$valueNil] valueNil-0)
|
(call %init_peer_id% ("op" "identity") [$valueNil] push-to-stream-12)
|
||||||
)
|
)
|
||||||
(ap valueNil-0 $relayNil)
|
(ap push-to-stream-12 $relayNil)
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
(call %init_peer_id% ("callbackSrv" "response") [$relayNil])
|
(call %init_peer_id% ("callbackSrv" "response") [$relayNil])
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
@ -100,6 +100,8 @@ export function tryCatchTest(...args: any) {
|
|||||||
(call -relay- ("op" "noop") [])
|
(call -relay- ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
|
(seq
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
(xor
|
(xor
|
||||||
(call node_id ("unex" "getStr") [] $f)
|
(call node_id ("unex" "getStr") [] $f)
|
||||||
(seq
|
(seq
|
||||||
@ -110,6 +112,7 @@ export function tryCatchTest(...args: any) {
|
|||||||
(call node_id ("op" "identity") [i.$.external_addresses.[0]!] $f)
|
(call node_id ("op" "identity") [i.$.external_addresses.[0]!] $f)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
)
|
||||||
(seq
|
(seq
|
||||||
(call -relay- ("op" "noop") [])
|
(call -relay- ("op" "noop") [])
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
@ -100,10 +100,13 @@ export function tryOtherwiseTest(...args: any) {
|
|||||||
(call -relay- ("op" "noop") [])
|
(call -relay- ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
|
(seq
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
(xor
|
(xor
|
||||||
(call node_id ("unex" "getStr") [] $f)
|
(call node_id ("unex" "getStr") [] $f)
|
||||||
(call node_id ("op" "identity") ["error"] $f)
|
(call node_id ("op" "identity") ["error"] $f)
|
||||||
)
|
)
|
||||||
|
)
|
||||||
(seq
|
(seq
|
||||||
(call -relay- ("op" "noop") [])
|
(call -relay- ("op" "noop") [])
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.0-SNAPSHOT
|
* Aqua version: 0.4.1-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
import { Fluence } from '@fluencelabs/fluence';
|
import { Fluence } from '@fluencelabs/fluence';
|
||||||
// import { smth, registerLocalSrv } from '../compiled/examples/closures';
|
import { closureIn, closureOut, registerLocalSrv } from '../compiled/examples/closures';
|
||||||
import { relays } from '../config'
|
import { relays } from '../config'
|
||||||
|
|
||||||
export async function closuresCall() {
|
export async function closuresCall(): Promise<[string, string[]]> {
|
||||||
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
|
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
|
||||||
const selfPeerId = Fluence.getPeer().getStatus().peerId;
|
const selfPeerId = Fluence.getPeer().getStatus().peerId;
|
||||||
|
|
||||||
// registerLocalSrv({inside: () => console.log("call inside")})
|
registerLocalSrv({inside: () => console.log("call inside")})
|
||||||
|
|
||||||
// return smth(relays[2].peerId, relays[3].peerId)
|
const resIn = await closureIn(relays[4].peerId, {ttl: 15000})
|
||||||
|
const resOut = await closureOut(relays[5].peerId, {ttl: 15000})
|
||||||
|
|
||||||
|
return [resIn, resOut.external_addresses]
|
||||||
}
|
}
|
Reference in New Issue
Block a user