Skip to content

Commit 5eb9837

Browse files
skipIdentity: add implementation
1 parent 1118589 commit 5eb9837

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/common/src/constraints/CheckCandidates.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ export const checkCandidate = async (
6262
);
6363
}
6464

65-
const identityValid = await checkIdentity(constraints.chaindata, candidate);
65+
const identityValid = await checkIdentity(
66+
constraints.config,
67+
constraints.chaindata,
68+
candidate
69+
);
6670
if (!identityValid) {
6771
logger.info(`${candidate.name} identity not valid`, constraintsLabel);
6872
}

packages/common/src/constraints/ValidityChecks.ts

+6
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,16 @@ export const checkConnectionTime = async (
203203
};
204204

205205
export const checkIdentity = async (
206+
config: Config.ConfigSchema,
206207
chaindata: ChainData,
207208
candidate: Candidate,
208209
): Promise<boolean> => {
209210
try {
211+
const skipIdentity = config.constraints?.skipIdentity || false;
212+
if (skipIdentity) {
213+
await setIdentityInvalidity(candidate, true);
214+
return true;
215+
}
210216
const [hasIdentity, verified] = await chaindata.hasIdentity(
211217
candidate.stash,
212218
);

0 commit comments

Comments
 (0)