add test for PR #394, update aqua

This commit is contained in:
DieMyst 2021-12-29 12:27:06 +03:00
parent 6fd62d80cf
commit 47787fe5f0
51 changed files with 3139 additions and 488 deletions

View File

@ -24,3 +24,18 @@ func topologyBug205(node_id: string, n2: ?string) -> []string:
on n:
Peer.identify()
<- nodes
service IOp("op"):
identity: string -> string
func topologyBug394(peer: string, peer2: string, peer3: string) -> string:
-- execute computation on a Peer in the network
on peer:
comp <- IOp.identity(%init_peer_id%)
-- send the result to target browser in the background
co on peer2 via peer3:
res <- IOp.identity(%init_peer_id%)
-- send the result to the initiator
<- comp

2490
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -28,9 +28,9 @@
"aqua": "aqua"
},
"devDependencies": {
"@fluencelabs/aqua": "0.5.0-245",
"@fluencelabs/aqua": "0.5.2-257",
"@fluencelabs/aqua-dht": "0.2.4",
"@fluencelabs/aqua-lib": "0.2.1",
"@fluencelabs/aqua-lib": "0.3.2",
"@types/jest": "^27.0.2",
"jest": "^27.2.4",
"ts-jest": "^27.0.5",

View File

@ -11,7 +11,7 @@ import { parCall } from '../examples/parCall';
import { complexCall } from '../examples/complex';
import { constantsCall } from '../examples/constantsCall';
import { returnNilCall, returnNoneCall, streamCall } from '../examples/streamCall';
import {topologyBug205Call, topologyCall} from '../examples/topologyCall';
import {topologyBug205Call, topologyBug394Call, topologyCall} from '../examples/topologyCall';
import { foldJoinCall } from '../examples/foldJoinCall';
import { registerHandlers, returnNull, returnOptionalCall, useOptionalCall } from '../examples/useOptionalCall';
import { viaCall } from '../examples/viaCall';
@ -165,6 +165,12 @@ describe('Testing examples', () => {
expect(topologyResult).toStrictEqual(res);
});
it('topology.aqua bug 394', async () => {
let topologyResult = await topologyBug394Call(peer2);
expect(topologyResult).toStrictEqual(selfPeerId);
});
it('foldJoin.aqua', async () => {
let foldJoinResult = await foldJoinCall();
expect(foldJoinResult.length).toBeGreaterThanOrEqual(3)

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
@ -46,18 +46,14 @@ export function put_value(...args: any) {
(call %init_peer_id% ("getDataSrv" "value") [] value)
)
(xor
(par
(seq
(seq
(call -relay- ("op" "string_to_b58") [initial_peer] k)
(call -relay- ("kad" "neighborhood") [k [] []] nodes)
)
(call %init_peer_id% ("op" "noop") [])
)
(par
(fold nodes n
(par
(seq
(call -relay- ("op" "noop") [])
(xor
(seq
(seq
@ -68,10 +64,11 @@ export function put_value(...args: any) {
)
(null)
)
)
(next n)
)
)
(null)
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
@ -148,6 +145,8 @@ export function registerKeyPutValue(...args: any) {
(seq
(seq
(seq
(seq
(seq
(seq
(seq
(seq
@ -162,20 +161,20 @@ export function registerKeyPutValue(...args: any) {
)
(call %init_peer_id% ("getDataSrv" "service_id") [] service_id)
)
(par
(seq
(seq
(call %init_peer_id% ("op" "string_to_b58") [key] k)
)
(call %init_peer_id% ("kad" "neighborhood") [k [] []] nodes)
)
(call %init_peer_id% ("op" "noop") [])
)
(par
(fold nodes n
(par
(seq
(call -relay- ("op" "noop") [])
(xor
(seq
(call n ("peer" "timestamp_sec") [] t)
(call -relay- ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
@ -185,6 +184,7 @@ export function registerKeyPutValue(...args: any) {
(next n)
)
)
(null)
)
)
(xor
@ -345,7 +345,6 @@ export function findSubscribers(...args: any) {
(call -relay- ("kad" "neighborhood") [k [] []] nodes)
)
(par
(seq
(fold nodes n
(par
(seq
@ -361,8 +360,6 @@ export function findSubscribers(...args: any) {
(next n)
)
)
(call -relay- ("op" "noop") [])
)
(null)
)
)
@ -447,18 +444,14 @@ export function initTopicAndSubscribe(...args: any) {
(call %init_peer_id% ("getDataSrv" "service_id") [] service_id)
)
(xor
(par
(seq
(seq
(call -relay- ("op" "string_to_b58") [topic] k)
(call -relay- ("kad" "neighborhood") [k [] []] nodes)
)
(call %init_peer_id% ("op" "noop") [])
)
(par
(fold nodes n
(par
(seq
(call -relay- ("op" "noop") [])
(xor
(seq
(seq
@ -469,10 +462,11 @@ export function initTopicAndSubscribe(...args: any) {
)
(null)
)
)
(next n)
)
)
(null)
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
@ -41,7 +41,6 @@ export function passFunctionAsArg(...args: any) {
(seq
(seq
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
@ -60,22 +59,26 @@ export function passFunctionAsArg(...args: any) {
(call -relay- ("op" "noop") [])
)
(xor
(seq
(call %init_peer_id% ("callbackSrv" "c") [str] init_call_res0)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(call -relay- ("op" "noop") [])
)
(seq
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
(call -relay- ("op" "noop") [])
)
)
)
(call node ("peer" "identify") [])
)
(call -relay- ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
)
)
(call -relay- ("op" "noop") [])
)
(call %init_peer_id% ("println-service-id" "print") [init_call_res0])
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
@ -74,7 +74,10 @@ export function closureIn(...args: any) {
(seq
(call -relay- ("op" "noop") [])
(xor
(seq
(call peer1 ("op" "identity") ["co on"] p1Id)
(call -relay- ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
@ -152,7 +155,6 @@ export function closureOut(...args: any) {
(xor
(seq
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
@ -161,6 +163,7 @@ export function closureOut(...args: any) {
(call -relay- ("op" "noop") [])
)
(xor
(seq
(seq
(xor
(match "on" "in"
@ -179,14 +182,14 @@ export function closureOut(...args: any) {
)
(call peer2 ("peer" "identify") [] p2Id)
)
(call -relay- ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
)
)
(call -relay- ("op" "noop") [])
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [p2Id])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
@ -248,7 +251,6 @@ export function closureBig(...args: any) {
(seq
(seq
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
@ -260,7 +262,10 @@ export function closureBig(...args: any) {
(seq
(call -relay- ("op" "noop") [])
(xor
(seq
(call peer1 ("op" "identity") ["co on"] p1Id)
(call -relay- ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
@ -294,10 +299,9 @@ export function closureBig(...args: any) {
(call -relay- ("op" "noop") [])
)
(xor
(seq
(new $p2Id
(seq
(seq
(call -relay- ("op" "noop") [])
(xor
(match "on" "in"
(xor
@ -319,18 +323,17 @@ export function closureBig(...args: any) {
(ap p2Info0.$.external_addresses.[0]! $p2Id)
)
)
)
(call peer2 ("op" "identity") [$p2Id.$.[0]!] p2Id-fix0)
)
)
(call -relay- ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 4])
)
)
)
(call -relay- ("op" "noop") [])
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [p2Id-fix p2Id-fix0])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 5])

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
@ -77,6 +77,7 @@ export function coFunc(...args: any) {
(call -relay- ("op" "noop") [])
)
(xor
(seq
(seq
(call node ("peer" "identify") [] t)
(par
@ -90,9 +91,14 @@ export function coFunc(...args: any) {
(null)
)
)
(call -relay- ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
)
)
(call %init_peer_id% ("coservice-id" "call") [] x)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
@ -132,16 +132,17 @@ export function doStuff(...args: any) {
(call %init_peer_id% ("getDataSrv" "str") [] str)
)
(new $stream
(seq
(seq
(seq
(seq
(seq
(par
(par
(seq
(seq
(call %init_peer_id% ("some-id" "t") [str] $stream)
(call b ("op" "noop") [])
(call -relay- ("op" "noop") [])
)
(call a ("op" "noop") [])
)
(call %init_peer_id% ("println-service-id" "print") [a])
)
@ -149,18 +150,18 @@ export function doStuff(...args: any) {
(call -relay- ("op" "noop") [])
(xor
(call a ("peer" "identify") [])
(seq
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
)
)
(call -relay- ("op" "noop") [])
)
)
)
)
(xor
(seq
(call -relay- ("op" "noop") [])
(xor
(match c true
(xor
@ -183,10 +184,13 @@ export function doStuff(...args: any) {
(next eEl)
)
)
(seq
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
(call -relay- ("op" "noop") [])
)
)
)
(null)
@ -194,6 +198,7 @@ export function doStuff(...args: any) {
)
(null)
)
(call -relay- ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
@ -201,8 +206,6 @@ export function doStuff(...args: any) {
)
)
)
(call -relay- ("op" "noop") [])
)
(call %init_peer_id% ("some-id" "multiline") [a b c] $stream)
)
(call %init_peer_id% ("op" "identity") [$stream] stream-fix)

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
@ -139,7 +139,6 @@ export function betterMessage(...args: any) {
(xor
(seq
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
@ -148,15 +147,16 @@ export function betterMessage(...args: any) {
(call -relay- ("op" "noop") [])
)
(xor
(seq
(call relay ("peer" "is_connected") [relay] isOnline)
(call -relay- ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
)
(call -relay- ("op" "noop") [])
)
(xor
(match isOnline true
(xor

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
@ -70,7 +70,6 @@ export function test(...args: any) {
(xor
(seq
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
@ -79,15 +78,16 @@ export function test(...args: any) {
(call -relay- ("op" "noop") [])
)
(xor
(seq
(call node ("peer" "identify") [] res)
(call -relay- ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
)
(call -relay- ("op" "noop") [])
)
(call %init_peer_id% ("returnService" "run") [res])
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
@ -75,18 +75,17 @@ export function getTwoResults(...args: any) {
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
)
(new $res
(seq
(seq
(seq
(call -relay- ("op" "noop") [])
(xor
(seq
(seq
(seq
(seq
(seq
(call relay ("kad" "neighborhood") [%init_peer_id% [] []] nodes)
(par
(seq
(fold nodes n
(par
(seq
@ -99,8 +98,6 @@ export function getTwoResults(...args: any) {
(next n)
)
)
(call relay ("op" "noop") [])
)
(null)
)
)
@ -110,14 +107,14 @@ export function getTwoResults(...args: any) {
)
(call relay ("op" "identity") [$res.$.[2]!])
)
(call -relay- ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
)
(call -relay- ("op" "noop") [])
)
(call %init_peer_id% ("op" "identity") [$res] res-fix)
)
)

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
@ -36,7 +36,6 @@ export function getPeerExternalAddresses(...args: any) {
(xor
(seq
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
@ -45,15 +44,16 @@ export function getPeerExternalAddresses(...args: any) {
(call -relay- ("op" "noop") [])
)
(xor
(seq
(call otherNodePeerId ("peer" "identify") [] res)
(call -relay- ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
)
(call -relay- ("op" "noop") [])
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [res.$.external_addresses!])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
@ -113,8 +113,6 @@ export function getDistantAddresses(...args: any) {
(seq
(seq
(seq
(seq
(seq
(seq
(seq
(seq
@ -128,8 +126,13 @@ export function getDistantAddresses(...args: any) {
(call viaNode ("op" "noop") [])
)
(xor
(call target ("peer" "identify") [] res)
(seq
(seq
(call target ("peer" "identify") [] res)
(call viaNode ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(seq
(seq
(call viaNode ("op" "noop") [])
@ -137,14 +140,8 @@ export function getDistantAddresses(...args: any) {
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
(call -relay- ("op" "noop") [])
)
)
)
(call viaNode ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [res.$.external_addresses!])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
@ -86,6 +86,42 @@ export function registerLocalPrint(...args: any) {
);
}
export interface IOpDef {
identity: (arg0: string, callParams: CallParams<'arg0'>) => string | Promise<string>;
}
export function registerIOp(service: IOpDef): void;
export function registerIOp(serviceId: string, service: IOpDef): void;
export function registerIOp(peer: FluencePeer, service: IOpDef): void;
export function registerIOp(peer: FluencePeer, serviceId: string, service: IOpDef): void;
export function registerIOp(...args: any) {
registerService(
args,
{
"defaultServiceId" : "op",
"functions" : [
{
"functionName" : "identity",
"argDefs" : [
{
"name" : "arg0",
"argType" : {
"tag" : "primitive"
}
}
],
"returnType" : {
"tag" : "primitive"
}
}
]
}
);
}
// Functions
@ -127,16 +163,19 @@ export function topologyTest(...args: any) {
(call %init_peer_id% ("getDataSrv" "friendRelay") [] friendRelay)
)
(par
(seq
(seq
(seq
(seq
(seq
(call -relay- ("op" "noop") [])
(call friendRelay ("op" "noop") [])
)
(xor
(seq
(seq
(call friend ("testo" "getString") ["friends string via"] str2)
(call friendRelay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(seq
(seq
(call friendRelay ("op" "noop") [])
@ -146,12 +185,6 @@ export function topologyTest(...args: any) {
)
)
)
(call friendRelay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(call %init_peer_id% ("op" "noop") [])
)
(call %init_peer_id% ("lp" "print") ["my string in par"])
)
)
@ -242,7 +275,6 @@ export function topologyBug205(...args: any) {
)
(new $nodes
(seq
(seq
(seq
(seq
(call -relay- ("op" "noop") [])
@ -251,18 +283,25 @@ export function topologyBug205(...args: any) {
(call node_id ("op" "identity") [n2] a)
(ap a.$.[0]! $nodes)
)
(seq
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
(call -relay- ("op" "noop") [])
)
)
)
(xor
(seq
(par
(fold $nodes n
(par
(xor
(seq
(call n ("peer" "identify") [])
(call -relay- ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
@ -273,14 +312,14 @@ export function topologyBug205(...args: any) {
)
(null)
)
(call -relay- ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
)
)
)
(call -relay- ("op" "noop") [])
)
(call %init_peer_id% ("op" "identity") [$nodes] nodes-fix)
)
)
@ -327,3 +366,126 @@ export function topologyBug205(...args: any) {
script
)
}
export function topologyBug394(
peer_: string,
peer2: string,
peer3: string,
config?: {ttl?: number}
): Promise<string>;
export function topologyBug394(
peer: FluencePeer,
peer_: string,
peer2: string,
peer3: string,
config?: {ttl?: number}
): Promise<string>;
export function topologyBug394(...args: any) {
let script = `
(xor
(seq
(seq
(seq
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(call %init_peer_id% ("getDataSrv" "peer") [] peer)
)
(call %init_peer_id% ("getDataSrv" "peer2") [] peer2)
)
(call %init_peer_id% ("getDataSrv" "peer3") [] peer3)
)
(call -relay- ("op" "noop") [])
)
(xor
(seq
(call peer ("op" "identity") [%init_peer_id%] comp)
(call -relay- ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
)
(par
(seq
(seq
(call -relay- ("op" "noop") [])
(call peer3 ("op" "noop") [])
)
(xor
(seq
(seq
(call peer2 ("op" "identity") [%init_peer_id%] res)
(call peer3 ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(seq
(seq
(call peer3 ("op" "noop") [])
(call -relay- ("op" "noop") [])
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
)
)
(null)
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [comp])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 4])
)
`
return callFunction(
args,
{
"functionName" : "topologyBug394",
"returnType" : {
"tag" : "primitive"
},
"argDefs" : [
{
"name" : "peer",
"argType" : {
"tag" : "primitive"
}
},
{
"name" : "peer2",
"argType" : {
"tag" : "primitive"
}
},
{
"name" : "peer3",
"argType" : {
"tag" : "primitive"
}
}
],
"names" : {
"relay" : "-relay-",
"getDataSrv" : "getDataSrv",
"callbackSrv" : "callbackSrv",
"responseSrv" : "callbackSrv",
"responseFnName" : "response",
"errorHandlingSrv" : "errorHandlingSrv",
"errorFnName" : "error"
}
},
script
)
}

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
@ -105,15 +105,16 @@ export function tryCatchTest(...args: any) {
(call %init_peer_id% ("getDataSrv" "node_id") [] node_id)
)
(new $f
(seq
(seq
(seq
(call -relay- ("op" "noop") [])
(xor
(seq
(call -relay- ("op" "noop") [])
(xor
(seq
(call node_id ("unex" "getStr") [] $f)
(call -relay- ("op" "noop") [])
)
(seq
(seq
(seq
(call node_id ("op" "identity") [%last_error%.$.msg!] $f)
@ -121,16 +122,12 @@ export function tryCatchTest(...args: any) {
)
(call node_id ("op" "identity") [i.$.external_addresses.[0]!] $f)
)
)
)
(seq
(call -relay- ("op" "noop") [])
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
)
(call -relay- ("op" "noop") [])
)
(call %init_peer_id% ("op" "identity") [$f] f-fix)
)
)

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
@ -105,26 +105,23 @@ export function tryOtherwiseTest(...args: any) {
(call %init_peer_id% ("getDataSrv" "node_id") [] node_id)
)
(new $f
(seq
(seq
(seq
(call -relay- ("op" "noop") [])
(xor
(seq
(call -relay- ("op" "noop") [])
(xor
(seq
(call node_id ("unex" "getStr") [] $f)
(call node_id ("op" "identity") ["error"] $f)
)
(call -relay- ("op" "noop") [])
)
(seq
(call node_id ("op" "identity") ["error"] $f)
(call -relay- ("op" "noop") [])
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
)
(call -relay- ("op" "noop") [])
)
(call %init_peer_id% ("op" "identity") [$f.$.[0]!] f-fix)
)
)

View File

@ -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.5.0-SNAPSHOT
* Aqua version: 0.5.2-257
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
@ -73,8 +73,6 @@ export function viaArr(...args: any) {
(seq
(seq
(seq
(seq
(seq
(seq
(seq
(seq
@ -93,8 +91,18 @@ export function viaArr(...args: any) {
)
)
(xor
(call node_id ("peer" "identify") [] p)
(seq
(seq
(call node_id ("peer" "identify") [] p)
(fold viaAr -via-peer-
(seq
(next -via-peer-)
(call -via-peer- ("op" "noop") [])
)
)
)
(call -relay- ("op" "noop") [])
)
(seq
(seq
(fold viaAr -via-peer-
@ -107,19 +115,8 @@ export function viaArr(...args: any) {
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
(call -relay- ("op" "noop") [])
)
)
)
(fold viaAr -via-peer-
(seq
(call -via-peer- ("op" "noop") [])
(next -via-peer-)
)
)
)
(call -relay- ("op" "noop") [])
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [p])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
@ -186,8 +183,6 @@ export function viaStream(...args: any) {
(seq
(seq
(seq
(seq
(seq
(seq
(seq
(seq
@ -213,8 +208,18 @@ export function viaStream(...args: any) {
)
)
(xor
(call node_id ("peer" "identify") [] p)
(seq
(seq
(call node_id ("peer" "identify") [] p)
(fold $viaStr -via-peer-
(seq
(next -via-peer-)
(call -via-peer- ("op" "noop") [])
)
)
)
(call -relay- ("op" "noop") [])
)
(seq
(seq
(fold $viaStr -via-peer-
@ -227,19 +232,8 @@ export function viaStream(...args: any) {
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
(call -relay- ("op" "noop") [])
)
)
)
(fold $viaStr -via-peer-
(seq
(call -via-peer- ("op" "noop") [])
(next -via-peer-)
)
)
)
(call -relay- ("op" "noop") [])
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [p])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
@ -308,8 +302,6 @@ export function viaOpt(...args: any) {
(seq
(seq
(seq
(seq
(seq
(seq
(seq
(seq
@ -330,8 +322,18 @@ export function viaOpt(...args: any) {
)
)
(xor
(call node_id ("peer" "identify") [] p)
(seq
(seq
(call node_id ("peer" "identify") [] p)
(fold viaOpt -via-peer-
(seq
(next -via-peer-)
(call -via-peer- ("op" "noop") [])
)
)
)
(call -relay- ("op" "noop") [])
)
(seq
(seq
(fold viaOpt -via-peer-
@ -344,19 +346,8 @@ export function viaOpt(...args: any) {
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
(call -relay- ("op" "noop") [])
)
)
)
(fold viaOpt -via-peer-
(seq
(call -via-peer- ("op" "noop") [])
(next -via-peer-)
)
)
)
(call -relay- ("op" "noop") [])
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [p])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])

View File

@ -1,5 +1,21 @@
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
import {topologyTest, registerTesto, registerLocalPrint, topologyBug205} from '../compiled/examples/topology';
import {
topologyTest,
registerTesto,
registerLocalPrint,
topologyBug205,
topologyBug394
} from '../compiled/examples/topology';
export async function topologyBug394Call(peer2: FluencePeer): Promise<string> {
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
const selfPeerId = Fluence.getPeer().getStatus().peerId;
const relayPeerId2 = peer2.getStatus().relayPeerId;
const selfPeerId2 = peer2.getStatus().peerId;
return topologyBug394(relayPeerId, selfPeerId2, relayPeerId2)
}
export async function topologyBug205Call(peer2: FluencePeer): Promise<string[]> {
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;