-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathinvariant.types.ts
More file actions
44 lines (37 loc) · 1.29 KB
/
invariant.types.ts
File metadata and controls
44 lines (37 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import type { EventEmitter } from "node:events";
import type { Simnet } from "@stacks/clarinet-sdk";
import type { EnrichedContractInterfaceFunction } from "./shared.types";
type ContractId = string;
type SutFunctionName = string;
/**
* LocalContext is a data structure used to track the number of times each SUT
* function is called for every contract. It is a nested map where:
* - The outer key is the contract identifier.
* - The inner key is the SUT function name within the contract.
* - The value is the count of times the SUT function has been invoked.
*/
export type LocalContext = Record<ContractId, Record<SutFunctionName, number>>;
/**
* The configuration for an invariant test.
*/
export interface InvariantTestConfig {
simnet: Simnet;
targetContractName: string;
rendezvousContractId: string;
runs: number | undefined;
seed: number | undefined;
bail: boolean;
dial: string | undefined;
radio: EventEmitter;
eligibleAccounts: Map<string, string>;
allAddresses: string[];
}
/**
* The context to run an invariant test with.
*/
export interface InvariantTestContext {
/** SUT functions for the target contract. */
functions: EnrichedContractInterfaceFunction[];
/** Invariant functions for the target contract. */
invariants: EnrichedContractInterfaceFunction[];
}