@fleupold/dex-contracts
Version:
Contracts for dFusion multi-token batch auction exchange
33 lines (32 loc) • 1.69 kB
TypeScript
import { TestCase, TestCaseInput, ObjectiveValueComputation, ComputedSolution, SolutionSubmission } from "./model";
/**
* Generates a test case to be used for unit and e2e testing with the contract
* with computed solution values and objective values.
* @param input - The input to the test case
* @param debug - Print debug information in case of
* @param strict - Throw when solution is determined to be invalid
* @returns The test case
*/
export declare function generateTestCase(input: TestCaseInput, strict?: boolean, debug?: boolean): TestCase;
/**
* Prints debug information for a test case.
* @param testCase - The test case
* @param orderIds - The optional order indices for display, defaults to [0...]
* @param accounts - The optional accounts for display, defaults to [1...]
*/
export declare function debugTestCase(testCase: TestCase, orderIds: number[], accounts: string[]): void;
/**
* Generates `submitSolution` parameters for a given computed solution. Note
* that thifrom order indices as they are not known until runtime
* @param solution - The computed solution
* @param accounts - The order indices as they are on the contract
* @param orderIds - The order indices as they are on the contract
* @returns The parameters to submit the solution
*/
export declare function solutionSubmissionParams(solution: ComputedSolution, accounts: string[], orderIds: number[]): SolutionSubmission;
/**
* Prints debug information for an objective value compuation.
* @param testCase - The test case
*/
export declare function debugObjectiveValueComputation(objectiveValue: ObjectiveValueComputation): void;
export declare function formatTable(table: any[][]): void;