update fluence, add fold-join test, use built-in from lib

This commit is contained in:
DieMyst
2021-06-01 19:41:30 +03:00
parent 16ab3004d5
commit f886650fb4
27 changed files with 198 additions and 504 deletions

View File

@ -14,6 +14,7 @@ import {complexCall} from "./examples/complex";
import {constantsCall} from "./examples/constantsCall";
import {streamCall} from "./examples/streamCall";
import {topologyCall} from "./examples/topologyCall";
import {foldJoinCall} from "./examples/foldJoinCall";
let deepEqual = require('deep-equal')
function checkCall(name: string, expected: any, actual: any, callBackOnError: () => void) {
@ -25,6 +26,14 @@ function checkCall(name: string, expected: any, actual: any, callBackOnError: ()
}
}
function checkCallBy(name: string, actual: any, by: (res: any) => boolean, callBackOnError: () => void) {
if (!by(actual)) {
console.error(`${name} call has the wrong result`)
console.error("actual: " + actual)
callBackOnError()
}
}
const main = async () => {
const client = await createClient(testNet[0]);
const client2 = await createClient(testNet[1]);
@ -77,6 +86,9 @@ const main = async () => {
// topology.aqua
let topologyResult = await topologyCall(client, client2)
// foldJoin.aqua
let foldJoinResult = await foldJoinCall(client)
await client.disconnect();
let success = true;
@ -106,6 +118,8 @@ const main = async () => {
checkCall("topologyCall", topologyResult, "finish", cb)
checkCallBy("foldJoinCall", foldJoinResult, (res) => res.length == 3, cb)
if (success) {
process.exit(0)
} else {