Commit e2da56b5 authored by tom's avatar tom

rollback all debugs

parent 79cb82d6
import type { PlaywrightTestConfig } from '@playwright/experimental-ct-react'; import type { PlaywrightTestConfig } from '@playwright/experimental-ct-react';
import { devices } from '@playwright/experimental-ct-react'; import { devices } from '@playwright/experimental-ct-react';
import react from '@vitejs/plugin-react'; import react from '@vitejs/plugin-react';
import dynamicImport from 'vite-plugin-dynamic-import';
import svgr from 'vite-plugin-svgr'; import svgr from 'vite-plugin-svgr';
import tsconfigPaths from 'vite-tsconfig-paths'; import tsconfigPaths from 'vite-tsconfig-paths';
...@@ -51,7 +50,6 @@ const config: PlaywrightTestConfig = { ...@@ -51,7 +50,6 @@ const config: PlaywrightTestConfig = {
svgr({ svgr({
exportAsDefault: true, exportAsDefault: true,
}), }),
dynamicImport(),
], ],
}, },
}, },
......
...@@ -15,7 +15,7 @@ const hooksConfig = { ...@@ -15,7 +15,7 @@ const hooksConfig = {
}, },
}; };
test.skip('verified with changed byte code +@mobile +@dark-mode', async({ mount, page }) => { test('verified with changed byte code +@mobile +@dark-mode', async({ mount, page }) => {
await page.route(CONTRACT_API_URL, (route) => route.fulfill({ await page.route(CONTRACT_API_URL, (route) => route.fulfill({
status: 200, status: 200,
body: JSON.stringify(contractMock.withChangedByteCode), body: JSON.stringify(contractMock.withChangedByteCode),
...@@ -31,7 +31,7 @@ test.skip('verified with changed byte code +@mobile +@dark-mode', async({ mount, ...@@ -31,7 +31,7 @@ test.skip('verified with changed byte code +@mobile +@dark-mode', async({ mount,
await expect(component).toHaveScreenshot(); await expect(component).toHaveScreenshot();
}); });
test.skip('verified with multiple sources', async({ mount, page }) => { test('verified with multiple sources', async({ mount, page }) => {
await page.route(CONTRACT_API_URL, (route) => route.fulfill({ await page.route(CONTRACT_API_URL, (route) => route.fulfill({
status: 200, status: 200,
body: JSON.stringify(contractMock.withMultiplePaths), body: JSON.stringify(contractMock.withMultiplePaths),
...@@ -65,7 +65,7 @@ test('verified via sourcify', async({ mount, page }) => { ...@@ -65,7 +65,7 @@ test('verified via sourcify', async({ mount, page }) => {
await expect(page).toHaveScreenshot({ clip: { x: 0, y: 0, width: 1200, height: 110 } }); await expect(page).toHaveScreenshot({ clip: { x: 0, y: 0, width: 1200, height: 110 } });
}); });
test.skip('self destructed', async({ mount, page }) => { test('self destructed', async({ mount, page }) => {
await page.route(CONTRACT_API_URL, (route) => route.fulfill({ await page.route(CONTRACT_API_URL, (route) => route.fulfill({
status: 200, status: 200,
body: JSON.stringify(contractMock.selfDestructed), body: JSON.stringify(contractMock.selfDestructed),
...@@ -82,7 +82,7 @@ test.skip('self destructed', async({ mount, page }) => { ...@@ -82,7 +82,7 @@ test.skip('self destructed', async({ mount, page }) => {
await expect(section).toHaveScreenshot(); await expect(section).toHaveScreenshot();
}); });
test.skip('with twin address alert +@mobile', async({ mount, page }) => { test('with twin address alert +@mobile', async({ mount, page }) => {
await page.route(CONTRACT_API_URL, (route) => route.fulfill({ await page.route(CONTRACT_API_URL, (route) => route.fulfill({
status: 200, status: 200,
body: JSON.stringify(contractMock.withTwinAddress), body: JSON.stringify(contractMock.withTwinAddress),
...@@ -98,7 +98,7 @@ test.skip('with twin address alert +@mobile', async({ mount, page }) => { ...@@ -98,7 +98,7 @@ test.skip('with twin address alert +@mobile', async({ mount, page }) => {
await expect(component.getByRole('alert')).toHaveScreenshot(); await expect(component.getByRole('alert')).toHaveScreenshot();
}); });
test.skip('non verified', async({ mount, page }) => { test('non verified', async({ mount, page }) => {
await page.route(CONTRACT_API_URL, (route) => route.fulfill({ await page.route(CONTRACT_API_URL, (route) => route.fulfill({
status: 200, status: 200,
body: JSON.stringify(contractMock.nonVerified), body: JSON.stringify(contractMock.nonVerified),
......
...@@ -11,7 +11,7 @@ import DataFetchAlert from 'ui/shared/DataFetchAlert'; ...@@ -11,7 +11,7 @@ import DataFetchAlert from 'ui/shared/DataFetchAlert';
import ExternalLink from 'ui/shared/ExternalLink'; import ExternalLink from 'ui/shared/ExternalLink';
import RawDataSnippet from 'ui/shared/RawDataSnippet'; import RawDataSnippet from 'ui/shared/RawDataSnippet';
import type TContractSourceCode from './ContractSourceCode'; import ContractSourceCode from './ContractSourceCode';
const InfoItem = ({ label, value }: { label: string; value: string }) => ( const InfoItem = ({ label, value }: { label: string; value: string }) => (
<GridItem display="flex" columnGap={ 6 }> <GridItem display="flex" columnGap={ 6 }>
...@@ -22,15 +22,6 @@ const InfoItem = ({ label, value }: { label: string; value: string }) => ( ...@@ -22,15 +22,6 @@ const InfoItem = ({ label, value }: { label: string; value: string }) => (
const ContractCode = () => { const ContractCode = () => {
const router = useRouter(); const router = useRouter();
const [ ContractSourceCode, setContractSourceCode ] = React.useState<typeof TContractSourceCode | null>(null);
React.useEffect(() => {
import('./ContractSourceCode').then((component) => setContractSourceCode(component.default));
return () => {
setContractSourceCode(null);
};
}, []);
const addressHash = router.query.id?.toString(); const addressHash = router.query.id?.toString();
const { data, isLoading, isError } = useApiQuery('contract', { const { data, isLoading, isError } = useApiQuery('contract', {
...@@ -158,7 +149,7 @@ const ContractCode = () => { ...@@ -158,7 +149,7 @@ const ContractCode = () => {
textareaMaxHeight="200px" textareaMaxHeight="200px"
/> />
) } ) }
{ data.source_code && ContractSourceCode && ( { data.source_code && (
<ContractSourceCode <ContractSourceCode
data={ data.source_code } data={ data.source_code }
hasSol2Yml={ Boolean(data.can_be_visualized_via_sol2uml) } hasSol2Yml={ Boolean(data.can_be_visualized_via_sol2uml) }
......
import { chakra, useColorModeValue } from '@chakra-ui/react'; import { chakra, useColorModeValue } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import AceEditor from 'react-ace'; import type ReactAce from 'react-ace/lib/ace';
import 'ace-builds/src-noconflict/mode-csharp';
import 'ace-builds/src-noconflict/theme-tomorrow';
import 'ace-builds/src-noconflict/theme-tomorrow_night';
import 'ace-builds/src-noconflict/ext-language_tools';
interface Props { interface Props {
id: string; id: string;
...@@ -14,10 +10,33 @@ interface Props { ...@@ -14,10 +10,33 @@ interface Props {
const CodeEditorBase = chakra(({ id, value, className }: Props) => { const CodeEditorBase = chakra(({ id, value, className }: Props) => {
const [ AceEditor, setAceEditor ] = React.useState<{default: typeof ReactAce} | null>(null);
React.useEffect(() => {
const load = async() => {
const component = await import('react-ace');
await import('ace-builds/src-noconflict/mode-csharp');
await import('ace-builds/src-noconflict/theme-tomorrow');
await import('ace-builds/src-noconflict/theme-tomorrow_night');
await import('ace-builds/src-noconflict/ext-language_tools');
setAceEditor(component);
};
load();
return () => {
setAceEditor(null);
};
}, []);
const theme = useColorModeValue('tomorrow', 'tomorrow_night'); const theme = useColorModeValue('tomorrow', 'tomorrow_night');
if (!AceEditor) {
return null;
}
return ( return (
<AceEditor <AceEditor.default
className={ className } className={ className }
mode="csharp" // TODO need to find mode for solidity mode="csharp" // TODO need to find mode for solidity
theme={ theme } theme={ theme }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment