KomodoPlatform / komodo-wallet-mobile

KomodoWallet Mobile codebase
https://komodoplatform.com
MIT License
21 stars 31 forks source link

[Bug] Addressbook entries are not validated #50

Open smk762 opened 11 months ago

smk762 commented 11 months ago

To replicate:

image

Seen in https://github.com/KomodoPlatform/komodo-wallet-mobile/pull/44

CharlVS commented 11 months ago

@naezith, Can you please have a look?

naezith commented 11 months ago

There isn't any coin/address validation in this section (contact_edit.dart) so the field allows any kind of text.

I looked for address validation in other places, and one of them is in the: _isCoinActive() function.

So the MM.validateAddress( is being used to check if the coin is active. That's why I thought the coin has to be active to validate the address. That's probably why the address book does not have that MM2 check since the address book coin selection dropdown has hundreds of coins.

Note: I'm not 100% sure so please correct me if it doesn't work like that.

@CharlVS @smk762

smk762 commented 11 months ago

SDK validateaddress method: https://developers.komodoplatform.com/basic-docs/atomicdex-api-legacy/validateaddress.html

Related issues from legacy desktop:

Related SDK issue: https://github.com/KomodoPlatform/komodo-defi-framework/issues/1654

Currently a coin must be active to be validated, which is sub-optimal. Given data in coins file (e.g. base 58 params), addresses should be able to be calculated from the pubkey, either at the SDK level or the GUI level (though that is another issue). I assume until it is, the flow would be something like:

UX would be much better if validation did not require the coin to be active, so perhaps its better to solve that first.