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

Prevent send to token warning #6058

Merged
merged 20 commits into from
Jan 23, 2019
Merged

Prevent send to token warning #6058

merged 20 commits into from
Jan 23, 2019

Conversation

estebanmino
Copy link
Contributor

@estebanmino estebanmino commented Jan 23, 2019

Following #6051

This PR adds this validation as a warning instead of an error. With this the user will see Known contract address. as an error but is still possible to send the transaction.

This PR also adds a new object to the send state, called warnings. For now rendered with the component SendRowWarningMessage as the errors, but the idea of this is to easily modify the way we want to show warnings to users, without blocking the transaction validation.

@metamaskbot
Copy link
Collaborator

Builds ready [6017b16]: mascara, chrome, firefox, edge, opera

danjm
danjm previously approved these changes Jan 23, 2019
@danjm
Copy link
Contributor

danjm commented Jan 23, 2019

Code changes look good to me!

@estebanmino could you add a screen shot or gif showing what the warning looks like?

@estebanmino
Copy link
Contributor Author

estebanmino commented Jan 23, 2019

Sure there is a GIF

shpw

As you can see, sending HACK to the address HACK (or any token added manually) or any contract in contract-metadata it will show a Known contract address. message that is part of the warnings added to this PR so the user will still be able to send the token to the address. And this warning will appear only when sending tokens.

If we want to change the color or anything else in that message we just need to modify SendRowWarningMessage, right now working with the same style as errors.

@danjm let me know if we want to change the color of the message or something else.

cc @bdresser @danfinlay

@danjm
Copy link
Contributor

danjm commented Jan 23, 2019

@estebanmino Yeah, let's change the color to orange, as it is just a warning. For example, see the different warning colours we have in the speed up sidebar.

speeduperrors

Otherwise this looks good to merge.

@estebanmino
Copy link
Contributor Author

done

@danjm changed

@metamaskbot
Copy link
Collaborator

Builds ready [b66bbed]: mascara, chrome, firefox, edge, opera

Copy link
Contributor

@whymarrh whymarrh left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants