1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-29 23:58:06 +01:00

Fix token validation in Send flow (#10045)

Additional validation was added in #9907 to ensure that the "Known
contract address" warning was shown when sending tokens to another
token address after switching assets on the Send screen. Unfortunately
this change had the unintended side-effect of preventing _all_ token
sends after switching assets, so long as the recipient was not an
internal address.

The problem is that the `validate` function expects to be passed the
address of the token send recipient in the case where a token is
selected. Instead the token address was being passed to the validate
function.

The `query` state is now used, which should always contain the
recipient address. This is the same state used in the only other place
the `validate` function is called.
This commit is contained in:
Mark Stacey 2020-12-10 14:28:19 -03:30
parent 7879481569
commit c30a42ab8e

View File

@ -156,7 +156,7 @@ export default class SendTransactionScreen extends Component {
if (sendTokenAddress && prevTokenAddress !== sendTokenAddress) { if (sendTokenAddress && prevTokenAddress !== sendTokenAddress) {
this.updateSendToken() this.updateSendToken()
this.validate(sendTokenAddress) this.validate(this.state.query)
updateGas = true updateGas = true
} }