@holochain/tryorama
Version:
Toolset to manage Holochain conductors and facilitate running test scenarios
57 lines (56 loc) • 2.27 kB
TypeScript
import { DnaHash } from "@holochain/client";
import { PlayerApp } from "./scenario.js";
import { ConductorCell } from "./types.js";
/**
* A utility function to wait the given amount of time.
*
* @param milliseconds - The number of milliseconds to wait.
* @returns A promise that is resolved after the given amount of milliseconds.
*
* @public
*/
export declare const pause: (milliseconds: number) => Promise<unknown>;
/**
* A utility function to compare conductors' integrated DhtOps.
*
* @param conductors - Array of conductors.
* @param cellId - Cell id to compare integrated DhtOps from.
* @returns A promise that is resolved after conductors' Integrated DhtOps match.
*
* @public
*/
export declare const areDhtsSynced: (playerApps: PlayerApp[], dnaHash: DnaHash) => Promise<boolean>;
/**
* A utility function to compare conductors' integrated DhtOps.
*
* @param conductorCells - Array of ConductorCells
* @returns A promise that is resolved after conductors' Integrated DhtOps match.
*
* @public
*/
export declare const areConductorCellsDhtsSynced: (conductorCells: ConductorCell[]) => Promise<boolean>;
/**
* A utility function to wait until all conductors' DhtOps have been integrated,
* and are identical for a given DNA.
*
* @param players - Array of players.
* @param dnaHash - DNA hash to compare integrated DhtOps from.
* @param intervalMs - Interval to pause between comparisons (defaults to 500 milliseconds).
* @param timeoutMs - A timeout for the delay (defaults to 60000 milliseconds).
* @returns A promise that is resolved after all agents' DHT states match.
*
* @public
*/
export declare const dhtSync: (players: PlayerApp[], dnaHash: DnaHash, intervalMs?: number, timeoutMs?: number) => Promise<void>;
/**
* A utility function to wait until all conductors' integrated DhtOps are
* identical for a DNA.
*
* @param conductorCells - Array of ConductorCell.
* @param interval - Interval to pause between comparisons (defaults to 50 ms).
* @param timeout - A timeout for the delay (optional).
* @returns A promise that is resolved after all agents' DHT states match.
*
* @public
*/
export declare const conductorCellsDhtSync: (conductorCells: ConductorCell[], intervalMs: number, timeoutMs: number) => Promise<void>;