-
Notifications
You must be signed in to change notification settings - Fork 985
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: support sending multi collectibles #20045
Changes from all commits
16d09b5
75d9dd9
b080936
42bada9
d710a87
4c81703
6688a89
6a4cfc2
4dacc9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
(ns status-im.contexts.wallet.send.flow-config) | ||
(ns status-im.contexts.wallet.send.flow-config | ||
(:require | ||
[status-im.contexts.wallet.send.utils :as send-utils])) | ||
|
||
(defn- collectible-selected? | ||
[db] | ||
(let [collectible-stored (-> db :wallet :ui :send :collectible) | ||
tx-type (-> db :wallet :ui :send :tx-type)] | ||
(and (some? collectible-stored) | ||
(= tx-type :collectible)))) | ||
(send-utils/tx-type-collectible? tx-type)))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you checking for collectible tx type that way.. you seem to be checking for
if it contains There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The So a simple cc: @ulisesmac There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Totally makes sense for me now. |
||
|
||
(defn- token-selected? | ||
[db] | ||
|
@@ -19,7 +21,8 @@ | |
{:screen-id :screen/wallet.select-asset | ||
:skip-step? (fn [db] (or (token-selected? db) (collectible-selected? db)))} | ||
{:screen-id :screen/wallet.send-input-amount | ||
:skip-step? (fn [db] (= (get-in db [:wallet :ui :send :tx-type]) :collectible))} | ||
:skip-step? (fn [db] | ||
(send-utils/tx-type-collectible? (get-in db [:wallet :ui :send :tx-type])))} | ||
{:screen-id :screen/wallet.select-collectible-amount | ||
:skip-step? (fn [db] | ||
(or (not (collectible-selected? db)) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -208,3 +208,11 @@ | |
:position-diff position-diff}))) | ||
[] | ||
route)) | ||
|
||
(def ^:private collectible-tx-set | ||
#{:tx/collectible-erc-721 | ||
:tx/collectible-erc-1155}) | ||
|
||
(defn tx-type-collectible? | ||
[tx-type] | ||
(contains? collectible-tx-set tx-type)) | ||
Comment on lines
+216
to
+218
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need |
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.
I haven't reviewed PRs that evolved this
send.events
namespace, but the fact that it has zero coverage is not good. This namespace is not trivial and I'd normally reject as a reviewer. The re-frame architecture was built to help make this layer testable and it's the top-priority recommended by re-frame to test https://github.com/day8/re-frame/blob/5bd82b3d6625af1fac2b21ba0cd5bab448e44ffe/docs/Testing.md#what-to-test.I know it's not a tech debt from your PR and at this stage it might be too much work to
attachattack this debt. But, it's never too late to play the boy scout ruleAlways leave your code cleaner than you found it
.Perhaps something you guys could figure out in future changes to this
events
namespace.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 @ilmotta I'll consider it for new PRs :)
cc: @status-im/wallet-mobile-devs