UNPKG

@holochain/tryorama

Version:

Toolset to manage Holochain conductors and facilitate running test scenarios

56 lines (55 loc) 2.17 kB
import { DnaHash } from "@holochain/client"; import { IConductorCell, IPlayer } 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: (players: IPlayer[], 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: IConductorCell[]) => Promise<boolean>; /** * A utility function to wait until all conductors' integrated DhtOps are * identical for a DNA. * * @param players - Array of players. * @param dnaHash - DNA hash to compare integrated DhtOps from. * @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 dhtSync: (players: IPlayer[], dnaHash: DnaHash, interval?: number, timeout?: number) => Promise<void>; /** * A utility function to wait until all conductors' integrated DhtOps are * identical for a DNA. * * @param conductorCells - Array of IConductorCell. * @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: IConductorCell[], interval?: number, timeout?: number) => Promise<void>;