-
Notifications
You must be signed in to change notification settings - Fork 32
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
Fe/move pending bridge transactions #1546
Conversation
…ctions` and `fallbackQueryHistoricalTransactions`
WalkthroughThe changes involve a significant refactoring of the codebase related to managing pending bridge transactions and the reorganization of code within the Changes
Poem
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (11)
- packages/synapse-interface/components/Portfolio/Activity.tsx (3 hunks)
- packages/synapse-interface/components/Portfolio/Transaction/MostRecentTransaction.tsx (3 hunks)
- packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (1 hunks)
- packages/synapse-interface/pages/state-managed-bridge/index.tsx (2 hunks)
- packages/synapse-interface/slices/bridge/actions.ts (1 hunks)
- packages/synapse-interface/slices/bridge/reducer.ts (4 hunks)
- packages/synapse-interface/slices/portfolio/updater.tsx (1 hunks)
- packages/synapse-interface/slices/transactions/actions.ts (1 hunks)
- packages/synapse-interface/slices/transactions/reducer.ts (6 hunks)
- packages/synapse-interface/slices/transactions/updater.tsx (4 hunks)
- packages/synapse-interface/store/reducer.ts (1 hunks)
Additional comments: 31
packages/synapse-interface/slices/bridge/actions.ts (1)
- 1-12: The removal of
PendingBridgeTransaction
interface and related actions is consistent with the pull request summary. The addition ofresetBridgeInputs
andresetFetchedBridgeQuotes
actions seems to be new functionality. Ensure that these actions are dispatched appropriately in the application.packages/synapse-interface/slices/transactions/actions.ts (2)
1-18: The
PendingBridgeTransaction
interface has been added. Ensure that all properties are correctly used and updated in the application.20-33: New actions related to
PendingBridgeTransaction
have been added. Make sure these actions are dispatched and handled correctly in the corresponding reducer.packages/synapse-interface/slices/portfolio/updater.tsx (1)
- 1-18: The changes in the imports and the use of
useTransactionsState
instead ofuseBridgeState
are consistent with the pull request summary. Ensure that all instances ofuseBridgeState
have been replaced withuseTransactionsState
throughout the codebase.packages/synapse-interface/components/Portfolio/Transaction/MostRecentTransaction.tsx (3)
1-11: The import statements have been updated to reflect the changes in the state management. The
useBridgeState
hook has been replaced withuseTransactionsState
and thependingBridgeTransactions
is now being fetched fromTransactionsState
instead ofBridgeState
.16-21: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [16-28]
The
useTransactionsState
hook is now being used to fetch thependingBridgeTransactions
state. This is a significant change as it moves the responsibility of managing thependingBridgeTransactions
state from thebridge
slice to thetransactions
slice.
- 27-27: Ensure that all references to
pendingBridgeTransactions
throughout the codebase have been updated to fetch fromTransactionsState
instead ofBridgeState
.packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (1)
- 5-11: The import statements have been updated to reflect the new location of the
removePendingBridgeTransaction
andupdatePendingBridgeTransaction
functions. Ensure that these functions are correctly implemented in the new location and that all references to these functions in the codebase have been updated.packages/synapse-interface/components/Portfolio/Activity.tsx (3)
9-15: The import statements have been updated to reflect the new location of
PendingBridgeTransaction
. This is a good change as it keeps the codebase consistent with the new structure.25-29: The
useTransactionsState
hook is now being used to fetchpendingBridgeTransactions
. This is a good change as it aligns with the new structure of the Redux store.326-333: The
PendingTransactionAwaitingIndexing
component now retrievespendingBridgeTransactions
fromuseTransactionsState
instead ofuseBridgeState
. This is a good change as it aligns with the new structure of the Redux store.packages/synapse-interface/slices/transactions/updater.tsx (5)
1-3: Imports are well organized and only necessary packages are imported.
15-37: The import statements are well organized and only necessary packages are imported.
39-40: The
queryHistoricalTime
andqueryPendingTime
assignments are correct and follow best practices.50-54: The destructuring of variables from
useTransactionsState()
is correct and follows best practices.168-174: The
matchingTransactionHashes
filter logic is correct and follows best practices.packages/synapse-interface/store/reducer.ts (3)
20-23: The
bridge
slice is removed frompersistedReducers
. Ensure that this change is intentional and that thebridge
slice does not need to be persisted in local storage.28-32: The
persistConfig
version is updated from 0 to 1. This will reset the client-side storage and prevent errors due to outdated data structures. Make sure that this is communicated to users, as it may result in loss of local data.34-38: The
bridge
slice is added to theappReducer
. Ensure that all necessary actions and reducers related to thebridge
slice are properly handled in theappReducer
.packages/synapse-interface/pages/state-managed-bridge/index.tsx (3)
56-74: The imports related to fetching token balances and allowances, and bridge transaction actions have been removed. Ensure that these functionalities are handled elsewhere in the codebase.
75-76: The
StateManagedBridge
component has been reorganized. Ensure that the new organization of the code does not affect the functionality of the component.97-103: The
useBridgeState
hook has been replaced withuseTransactionsState
to fetchpendingBridgeTransactions
. Ensure that theuseTransactionsState
hook is defined and correctly fetches thependingBridgeTransactions
.packages/synapse-interface/slices/bridge/reducer.ts (4)
13-19: The removal of these imports indicates that the corresponding actions are no longer being used in this file. Ensure that these actions are not required elsewhere in the codebase or that they have been appropriately replaced.
42-45: The
BridgeState
interface no longer includespendingBridgeTransactions
. Ensure that this change does not break any functionality that relies on this property.79-82: The
initialState
no longer includespendingBridgeTransactions
. This change should be safe as long as all references topendingBridgeTransactions
in the codebase have been updated accordingly.474-479: The
resetBridgeInputs
action no longer resetspendingBridgeTransactions
. Ensure that this change does not break any functionality that relies on this action resettingpendingBridgeTransactions
.packages/synapse-interface/slices/transactions/reducer.ts (5)
1-11: The import statements are well organized and clear. The new actions related to
PendingBridgeTransaction
are imported correctly.31-34: The
TransactionsState
interface is updated to includependingBridgeTransactions
which is an array ofPendingBridgeTransaction
. This is a good way to track the state of pending bridge transactions.43-49: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [37-47]
The
initialState
of theTransactionsState
is correctly initialized withpendingBridgeTransactions
as an empty array.
52-105: The
extraReducers
section of thetransactionsSlice
is updated to handle the new actions related toPendingBridgeTransaction
. The logic in these handlers seems correct and they should correctly update the state ofpendingBridgeTransactions
.226-232: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [226-243]
The
resetTransactionsState
action correctly resetspendingBridgeTransactions
to its initial state. This is a good practice to ensure the state is correctly reset when needed.
Deploying with Cloudflare Pages
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1546 +/- ##
=============================================
Coverage 51.23324% 51.23324%
=============================================
Files 362 362
Lines 24691 24691
Branches 283 283
=============================================
Hits 12650 12650
Misses 10813 10813
Partials 1228 1228
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- packages/synapse-interface/slices/transactions/actions.ts (1 hunks)
Additional comments: 5
packages/synapse-interface/slices/transactions/actions.ts (5)
6-18: The
PendingBridgeTransaction
interface is well defined and covers all necessary fields for a pending bridge transaction. Ensure that the types used (Chain
,Token
) are correctly defined and imported.20-23: The
addPendingBridgeTransaction
action is correctly defined and uses thePendingBridgeTransaction
interface as its payload.24-29: The
updatePendingBridgeTransaction
action is correctly defined. Ensure that all fields in the payload are correctly used in the reducer.30-32: The
removePendingBridgeTransaction
action is correctly defined and uses the transaction id as its payload.33-35: The
updatePendingBridgeTransactions
action is correctly defined and uses an array ofPendingBridgeTransaction
as its payload. Ensure that this action is correctly handled in the reducer.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- packages/synapse-interface/components/Portfolio/Portfolio.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
- packages/synapse-interface/components/Portfolio/Portfolio.tsx
Moving
pendingBridgeTransactions
state and related actions/reducers frombridge
totransactions
sliceRemove
bridge
slice frompersistedReducers
, only trackapplication
andtransactions
in local storageUpgrade redux persist version to reset client side storage to prevent errors
Summary by CodeRabbit
persistConfig
version to reset cache and fix data structure errors.7203a92a48330af13bc5c8a4114451029a8ec212: synapse-interface preview link
f560cb2788268c92168f9568f12ee3b9248ea22e: synapse-interface preview link
c667e2f5d51853ab1987efcf5d980b79255aec54: synapse-interface preview link