trustwallet-assets/script/action/interface.ts
Adam R 294d8bcb5d
[internal] Fixes and Checks: separate into consistency and sanity (#3197)
* rename to sanityFix
* Infra for consistency checks and Fixes.
* Whitelist check moved to consistency check only.

Co-authored-by: Catenocrypt <catenocrypt@users.noreply.github.com>
2020-08-10 10:56:41 +02:00

26 lines
697 B
TypeScript

// A single check step
export interface CheckStepInterface {
getName(): string;
// return error or null/empty on success
check(): Promise<string>;
}
// An action for a check, fix, or update, or a combination.
export interface ActionInterface {
getName(): string;
// return check steps for sanity check (0, 1, or more)
getSanityChecks(): CheckStepInterface[];
// return check steps for consistenct check (0, 1, or more)
getConsistencyChecks(): CheckStepInterface[];
sanityFix(): Promise<void>;
consistencyFix(): Promise<void>;
update(): Promise<void>;
}
export enum FixCheckMode {
CheckSanityOnly = 1,
CheckAll,
FixSanityOnly,
FixAll
}