Skip to content

Commit

Permalink
chore(extension): remove old code from extension (#613)
Browse files Browse the repository at this point in the history
* remove edit route

* remove obsolete e2e tests

* clean up dependencies

* remove usage of fromLegacyConnection helper

* remove legacy route migration from extension

* increase type-safety
  • Loading branch information
frontendphil authored Jan 22, 2025
1 parent 3ef747e commit ec132e9
Show file tree
Hide file tree
Showing 62 changed files with 259 additions and 3,336 deletions.
4 changes: 2 additions & 2 deletions deployables/app/app/components/ModSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface Option {

interface Props<Option = unknown, Multi extends boolean = boolean>
extends SelectProps<false, Option, Multi> {
avatarAddress: string
avatarAddress: HexAddress
}

export function ModSelect<Multi extends boolean = boolean>({
Expand Down Expand Up @@ -47,7 +47,7 @@ export function ModSelect<Multi extends boolean = boolean>({

type ValueProps = PropsWithChildren<{
label: string
address: string
address: HexAddress
}>

const Value = ({ label, address, children }: ValueProps) => (
Expand Down
2 changes: 1 addition & 1 deletion deployables/app/app/components/ZodiacMod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const ZodiacMod = ({
}
isDisabled={disabled || isLoading}
placeholder={isLoading ? 'Loading modules...' : 'Select a module'}
avatarAddress={avatar}
avatarAddress={parsePrefixedAddress(avatar)}
/>

{selectedModule?.type === SupportedZodiacModuleType.ROLES_V1 && (
Expand Down
2 changes: 1 addition & 1 deletion deployables/app/app/components/wallet/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type AccountProps = {
}

export const Account = ({ children, type }: AccountProps) => {
const address = validateAddress(children) ?? ''
const address = validateAddress(children)

return (
<AddressInput
Expand Down
72 changes: 0 additions & 72 deletions deployables/extension/e2e/accountHandling/lockedAccount.spec.ts

This file was deleted.

This file was deleted.

49 changes: 0 additions & 49 deletions deployables/extension/e2e/accountHandling/wrongChain.spec.ts

This file was deleted.

42 changes: 15 additions & 27 deletions deployables/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,9 @@
},
"devDependencies": {
"@depay/web3-mock": "^14.19.1",
"@gnosis.pm/zodiac": "^4.0.3",
"@noble/hashes": "^1.4.0",
"@playwright/test": "^1.48.1",
"@safe-global/api-kit": "2.5.7",
"@safe-global/protocol-kit": "5.2.0",
"@safe-global/safe-apps-sdk": "9.1.0",
"@safe-global/safe-gateway-typescript-sdk": "3.22.7",
"@shazow/whatsabi": "^0.19.0",
"@sentry/esbuild-plugin": "^3.0.0",
"@testing-library/dom": "10.4.0",
"@testing-library/jest-dom": "6.6.3",
"@testing-library/react": "16.2.0",
Expand All @@ -46,53 +41,41 @@
"@types/react": "19.0.7",
"@types/react-dom": "19.0.3",
"@vitest/coverage-v8": "2.1.8",
"@walletconnect/core": "2.17.3",
"@walletconnect/ethereum-provider": "2.17.3",
"@walletconnect/keyvaluestorage": "^1.1.1",
"@walletconnect/modal": "2.7.0",
"@walletconnect/sign-client": "2.17.3",
"@walletconnect/universal-provider": "2.17.3",
"@zodiac/eslint-config": "workspace:*",
"@zodiac/tailwind-config": "workspace:*",
"@zodiac/test-utils": "workspace:*",
"@zodiac/typescript-config": "workspace:*",
"autoprefixer": "^10.4.20",
"chalk": "^5.4.1",
"classnames": "^2.3.1",
"copy-to-clipboard": "^3.3.1",
"dotenv": "^16.0.1",
"esbuild": "^0.24.0",
"esbuild-style-plugin": "^1.6.3",
"eslint": "^9.7.0",
"ethereum-blockies-base64": "^1.0.2",
"ethers": "6.13.5",
"events": "^3.3.0",
"evm-proxy-detection": "^2.0.1",
"globals": "^15.8.0",
"happy-dom": "^16.0.0",
"isomorphic-fetch": "^3.0.0",
"jsdom-testing-mocks": "^1.13.1",
"madge": "^8.0.0",
"nanoid": "^5.0.0",
"node-stdlib-browser": "^1.2.0",
"postcss": "^8.4.47",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-select": "5.9.0",
"rimraf": "6.0.1",
"ser-kit": "1.1.0",
"tailwindcss": "^3.4.14",
"typescript": "^5.5.4",
"vitest": "2.1.8",
"vitest-chrome": "0.1.0",
"zodiac-roles-deployments": "^2.2.2"
"vitest-chrome": "0.1.0"
},
"packageManager": "[email protected]",
"dependencies": {
"@epic-web/invariant": "^1.0.0",
"@gnosis.pm/zodiac": "^4.0.3",
"@headlessui/react": "^2.2.0",
"@sentry/esbuild-plugin": "^3.0.0",
"@sentry/browser": "^8.50.0",
"@walletconnect/core": "2.17.3",
"@walletconnect/ethereum-provider": "2.17.3",
"@walletconnect/keyvaluestorage": "^1.1.1",
"@walletconnect/modal": "2.7.0",
"@walletconnect/sign-client": "2.17.3",
"@walletconnect/universal-provider": "2.17.3",
"@zodiac/chains": "workspace:*",
"@zodiac/env": "workspace:*",
"@zodiac/form-data": "workspace:*",
Expand All @@ -101,11 +84,16 @@
"@zodiac/safe": "workspace:*",
"@zodiac/schema": "workspace:*",
"@zodiac/ui": "workspace:*",
"classnames": "^2.3.1",
"date-fns": "^4.1.0",
"lucide-react": "^0.470.0",
"nanoid": "^5.0.0",
"node-stdlib-browser": "^1.2.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-router": "7.1.3",
"react-stick": "^5.0.6",
"react-toastify": "11.0.3",
"ser-kit": "1.1.0",
"zod": "^3.23.8"
}
}
2 changes: 1 addition & 1 deletion deployables/extension/src/panel/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import { ProvideConnectProvider, ProvideInjectedWallet } from '@/providers'
import { sentry } from '@/sentry'
import { invariant } from '@epic-web/invariant'
import { ToastContainer } from '@zodiac/ui'
import { StrictMode, useEffect } from 'react'
import { createRoot } from 'react-dom/client'
import { createHashRouter, RouterProvider } from 'react-router'
import { ToastContainer } from 'react-toastify'
import '../global.css'
import { pages } from './pages'
import { ProvidePort } from './port-handling'
Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions deployables/extension/src/panel/integrations/zodiac/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@ export {
MULTISEND,
MULTISEND_CALL_ONLY,
SupportedZodiacModuleType,
queryRolesV2MultiSend,
} from '@zodiac/modules'
export type { ZodiacModule } from '@zodiac/modules'
export { fetchZodiacModules } from './fetchZodiacModules'
export { queryRolesV1MultiSend } from './rolesMultisend'

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
} from '@/providers'
import { ProvideProvider } from '@/providers-ui'
import { formData, getString } from '@/utils'
import { ZERO_ADDRESS } from '@zodiac/chains'
import { updatePilotAddress } from '@zodiac/modules'
import {
Outlet,
redirect,
Expand All @@ -20,10 +22,6 @@ import {
type LoaderFunctionArgs,
} from 'react-router'
import { saveStorageEntry } from '../../utils/saveStorageEntry'
import {
asLegacyConnection,
fromLegacyConnection,
} from '../legacyConnectionMigrations'
import { getActiveRouteId } from './getActiveRouteId'
import { Intent } from './intents'

Expand Down Expand Up @@ -51,12 +49,7 @@ export const action = async ({ request, params }: ActionFunctionArgs) => {
const routeId = getActiveRouteId(params)
const route = await getRoute(routeId)

await saveRoute(
fromLegacyConnection({
...asLegacyConnection(route),
pilotAddress: '',
}),
)
await saveRoute(updatePilotAddress(route, ZERO_ADDRESS))

return null
}
Expand Down
Loading

0 comments on commit ec132e9

Please sign in to comment.