-
Notifications
You must be signed in to change notification settings - Fork 465
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: rm circular dependency #4697
Conversation
Branch preview✅ Deploy successful! Website: Storybook: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review by ChatGPT
@@ -6,7 +6,7 @@ import useSafeInfo from '@/hooks/useSafeInfo' | |||
import { getExplorerLink } from '@/utils/gateway' | |||
import ErrorMessage from '../ErrorMessage' | |||
import { isValidMasterCopy } from '@/services/contracts/safeContracts' | |||
import { extractMigrationL2MasterCopyAddress } from '@/utils/safe-migrations' | |||
import { extractMigrationL2MasterCopyAddress } from '@/features/multichain/utils/extract-migration-data' | |||
|
|||
const UnknownContractError = ({ txData }: { txData: TransactionData | undefined }): ReactElement | null => { | |||
const { safe, safeAddress } = useSafeInfo() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unknown contract plea,
Master copy swapped with ease,
Paths diverge with glee.
@@ -3,7 +3,7 @@ import { Alert, AlertTitle, Box, SvgIcon, Typography } from '@mui/material' | |||
import type { TransactionData } from '@safe-global/safe-gateway-typescript-sdk' | |||
import InfoOutlinedIcon from '@/public/images/notifications/info.svg' | |||
import NamedAddressInfo from '@/components/common/NamedAddressInfo' | |||
import { extractMigrationL2MasterCopyAddress } from '@/utils/safe-migrations' | |||
import { extractMigrationL2MasterCopyAddress } from '@/features/multichain/utils/extract-migration-data' | |||
|
|||
export const MigrateToL2Information = ({ | |||
variant, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In folder of code,
Paths diverge like crossroads now,
Functions find new homes.
} | ||
|
||
return undefined | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migration happens,
MultiSend decodes the truth—
L2 awaits you.
@@ -4,7 +4,8 @@ import { | |||
type TransactionData, | |||
} from '@safe-global/safe-gateway-typescript-sdk' | |||
import { OperationType } from '@safe-global/safe-core-sdk-types' | |||
import { extractMigrationL2MasterCopyAddress, prependSafeToL2Migration } from '../safe-migrations' | |||
import { prependSafeToL2Migration } from '../safe-migrations' | |||
import { extractMigrationL2MasterCopyAddress } from '@/features/multichain/utils/extract-migration-data' | |||
import { extendedSafeInfoBuilder } from '@/tests/builders/safe' | |||
import { chainBuilder } from '@/tests/builders/chains' | |||
import { safeSignatureBuilder, safeTxBuilder, safeTxDataBuilder } from '@/tests/builders/safeTx' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imports rearranged,
Functions find their new homes now,
Code change journey starts.
|
||
return undefined | ||
} | ||
|
||
export const createUpdateMigration = (chain: ChainInfo): MetaTransactionData => { | ||
const interfce = Safe_migration__factory.createInterface() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Transaction code
trims excess with great delight—
less is always more.
@@ -69,7 +69,7 @@ import { isMultiSendCalldata } from './transaction-calldata' | |||
import { decodeMultiSendData } from '@safe-global/protocol-kit/dist/src/utils' | |||
import { OperationType } from '@safe-global/safe-core-sdk-types' | |||
import { LATEST_SAFE_VERSION } from '@/config/constants' | |||
import { extractMigrationL2MasterCopyAddress } from './safe-migrations' | |||
import { extractMigrationL2MasterCopyAddress } from '@/features/multichain/utils/extract-migration-data' | |||
|
|||
export const isTxQueued = (value: TransactionStatus): boolean => { | |||
return [TransactionStatus.AWAITING_CONFIRMATIONS, TransactionStatus.AWAITING_EXECUTION].includes(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A path changes course,
Multichain utils emerge,
Code dances anew.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
📦 Next.js Bundle Analysis for safe-wallet-webThis analysis was generated by the Next.js Bundle Analysis action. 🤖
|
Page | Size (compressed) |
---|---|
global |
1012.62 KB (🟡 +154 B) |
Details
The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
Coverage report
Show new covered files 🐣
Test suite run success1752 tests passing in 237 suites. Report generated by 🧪jest coverage report action from 073ee15 |
What it solves
#4645 introduced a circular dependency: transaction-guards imported something from safe-migration utils which indirectly imports transaction-guards.
I've extracted the common part into a separate module.