Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: false positive warning in verificationBuilder #233

Merged
merged 1 commit into from
Jul 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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