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

chore: disable compliance check #5185

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
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
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be added to config?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be the idea here is to quickly disable this for release and then re-enable afterwards so lets let it slide this time


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', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kyranjamie I checked #5122 and will just skip this whole test for now for release

test.beforeEach(async ({ extensionId, globalPage, onboardingPage, page }) => {
await globalPage.setupAndUseApiCalls(extensionId);
await onboardingPage.signInWithTestAccount(extensionId);
Expand Down
Loading