Skip to content

Commit

Permalink
fix: false positive warning in verificationBuilder (Open-Attestation#233
Browse files Browse the repository at this point in the history
)
  • Loading branch information
marlowl authored Jul 29, 2022
1 parent dd61608 commit 1d14721
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/verifiers/verificationBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,17 @@ import { warnProvider } from "../common/messages";
* Before running each verifier, the manager will make sure the verifier can handle the specific document by calling its exposed test function.
* The manager will return the consolidated list of {@link VerificationFragment}
*/
let displayWarning = true;
export const verificationBuilder = <T extends Verifier<any>>(
verifiers: T[],
builderOptions: VerificationBuilderOptions
) => (document: DocumentsToVerify, promisesCallback?: PromiseCallback): Promise<VerificationFragment[]> => {
// if the user didn't configure an API key and didn't configure a provider or a resolver, then he will likely use a development key. We then warn him once, that he may need to configure things properly, especially for production
if (
displayWarning &&
(!builderOptions.resolver || !builderOptions.provider) &&
!builderOptions.resolver &&
!builderOptions.provider &&
!process.env.INFURA_API_KEY &&
!process.env.PROVIDER_API_KEY
) {
displayWarning = false;
console.warn(warnProvider);
}
const verifierOptions: VerifierOptions = {
Expand Down

0 comments on commit 1d14721

Please sign in to comment.