-
Notifications
You must be signed in to change notification settings - Fork 97
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(viem): Adding standby tx after sending #4443
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4443 +/- ##
==========================================
- Coverage 85.20% 85.19% -0.02%
==========================================
Files 712 712
Lines 26587 26596 +9
Branches 3624 3627 +3
==========================================
+ Hits 22653 22658 +5
- Misses 3871 3875 +4
Partials 63 63
... and 1 file with indirect coverage changes Continue to review 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.
this seems good to me, would be good to get @jeanregisser 's eyes on this too. last time i missed some details in #4395 🙈
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.
Thanks!
I'm slightly confused by the example video because it shows the swap flow, but right now it doesn't use src/viem/saga.ts
, which was changed in this PR.
Did I miss something?
|
||
const addPendingStandbyTransaction = function* (hash: string) { |
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 theory the addStandbyTransaction
action could be called mutliple times, because it's wrapped in
wallet/src/transactions/send.ts
Line 272 in ec4623e
for (let i = 1; i <= TX_NUM_TRIES; i++) { |
However, right now this TX_NUM_TRIES
is set to 1.
I think just to be safe, we should update the reducer to replace any standby TX which has the same hash or context id.
wallet/src/transactions/reducer.ts
Lines 72 to 83 in b99b375
case Actions.ADD_STANDBY_TRANSACTION: | |
return { | |
...state, | |
standbyTransactions: [ | |
{ | |
...action.transaction, | |
timestamp: Date.now(), | |
status: TransactionStatus.Pending, | |
}, | |
...(state.standbyTransactions || []), | |
], | |
} |
What do you think?
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.
Sounds good!
@jeanregisser Sorry, you are right, I have reused the video that I created when I was testing the swap flow. But this PR doesn't change that flow. I'll update the video to show the send flow (similar to what I have shown in the demo). |
@jeanregisser I added the logic in the reducer as you suggested, I'm leaving the PR open in case you want to check that logic. Otherwise, I'm gonna merge this at EOD. |
Description
Adding the standby transaction only after the transaction has been sent to the blockchain in the viem flow.
Test plan
Run locally in a emulator and unit tests
Related issues
Simulator.Screen.Recording.-.iPhone.SE.3rd.generation.-.2023-11-14.at.05.49.05.mp4