Skip to content

Commit

Permalink
chore: disable compliance check
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie authored and pete-watters committed Apr 10, 2024
1 parent f179f3e commit b4b1d11
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/app/common/validation/forms/compliance-validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import * as yup from 'yup';

import type { NetworkModes } from '@shared/constants';

import { checkEntityAddressIsCompliant } from '@app/query/common/compliance-checker/compliance-checker.query';
import {
checkEntityAddressIsCompliant,
isComplianceCheckEnabled,
} from '@app/query/common/compliance-checker/compliance-checker.query';

export function complianceValidator(
shouldCheckCompliance: yup.StringSchema<string, yup.AnyObject>,
Expand All @@ -16,6 +19,8 @@ export function complianceValidator(

if (network !== 'mainnet') return true;

if (!isComplianceCheckEnabled) return true;

if (!shouldCheckCompliance.isValidSync(value)) return true;

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const headers = {
Token: '51d3c7529eb08a8c62d41d70d006bdcd4248150fbd6826d5828ac908e7c12073',
};

export const isComplianceCheckEnabled = false;

async function registerEntityAddressComplianceCheck(address: string) {
const resp = await axios.post(checkApi, { address }, { headers });
return resp.data;
Expand Down Expand Up @@ -76,6 +78,8 @@ export function useBreakOnNonCompliantEntity(address: string | string[]) {
...ensureArray(address),
]);

if (!isComplianceCheckEnabled) return;

if (complianceReports.some(report => report.data?.isOnSanctionsList)) {
void analytics.track('non_compliant_entity_detected');
throw new Error('Unable to handle request, errorCode: 1398');
Expand Down
2 changes: 1 addition & 1 deletion tests/specs/compliance-checks/compliance-checks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function mockChainalysisEntityCheckRequest(context: BrowserContext) {
);
}

test.describe('Compliance checks', () => {
test.skip('Compliance checks', () => {
test.beforeEach(async ({ extensionId, globalPage, onboardingPage, page }) => {
await globalPage.setupAndUseApiCalls(extensionId);
await onboardingPage.signInWithTestAccount(extensionId);
Expand Down

0 comments on commit b4b1d11

Please sign in to comment.