update aqua and fluence-js

This commit is contained in:
DieMyst
2021-04-23 17:21:58 +03:00
parent 35498536f4
commit 93a9d0e27d
17 changed files with 432 additions and 188 deletions

View File

@ -1,3 +1,10 @@
/**
*
* 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
*
*/
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
@ -7,6 +14,7 @@ export async function testFunc(client: FluenceClient): Promise<string> {
let request;
const promise = new Promise<string>((resolve, reject) => {
request = new RequestFlowBuilder()
.disableInjections()
.withRawScript(
`
(xor
@ -24,18 +32,18 @@ export async function testFunc(client: FluenceClient): Promise<string> {
)
.configHandler((h) => {
h.on('getDataSrv', 'relay', () => {
return client.relayPeerId;
return client.relayPeerId!;
});
h.on('getRelayService', 'hasReleay', () => {// Not Used
return client.relayPeerId !== undefined;
});
h.on('callbackSrv', 'response', (args) => {
h.onEvent('callbackSrv', 'response', (args) => {
const [res] = args;
resolve(res);
});
h.on('errorHandlingSrv', 'error', (args) => {
h.onEvent('errorHandlingSrv', 'error', (args) => {
// assuming error is the single argument
const [err] = args;
reject(err);
@ -43,7 +51,7 @@ export async function testFunc(client: FluenceClient): Promise<string> {
})
.handleScriptError(reject)
.handleTimeout(() => {
reject('Request timed out');
reject('Request timed out for testFunc');
})
.build();
});