-
Notifications
You must be signed in to change notification settings - Fork 42
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
Do not show actions for untrusted regulated assets #194
Conversation
quietbits
commented
Jun 24, 2021
•
edited
Loading
edited
Preview is available here: |
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.
PR looks good! I just have a question below
if (isUntrusted && asset.supportedActions?.sep8) { | ||
return null; | ||
} |
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.
Do we want the SEPs to be available before adding a trustline to a non-regulated asset?
I'm wondering if this change is desired only for regulated assets or if for all assets.
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.
There are some SEPs that can work without a trustline (it is created during deposit, for example). If SEP-8 is not supported for that asset, we would show everything as it was before.
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.
Ok, got it. Now I can see SEP-6 and SEP-24 actions are supported when there's no trustline: https://stellar-demo-wallet-pr194.previews.kube001.services.stellar-ops.com/account?secretKey=SCIAIFDX7QYORHOWZNNU24DXQXTNP2AABHGNRJ5WPZ6AC6VXXR3VCTHT&untrustedAssets=MULT%3AGDLD3SOLYJTBEAK5IU4LDS44UMBND262IXPJB3LDHXOZ3S2QQRD5FSMM
I think this behaviour should remain the same across SEP-8 and non-SEP-8 assets. There could be an anchor implementing SEP-6, SEP-24 and SEP-8 for the same asset. If that's the case, we should still show the dropdown with SEP-6 and SEP-24 for that asset even if that's a regulated asset (SEP-8), right?
I think the only change we need is to add the !isUntrusted &&
condition before rendering the SEP-8 send
option, i.e. update:
{asset.supportedActions?.sep8 && (
<option value={AssetActionId.SEP8_SEND_PAYMENT}>
SEP-8 Send
</option>
)}
to
{!isUntrusted && asset.supportedActions?.sep8 && (
<option value={AssetActionId.SEP8_SEND_PAYMENT}>
SEP-8 Send
</option>
)}
WDYT?
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.
👍 Sure, we can add that for clarity. Line 60 check should prevent it from being an untrusted asset for SEP-8 at that point, I think.
Preview is available here: |
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.
LGTM!
I created an issue to normalize how we display the dropdown options before adding the trustline: #195
* Do not show actions for untrusted regulated assets * Add extra check
* Do not show actions for untrusted regulated assets * Add extra check