Skip to content
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

feat: wallet router v2 #20631

Merged
merged 23 commits into from
Jul 26, 2024
Merged

feat: wallet router v2 #20631

merged 23 commits into from
Jul 26, 2024

Conversation

BalogunofAfrica
Copy link
Contributor

@BalogunofAfrica BalogunofAfrica commented Jul 2, 2024

fixes #20575

Summary

Integrates the new routes suggestion API implemented on status-go here status-im/status-go#5426 and integrated on desktop here status-im/status-desktop#15344.

We now make use of the async endpoint and receive the suggestions as signals. The request of the old router is mapped onto the new one, and the response of the new router is mapped onto the old one, specifically the path array(s) which is what we get in both the Best and Candidates fields.

Simulator.Screen.Recording.-.iPhone.11.Pro.-.2024-07-03.at.00.02.41.mp4

Documentation change PR (review please): https://github.com/status-im/status.im/pull/xxx

Review notes

Testing notes

Platforms

  • Android
  • iOS

Areas that maybe impacted

Functional
  • wallet / transactions

Steps to test

  • from wallet account, click on send
  • enter an address to send to
  • select an asset with a non zero balance
  • input amount and wait for the suggestions from the router

Before and after screenshots comparison

UI behaviour remains the same
status: ready

  • Specify potentially impacted user flows in _Areas that maybe impacted*.:
    Wallet send flow
  • Ensure that Steps to test is filled in.:
    Done

Risk

Described potential risks and worst case scenarios.

Tick one:

  • Low risk: 2 devs MUST perform testing as specified above and attach their results as comments to this PR before merging.
  • High risk: QA team MUST perform additional testing in the specified affected areas before merging.

@@ -24,79 +24,76 @@
{:db (assoc-in db [:wallet :ui :send :select-address-tab] tab)}))

(rf/reg-event-fx :wallet/suggested-routes-success
(fn [{:keys [db]} [suggested-routes timestamp]]
(when (= (get-in db [:wallet :ui :send :suggested-routes-call-timestamp]) timestamp)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check was removed because the call to the endpoint and where it is successfully (signals) handled has changed

Copy link
Contributor Author

@BalogunofAfrica BalogunofAfrica Jul 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The asynchronous endpoint would override the current call if called again while the request is pending.

So, I don't think this timestamp check is useful in this context

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this asynchronous code. Should we still debounce the calls, since the async code on status go uses a queue to resolve this and current running requests are overridden till there is a result.

cc: @J-Son89

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@briansztamfater, @vkjr probably know better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The asynchronous endpoint would override the current call if called again while the request is pending.

So, I don't think this timestamp check is useful in this context

I think we can remove this check 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about the debounce, do you think it is safe to remove? cc: @briansztamfater @vkjr

Copy link
Contributor

@vkjr vkjr Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BalogunofAfrica, I think we should leave it. The debounce is there to prevent sending multiple events when user changes something on token input screen, for example when user types in the amount to send. We do not want to invoke routes recalculation on each change, only when user stopped for a bit)
Even if it is resolved on status-go side, we don't have to rely on that implementation, it can change one day without us knowing and we will get unexpected performance issue)

:error error
:params params}))}]})))

(rf/reg-event-fx :wallet/stop-get-suggested-routes
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still haven't figured out where this would be useful

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still haven't figured out where this would be useful

You used this event on unmount if I'm not mistaken. That seems good to me because it avoids needless computation of processing a signal that's not needed anymore.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have :wallet/stop-get-suggested-routes, wdyt of refactoring the other event to :wallet/start-get-suggested-routes for consistency?

@status-im-auto
Copy link
Member

status-im-auto commented Jul 2, 2024

Jenkins Builds

Click to see older builds (102)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 09df89e #1 2024-07-02 23:09:23 ~4 min tests 📄log
✔️ 09df89e #1 2024-07-02 23:12:44 ~8 min android-e2e 🤖apk 📲
✔️ 09df89e #1 2024-07-02 23:13:51 ~9 min android 🤖apk 📲
✔️ 09df89e #1 2024-07-02 23:14:53 ~10 min ios 📱ipa 📲
✔️ b6a0d39 #2 2024-07-02 23:28:03 ~3 min tests 📄log
✔️ b6a0d39 #2 2024-07-02 23:31:26 ~7 min android-e2e 🤖apk 📲
✔️ b6a0d39 #2 2024-07-02 23:31:32 ~7 min android 🤖apk 📲
✔️ b6a0d39 #2 2024-07-02 23:33:01 ~9 min ios 📱ipa 📲
✔️ 492d326 #3 2024-07-03 11:26:06 ~5 min tests 📄log
✔️ 492d326 #3 2024-07-03 11:29:33 ~8 min android-e2e 🤖apk 📲
✔️ 492d326 #3 2024-07-03 11:29:49 ~9 min android 🤖apk 📲
✔️ 492d326 #3 2024-07-03 11:30:47 ~10 min ios 📱ipa 📲
✔️ 5b76831 #4 2024-07-04 08:20:28 ~4 min tests 📄log
✔️ 5b76831 #4 2024-07-04 08:24:21 ~8 min android-e2e 🤖apk 📲
✔️ 5b76831 #4 2024-07-04 08:25:35 ~9 min android 🤖apk 📲
✔️ 5b76831 #4 2024-07-04 08:26:52 ~10 min ios 📱ipa 📲
a3b8cc0 #5 2024-07-04 12:37:39 ~2 min tests 📄log
✔️ a3b8cc0 #5 2024-07-04 12:42:09 ~7 min android-e2e 🤖apk 📲
✔️ a3b8cc0 #5 2024-07-04 12:42:19 ~7 min android 🤖apk 📲
✔️ a3b8cc0 #5 2024-07-04 12:44:39 ~9 min ios 📱ipa 📲
✔️ 0d33931 #6 2024-07-04 13:44:37 ~3 min tests 📄log
✔️ 0d33931 #6 2024-07-04 13:46:50 ~6 min android-e2e 🤖apk 📲
✔️ 0d33931 #6 2024-07-04 13:49:10 ~8 min android 🤖apk 📲
✔️ 0d33931 #6 2024-07-04 13:49:26 ~8 min ios 📱ipa 📲
✔️ dfccba1 #7 2024-07-04 16:12:36 ~4 min tests 📄log
✔️ dfccba1 #7 2024-07-04 16:15:34 ~7 min android-e2e 🤖apk 📲
✔️ dfccba1 #7 2024-07-04 16:15:37 ~7 min android 🤖apk 📲
✔️ dfccba1 #7 2024-07-04 16:16:58 ~8 min ios 📱ipa 📲
✔️ a613d43 #8 2024-07-05 11:17:29 ~4 min tests 📄log
✔️ a613d43 #8 2024-07-05 11:19:25 ~6 min android-e2e 🤖apk 📲
✔️ a613d43 #8 2024-07-05 11:20:29 ~7 min android 🤖apk 📲
✔️ a613d43 #8 2024-07-05 11:22:13 ~9 min ios 📱ipa 📲
✔️ e43c5fb #9 2024-07-08 10:39:28 ~4 min tests 📄log
✔️ e43c5fb #9 2024-07-08 10:40:43 ~6 min android 🤖apk 📲
✔️ e43c5fb #9 2024-07-08 10:42:09 ~7 min android-e2e 🤖apk 📲
✔️ e43c5fb #9 2024-07-08 10:43:33 ~8 min ios 📱ipa 📲
✔️ 02940ea #10 2024-07-11 11:08:14 ~4 min tests 📄log
✔️ 02940ea #10 2024-07-11 11:11:36 ~7 min android-e2e 🤖apk 📲
✔️ 02940ea #10 2024-07-11 11:12:05 ~8 min android 🤖apk 📲
✔️ 02940ea #10 2024-07-11 11:13:15 ~9 min ios 📱ipa 📲
✔️ 66547d0 #11 2024-07-12 18:13:06 ~4 min tests 📄log
✔️ 66547d0 #11 2024-07-12 18:15:14 ~6 min android-e2e 🤖apk 📲
✔️ 66547d0 #11 2024-07-12 18:15:45 ~6 min android 🤖apk 📲
✔️ 66547d0 #11 2024-07-12 18:17:50 ~9 min ios 📱ipa 📲
✔️ 8cdf883 #12 2024-07-15 10:30:59 ~5 min tests 📄log
✔️ 8cdf883 #12 2024-07-15 10:34:24 ~9 min android 🤖apk 📲
✔️ 8cdf883 #12 2024-07-15 10:34:28 ~9 min android-e2e 🤖apk 📲
✔️ 8cdf883 #12 2024-07-15 10:36:19 ~11 min ios 📱ipa 📲
214cd84 #13 2024-07-16 10:15:46 ~2 min ios 📄log
214cd84 #13 2024-07-16 10:15:54 ~2 min tests 📄log
✔️ 214cd84 #13 2024-07-16 10:19:18 ~6 min android 🤖apk 📲
✔️ 214cd84 #13 2024-07-16 10:19:34 ~6 min android-e2e 🤖apk 📲
7dc2204 #14 2024-07-18 09:56:18 ~2 min ios 📄log
7dc2204 #14 2024-07-18 09:56:24 ~2 min tests 📄log
✔️ 7dc2204 #14 2024-07-18 10:00:41 ~7 min android-e2e 🤖apk 📲
✔️ 7dc2204 #14 2024-07-18 10:01:24 ~7 min android 🤖apk 📲
7dc2204 #15 2024-07-18 10:13:20 ~6 min ios 📄log
7dc2204 #16 2024-07-18 10:28:37 ~6 min ios 📄log
0e67fac #15 2024-07-18 11:07:52 ~2 min tests 📄log
✔️ 0e67fac #15 2024-07-18 11:11:07 ~6 min android-e2e 🤖apk 📲
✔️ 0e67fac #15 2024-07-18 11:13:09 ~8 min android 🤖apk 📲
✔️ 0e67fac #17 2024-07-18 11:14:39 ~9 min ios 📱ipa 📲
✔️ 0e67fac #18 2024-07-18 11:32:05 ~9 min ios 📱ipa 📲
7250587 #16 2024-07-18 11:51:31 ~2 min tests 📄log
✔️ 7250587 #16 2024-07-18 11:55:48 ~7 min android-e2e 🤖apk 📲
✔️ 7250587 #16 2024-07-18 11:56:09 ~7 min android 🤖apk 📲
✔️ 7250587 #19 2024-07-18 11:58:31 ~9 min ios 📱ipa 📲
✔️ 9ebdcff #17 2024-07-22 09:02:57 ~6 min android 🤖apk 📲
✔️ 9ebdcff #17 2024-07-22 09:04:21 ~7 min android-e2e 🤖apk 📲
✔️ 9ebdcff #20 2024-07-22 09:05:34 ~9 min ios 📱ipa 📲
✔️ 0dbc750 #21 2024-07-23 16:51:52 ~9 min ios 📱ipa 📲
✔️ 0dbc750 #18 2024-07-23 16:55:10 ~12 min android 🤖apk 📲
0dbc750 #18 2024-07-23 16:57:26 ~14 min tests 📄log
✔️ 0dbc750 #18 2024-07-23 17:00:51 ~18 min android-e2e 🤖apk 📲
f74720f #19 2024-07-24 02:10:51 ~2 min tests 📄log
✔️ f74720f #19 2024-07-24 02:16:33 ~8 min android-e2e 🤖apk 📲
✔️ f74720f #19 2024-07-24 02:16:45 ~8 min android 🤖apk 📲
✔️ f74720f #22 2024-07-24 02:17:56 ~9 min ios 📱ipa 📲
4dc336c #20 2024-07-24 14:01:15 ~3 min tests 📄log
✔️ 4dc336c #20 2024-07-24 14:05:05 ~6 min android-e2e 🤖apk 📲
✔️ 4dc336c #20 2024-07-24 14:05:33 ~7 min android 🤖apk 📲
✔️ 4dc336c #23 2024-07-24 14:08:27 ~10 min ios 📱ipa 📲
✔️ e357526 #21 2024-07-24 15:43:27 ~4 min tests 📄log
✔️ e357526 #21 2024-07-24 15:45:34 ~6 min android 🤖apk 📲
✔️ e357526 #21 2024-07-24 15:45:51 ~6 min android-e2e 🤖apk 📲
✔️ e357526 #24 2024-07-24 15:48:23 ~9 min ios 📱ipa 📲
✔️ bdfeeab #22 2024-07-24 15:58:05 ~5 min tests 📄log
✔️ bdfeeab #22 2024-07-24 16:00:15 ~7 min android 🤖apk 📲
✔️ bdfeeab #22 2024-07-24 16:01:03 ~8 min android-e2e 🤖apk 📲
✔️ bdfeeab #25 2024-07-24 16:03:39 ~11 min ios 📱ipa 📲
✔️ 703ce63 #23 2024-07-25 09:01:11 ~4 min tests 📄log
✔️ 703ce63 #23 2024-07-25 09:04:28 ~7 min android-e2e 🤖apk 📲
✔️ 703ce63 #23 2024-07-25 09:05:42 ~9 min android 🤖apk 📲
✔️ 703ce63 #26 2024-07-25 09:06:54 ~10 min ios 📱ipa 📲
✔️ 71e1bbe #24 2024-07-25 13:20:09 ~4 min tests 📄log
✔️ 71e1bbe #24 2024-07-25 13:22:01 ~6 min android-e2e 🤖apk 📲
✔️ 71e1bbe #24 2024-07-25 13:24:10 ~8 min android 🤖apk 📲
71e1bbe #27 2024-07-25 13:27:07 ~11 min ios 📄log
✔️ 3918143 #25 2024-07-25 15:11:32 ~4 min tests 📄log
✔️ 3918143 #25 2024-07-25 15:13:36 ~6 min android-e2e 🤖apk 📲
✔️ 3918143 #25 2024-07-25 15:14:18 ~7 min android 🤖apk 📲
3918143 #28 2024-07-25 15:17:33 ~10 min ios 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 6c5ce99 #26 2024-07-26 09:07:06 ~4 min tests 📄log
✔️ 6c5ce99 #26 2024-07-26 09:08:38 ~6 min android-e2e 🤖apk 📲
✔️ 6c5ce99 #26 2024-07-26 09:10:56 ~8 min android 🤖apk 📲
✔️ 6c5ce99 #29 2024-07-26 09:23:36 ~21 min ios 📱ipa 📲
✔️ 75b31ee #27 2024-07-26 11:10:03 ~4 min tests 📄log
✔️ 75b31ee #27 2024-07-26 11:12:41 ~7 min android-e2e 🤖apk 📲
✔️ 75b31ee #27 2024-07-26 11:13:14 ~7 min android 🤖apk 📲
✔️ 75b31ee #30 2024-07-26 11:22:53 ~17 min ios 📱ipa 📲

{:event :wallet/stop-get-suggested-routes
:error error}))}]}))

(defn- transform-new-to-old-path
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:to (:to-chain new-path)
:bonder-fees bonder-fees
:approval-amount-required (:approval-amount-required new-path)
;; :cost () ;; tbd not used on desktop
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked and we don't seem to use this, same as desktop

token-networks (:networks token)
token-networks-ids (when token-networks (mapv #(:chain-id %) token-networks))
from-network-amounts-by-chain (send-utils/network-amounts-by-chain {:route chosen-route
:token-decimals
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the code is weirdly formatted because it's too right-aligned. One idea is to put the map on the next line after send-utils/network-amounts-by-chain. This will be an improvement because each key pair will be on the same line. Same idea for the other call to send-utils/network-amounts-by-chain.

(send-utils/network-links chosen-route
sender-network-values
receiver-network-values))]
{:db (-> db
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can reduce the amount of repetition in this long chain of assocs.

{:db (update-in db
                [:wallet :ui :send]
                assoc
                :suggested-routes          suggested-routes-data
                :route                     chosen-route
                :from-values-by-chain      from-network-values-for-ui
                :to-values-by-chain        to-network-values-for-ui
                :sender-network-values     sender-network-values
                :receiver-network-values   receiver-network-values
                :network-links             network-links
                :loading-suggested-routes? false)}

This is a safe change, but because this large event has no unit tests, it's worth doing a manual check whenever the event handler is refactored.

(assoc-in [:wallet :ui :send :loading-suggested-routes?] false))}))))
(fn [{:keys [db]} [suggested-routes-data]]
(let [chosen-route (:best suggested-routes-data)
token (get-in db [:wallet :ui :send :token])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are calling get-in on the same nested path many times. This is inefficient. Better is to call get-in once with path [:wallet :ui :send] and destructure.

If you implement this suggestion, you may wonder, like me, what to do with the default values of disabled-from-chain-ids and from-locked-amounts while destructuring. They don't seem to be necessary because in Clojure nil punning is extensively supported on data structures.

  • disabled-from-chain-ids will be used first as in (set disabled-chain-ids). The default value of disabled-from-chain-ids is []. (set []) is equal to (set nil).
  • from-locked-amounts default value is {} and is first used like (get from-locked-amounts chain-id amount), but get on nil is perfectly correct, hence (get nil chain-id amount) will return amount as expected.

native-token? (and token (= token-display-name "ETH"))
routes-available? (pos? (count chosen-route))
token-networks (:networks token)
token-networks-ids (when token-networks (mapv #(:chain-id %) token-networks))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mapv is unnecessary here and possibly in other places in this namespace. Immediately later this value is actually converted to a set. When I read mapv anywhere, I need to think why the developer decided to use the non-lazy version. If there's no technical reason, it becomes a mental overhead because in Clojure we mostly want to use the lazy versions, unless we need the performance characteristics of a vector, for example to access by index efficiently. The lazy versions also play nice when we remove the last collection argument in case we want to use them as transducers.

:disabledToChainIDs disabled-to-chain-ids
:gasFeeMode gas-rates
:fromLockedAmount from-locked-amount}
rest-keys)]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the code is more complicated than it needs to be. rest-keys is unnecessary because you know the keys you need from it and rest-keys is not reused anywhere else. Thus, you could remove the binding rest-keys and add the keys directly to the default map.

params [{:uuid                 (str (random-uuid))
         :sendType             send-type
         :addrFrom             from-address
         :addrTo               to-address
         :amountIn             amount-in
         :amountOut            amount-out
         :tokenID              token-id
         :toTokenID            to-token-id
         :disabledFromChainIDs disabled-from-chain-ids
         :disabledToChainIDs   disabled-to-chain-ids
         :gasFeeMode           gas-rates
         :fromLockedAmount     from-locked-amount
         :username             (:username args)
         :publicKey            (:publicKey args)
         :packID               (:packID args)}]

{:event :wallet/stop-get-suggested-routes
:error error}))}]}))

(defn- transform-new-to-old-path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's conventional to name such a function with an arrow, like new->old-path or new-path->old-path.


(defn- transform-new-to-old-path
[new-path]
(let [unit (-> (get-in new-path [:from-token :symbol])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function could be moved to a data store namespace and unit tested, at least one happy path test.

(defn- transform-new-to-old-path
[new-path]
(let [unit (-> (get-in new-path [:from-token :symbol])
clojure.string/lower-case
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clojure.string has been already imported as string.

:error error
:params params}))}]})))

(rf/reg-event-fx :wallet/stop-get-suggested-routes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still haven't figured out where this would be useful

You used this event on unmount if I'm not mistaken. That seems good to me because it avoids needless computation of processing a signal that's not needed anymore.


(rf/reg-event-fx :wallet/stop-get-suggested-routes
(fn []
{:json-rpc/call [{:method "wallet_stopSuggestedRoutesV2AsyncCalcualtion"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a typo in the word calculation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the mistake is from how the API was named in status-go

https://github.com/status-im/status-go/blob/develop/services/wallet/api.go#L519-L523

:tx/collectible-erc-1155 constants/send-type-erc-1155-transfer
:tx/bridge constants/send-type-bridge
constants/send-type-transfer)
send-type (case transaction-type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is status-go domain, but I am wondering why this parameter is called SendType when some values from this enum specify types of operations that doesn't involve sending (ENSRegister, StickersBuy, Swap, Bridge, etc). IMO, TransactionType is still a better name.

Comment on lines 489 to 493
convert-to-gwei #(-> %
money/wei->gwei
(money/with-precision 6)
(str))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move this to a utils file?

{:json-rpc/call [{:method "wallet_stopSuggestedRoutesV2AsyncCalcualtion"
:params []
:on-success (fn []
(rf/dispatch [:wallet/clean-routes-calculation]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we need to rely on status-go call result to clean our local re-frame db? Or there is a reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The endpoint is there to stop the asynchronous calculation from status-go so we do not get new signals with suggested routes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I think that we can call :wallet/clean-routes-calculation independently because it cleans up our local re-frame db and we'd better do it anyway, even if stopSuggestedRoutes return error, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

@BalogunofAfrica BalogunofAfrica force-pushed the feat/router-v2 branch 2 times, most recently from 0d33931 to dfccba1 Compare July 4, 2024 16:07
[n]
(-> n
money/wei->gwei
(money/with-precision 6)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this 6 coming from? Should it be defined in a constant?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or I'd suggest to have a precision as an argument

@BalogunofAfrica BalogunofAfrica merged commit 2e9fa22 into develop Jul 26, 2024
5 checks passed
@BalogunofAfrica BalogunofAfrica deleted the feat/router-v2 branch July 26, 2024 11:23
ilmotta pushed a commit that referenced this pull request Jul 28, 2024
status-im/status-go@2bbdb35...2bbdb35

* add v2 method

* rename v2 to get-suggested-route

* remove timestamp check on success

* handle async signal for suggestion

* fix stop get suggested routes

* address feedback

* rename get-suggest-route

* prefer lazy seq

* fix formatting

* update suggested routes success

* refactor get-in calls in start-get-suggested-routes

* move transformations to data store

* clean suggested routes immediately

* fix lint

* pass precision as ar

* change test name

* fix big number division error (issues 1,2)

* only trigger router fetch when there address (to/from)

* check response data for error response when routes received via signal

* update status-go

* fix: test failure

* update status go

* handle error message for generic errors
ilmotta added a commit that referenced this pull request Jul 30, 2024
Revisions from develop:

- 59ceddb develop origin/develop fix(wallet): fix bridge transactions (#20902)
- 99ccbc3 Cover wallet send events with tests Part 2 #20411 #20533 (#20721)
- 8c2d539 Enabling WalletConnect feature flag (#20906)
- 67c83b1 fix(wallet): remove edit routes button in bridging (#20874)
- 11a84ba feat(wallet): disable complex routing (#20901)
- 1f5bb57 chore(wallet): disable bridging on unsupported tokens (#20846)
- 4586f80 Add toggle in advanced settings for mobile data
- 55c620e fix: create password for small screen (#20645)
- 525609f Wallet Activity: transactions are not sorted by time #20808 (#20862)
- 9065395 chore(settings): Disable telemetry option (#20881)
- d27ab75 fix_:display group message using the new ui (#20787)
- c6a1db6 ci: enable split apks & build only for arm64-v8a (#20683)
- 73777e0 Ensure keycard account can send transaction after upgrading from v1 to v2 #20552 (#20845)
- a6d3fc3 [#20524] fix: the missed keypairs are shown in the key pair list screen (#20888)
- a671c70 fix broken screen and navigation when syncing fails (#20887)
- a45991b 🥅 Filter connected dapps based on testnet mode, reject proposals and requests gracefully (#20799)
- 2e9fa22 feat: wallet router v2 (#20631)
- 737d8c4 rename sub to fix error when requesting to join community (#20868)
- 3aa7e10 Sync process is blocked on Enabled notifications screen (#20883)
- c1d2d44 perf: Fix app freeze after login (#20729)
- 0fed811 e2e: updated testnet switching and added one test into smoke
- 53c35cb fix(wallet): Linear gradient exception on invalid colors for watched account cards (#20854)
- be82365 chore(settings)_: Remove testnet toggle from legacy advanced settings (#20875)
- eae8a65 feat(wallet)_: Add beta info box in activity tab (#20873)
- fe54a25 fix: not clearing network & web3-wallet on logout (#20886)
- 15a4219 Reject wallet-connect request by dragging the modal down (#20763) (#20836)
- 2ffbdac WalletConnect show expired toast (#20857)
- 402eb83 fix Issue with scrolling WalletConnect transaction on Android (#20867)
- ff88049 Fix WalletConnect header alignment on Android (#20860)
- cee2124 WalletConnect no internet edge-cases (#20826)
- 60ad7c8 chore(tests): New match-strict? cljs.test directive (#20825)
- 4989c92 fix_: Adding own address as saved addresses (#20839)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: DONE
Development

Successfully merging this pull request may close these issues.

Wallet: Update Router to new endponit