Apps: Addresses are not properly cnp-able across the UI

Created on 24 Aug 2018  路  8Comments  路  Source: polkadot-js/apps

Version of the UI: polkadot-js-ui v0.19.51

In the past, I could transfer to any account.
This no longer work if the recipient account is not in your address book.

image

@react-components [bug] good first issue

All 8 comments

I've gone through the following steps to reproduce your issue so far.

After I Create Account at http://localhost:3000/#/accounts, it stays at that url but displays that account in the Edit Account tab.

screen shot 2018-08-24 at 10 18 14 pm

If I go to Addresses http://localhost:3000/#/addresses. I have no accounts in the address book.

screen shot 2018-08-24 at 10 19 48 pm

Then when we go to Extrinsics http://localhost:3000/#/extrinsics to make a transaction, by default it's configured to transfer 1 DOT of stake from my account to my same account, even if I don't have any DOTs.

screen shot 2018-08-24 at 10 20 24 pm

If I then click on the input field selection box that is displaying my Account Name and Account ID (underneath the label "recipient: AccountId"), I can start entering a custom recipient Account ID, as you have shown.

Try sending 1 DOT to any address that is not one of your accounts and not in your Addresses.

1 DOT won't work - it is less than the existential amount (see https://github.com/polkadot-js/apps/issues/71), so you will lose -

  1. The 1 DOT transferred
  2. The fee to create an account (I believe - not sure 100% due to point 4 below)
  3. The transfer fee
  4. However since the balance of the recipient is <500 (existential amount), it will just be removed, treated as dust.

Transfer test (5k) - https://youtu.be/tFS8dYRB8yQ

EDIT: Video done on poc-2 url (sorry for the lags in clicking on it, just didn't quite figure out exactly where to get an address - normally I just actually grab them from create account, sometimes copying the secret from vanity and treating it as a publicKey - but since we were not testing hex -> address conversion, not quite the right approach)

Do you possibly have a space before/after the address?

I don't think we strip those - and 2 mins later I'm certain we don't, i.e. https://github.com/polkadot-js/apps/blob/cf8f2064f88bd79d8ac81251d70e7ab064f6fb38/packages/ui-app/src/InputAddress/index.tsx#L176

I copy paste from storage using a double click on the address, and... oh, look at that:
image

It seems to be selecting the next index as well. So I don麓t have a space when I paste but an extra digit at the end. That explains.

A fix would be to change:
<div class="ui--Param-text">5FVxKvW1pQUWT85jh7yD7A1ATzBjSVjgDL8HxUXsvZxqfQkx</div> into
<div class="ui--Param-text">5FVxKvW1pQUWT85jh7yD7A1ATzBjSVjgDL8HxUXsvZxqfQkx </div>

Doing so, there is no need to strip the trailing spaces but I am sure there will be cases where it will be an issue so stripping and leading/trailing spaces probably would not hurt.

Yes, I think the .trim() needs to be in place - people can copy from anywhere, e.g. chat, mail, etc.

Additionally, we may want to just look at a mini copy button next to AddressMini and the above rendering.

Summary of top-of-mind issues that would need a look at -

  1. AddressInput needs .trim() on query inputs (EDIT: fixed in https://github.com/polkadot-js/apps/pull/281)
  2. Param rendering needs to remove extra space at end (as per @chevdor comment above)
  3. (Investigate) adding mini copy button to AddressMini (EDIT: removed, icon is now click-copyable)
  4. (Possibly) start using AddressMini in Param address rendering
  5. (Investigate) using error alerts/messages when things don't match up (instead of just not showing as per original screenshot). Possibilities for errors - (a) address too long, (b) wrong address format/checksum

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

Was this page helpful?
0 / 5 - 0 ratings