mirror of
https://github.com/fluencelabs/aqua-playground
synced 2025-06-21 19:11:47 +00:00
update, add test for assignment
This commit is contained in:
10
aqua/examples/assignment.aqua
Normal file
10
aqua/examples/assignment.aqua
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
data Prod:
|
||||||
|
value: string
|
||||||
|
|
||||||
|
service OpHa("op"):
|
||||||
|
identity(a: string) -> string
|
||||||
|
|
||||||
|
func doSmth(arg: Prod) -> string:
|
||||||
|
v = arg.value
|
||||||
|
a <- OpHa.identity(v)
|
||||||
|
<- a
|
@ -4,7 +4,6 @@ import "@fluencelabs/aqua-lib/builtin.aqua"
|
|||||||
-- functions like `c` are called an 'arrow function' in Aqua
|
-- functions like `c` are called an 'arrow function' in Aqua
|
||||||
-- `c` passed to a function from a client, so, it could be called only on a client
|
-- `c` passed to a function from a client, so, it could be called only on a client
|
||||||
func passFunctionAsArg(node: string, str: string, c: string -> string):
|
func passFunctionAsArg(node: string, str: string, c: string -> string):
|
||||||
Op.identity()
|
|
||||||
on node:
|
on node:
|
||||||
Peer.identify()
|
Peer.identify()
|
||||||
-- we go here back on a client
|
-- we go here back on a client
|
||||||
|
69
src/compiled/examples/assignment.ts
Normal file
69
src/compiled/examples/assignment.ts
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* 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.1.5-SNAPSHOT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
|
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||||
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export async function doSmth(client: FluenceClient, arg: {value:string}): Promise<string> {
|
||||||
|
let request: RequestFlow;
|
||||||
|
const promise = new Promise<string>((resolve, reject) => {
|
||||||
|
request = new RequestFlowBuilder()
|
||||||
|
.disableInjections()
|
||||||
|
.withRawScript(
|
||||||
|
`
|
||||||
|
(xor
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "arg") [] arg)
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("op" "identity") [arg.$.value!] a)
|
||||||
|
)
|
||||||
|
(xor
|
||||||
|
(call %init_peer_id% ("callbackSrv" "response") [a])
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(seq
|
||||||
|
(call -relay- ("op" "identity") [])
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
`,
|
||||||
|
)
|
||||||
|
.configHandler((h) => {
|
||||||
|
h.on('getDataSrv', '-relay-', () => {
|
||||||
|
return client.relayPeerId!;
|
||||||
|
});
|
||||||
|
h.on('getDataSrv', 'arg', () => {return arg;});
|
||||||
|
h.onEvent('callbackSrv', 'response', (args) => {
|
||||||
|
const [res] = args;
|
||||||
|
resolve(res);
|
||||||
|
});
|
||||||
|
|
||||||
|
h.onEvent('errorHandlingSrv', 'error', (args) => {
|
||||||
|
// assuming error is the single argument
|
||||||
|
const [err] = args;
|
||||||
|
reject(err);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.handleScriptError(reject)
|
||||||
|
.handleTimeout(() => {
|
||||||
|
reject('Request timed out for doSmth');
|
||||||
|
})
|
||||||
|
.build();
|
||||||
|
});
|
||||||
|
await client.initiateFlow(request!);
|
||||||
|
return promise;
|
||||||
|
}
|
||||||
|
|
@ -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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -68,7 +68,6 @@ export async function passFunctionAsArg(client: FluenceClient, node: string, str
|
|||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
@ -76,8 +75,6 @@ export async function passFunctionAsArg(client: FluenceClient, node: string, str
|
|||||||
)
|
)
|
||||||
(call %init_peer_id% ("getDataSrv" "str") [] str)
|
(call %init_peer_id% ("getDataSrv" "str") [] str)
|
||||||
)
|
)
|
||||||
(call %init_peer_id% ("op" "identity") [])
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "identity") [])
|
(call -relay- ("op" "identity") [])
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
|
@ -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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } 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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } 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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } 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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } 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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } 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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } 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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } 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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } 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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } 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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } 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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -86,7 +86,7 @@ export async function d(client: FluenceClient, e: string): Promise<string> {
|
|||||||
(call %init_peer_id% ("opa" "identity") [e] c)
|
(call %init_peer_id% ("opa" "identity") [e] c)
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
(call %init_peer_id% ("callbackSrv" "response") [f])
|
(call %init_peer_id% ("callbackSrv" "response") [c])
|
||||||
(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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } 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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } 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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } 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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } 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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } 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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } 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.1.4-136
|
* Aqua version: 0.1.5-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
|
7
src/examples/assignment.ts
Normal file
7
src/examples/assignment.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import {FluenceClient} from "@fluencelabs/fluence";
|
||||||
|
import {passFunctionAsArg} from "../compiled/examples/callArrow";
|
||||||
|
import {doSmth} from "../compiled/examples/assignment";
|
||||||
|
|
||||||
|
export async function assignmentCall(client: FluenceClient): Promise<string> {
|
||||||
|
return await doSmth(client, {value: "abc"})
|
||||||
|
}
|
@ -18,6 +18,7 @@ import {foldJoinCall} from "./examples/foldJoinCall";
|
|||||||
import {useOptionalCall} from "./examples/useOptionalCall";
|
import {useOptionalCall} from "./examples/useOptionalCall";
|
||||||
import {viaCall} from "./examples/viaCall";
|
import {viaCall} from "./examples/viaCall";
|
||||||
import {nestedFuncsCall} from "./examples/nestedFuncsCall";
|
import {nestedFuncsCall} from "./examples/nestedFuncsCall";
|
||||||
|
import {assignmentCall} from "./examples/assignment";
|
||||||
let deepEqual = require('deep-equal')
|
let deepEqual = require('deep-equal')
|
||||||
|
|
||||||
function checkCall(name: string, expected: any, actual: any, callBackOnError: () => void) {
|
function checkCall(name: string, expected: any, actual: any, callBackOnError: () => void) {
|
||||||
@ -104,6 +105,9 @@ const main = async () => {
|
|||||||
// nestedFuncs.aqua
|
// nestedFuncs.aqua
|
||||||
let nestedFuncsResult = await nestedFuncsCall(client)
|
let nestedFuncsResult = await nestedFuncsCall(client)
|
||||||
|
|
||||||
|
// assignment.aqua
|
||||||
|
let assignmentResult = await assignmentCall(client)
|
||||||
|
|
||||||
await client.disconnect();
|
await client.disconnect();
|
||||||
|
|
||||||
let success = true;
|
let success = true;
|
||||||
@ -141,6 +145,8 @@ const main = async () => {
|
|||||||
|
|
||||||
checkCall("nestedFuncsCall", nestedFuncsResult, "some-str", cb)
|
checkCall("nestedFuncsCall", nestedFuncsResult, "some-str", cb)
|
||||||
|
|
||||||
|
checkCall("assignmentCall", assignmentResult, "abc", cb)
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user