update versions, subImport tests

This commit is contained in:
DieMyst
2021-08-31 12:19:36 +03:00
parent 477601b8df
commit 95cdd7313e
32 changed files with 79 additions and 28 deletions

View File

@ -0,0 +1,13 @@
alias SomeString : string
data SomeResult:
one: SomeString
two: u32
service SubService("sub_service"):
sub(s: SomeString) -> SomeResult
func subImport() -> SomeResult:
res <- SubService.sub("some thing")
<- res

View File

@ -0,0 +1,11 @@
import "imports_exports/subImport.aqua"
service ConcatSubs("concat_subs"):
get_some(s: SomeString, sr: SomeResult) -> SomeResult
func subImportUsage(s: SomeString) -> SomeResult:
sr1 <- SubService.sub(s)
sr2 <- subImport()
result <- ConcatSubs.get_some(sr1.one, sr2)
<- result

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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } 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.1.14-SNAPSHOT
* Aqua version: 0.2.0-SNAPSHOT
*
*/
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';

View File

@ -0,0 +1,21 @@
import {FluenceClient, registerServiceFunction} from "@fluencelabs/fluence";
import {subImportUsage} from "../compiled/examples/subImportUsage";
export async function subImportCall(client: FluenceClient) {
// helloWorld.aqua
registerServiceFunction(client, "sub_service", "sub", (args: any[], _) => {
return {
one: args[0],
two: 42
}
})
registerServiceFunction(client, "concat_subs", "get_some", (args: any[], _) => {
return {
one: args[0],
two: args[1].two
}
})
return await subImportUsage(client, "random_string");
}

View File

@ -29,6 +29,7 @@ import {pushToStreamCall} from "./examples/pushToStreamCall";
import {literalCall} from "./examples/returnLiteralCall";
import {multiReturnCall} from "./examples/multiReturnCall";
import {declareCall} from "./examples/declareCall";
import {subImportCall} from "./examples/subImportUsageCall";
let deepEqual = require('deep-equal')
function checkCall(name: string, actual: any, expected: any, callBackOnError: () => void) {
@ -150,6 +151,9 @@ const main = async () => {
// declare.aqua
let declareResult = await declareCall(client)
// subImport.aqua and subImportUsage.aqua
let subImportResult = await subImportCall(client)
await client.disconnect();
let success = true;
@ -209,6 +213,8 @@ const main = async () => {
checkCall("declareResult", declareResult, 'declare all foodeclare all barsmall_foo', cb)
checkCall("subImportResult", subImportResult, { one: "random_string", two: 42 }, cb)
checkCallBy("tryCatchCall", tryCatchResult, (res) => {
return (res[0] as string).includes("Error: Service with id 'unex' not found") && res[1] === '/ip4/134.209.186.43/tcp/7001'
}, cb)