From 5eb9837f3534927c969c0b30e16c4d6aebd628f4 Mon Sep 17 00:00:00 2001 From: Florian Franzen Date: Fri, 3 May 2024 19:59:22 +0200 Subject: [PATCH] skipIdentity: add implementation --- packages/common/src/constraints/CheckCandidates.ts | 6 +++++- packages/common/src/constraints/ValidityChecks.ts | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/common/src/constraints/CheckCandidates.ts b/packages/common/src/constraints/CheckCandidates.ts index 2d1492598..c73826479 100644 --- a/packages/common/src/constraints/CheckCandidates.ts +++ b/packages/common/src/constraints/CheckCandidates.ts @@ -62,7 +62,11 @@ export const checkCandidate = async ( ); } - const identityValid = await checkIdentity(constraints.chaindata, candidate); + const identityValid = await checkIdentity( + constraints.config, + constraints.chaindata, + candidate + ); if (!identityValid) { logger.info(`${candidate.name} identity not valid`, constraintsLabel); } diff --git a/packages/common/src/constraints/ValidityChecks.ts b/packages/common/src/constraints/ValidityChecks.ts index 969266e2e..b38474a0b 100644 --- a/packages/common/src/constraints/ValidityChecks.ts +++ b/packages/common/src/constraints/ValidityChecks.ts @@ -203,10 +203,16 @@ export const checkConnectionTime = async ( }; export const checkIdentity = async ( + config: Config.ConfigSchema, chaindata: ChainData, candidate: Candidate, ): Promise => { try { + const skipIdentity = config.constraints?.skipIdentity || false; + if (skipIdentity) { + await setIdentityInvalidity(candidate, true); + return true; + } const [hasIdentity, verified] = await chaindata.hasIdentity( candidate.stash, );