alpha-wallet-ios icon indicating copy to clipboard operation
alpha-wallet-ios copied to clipboard

"Impossible To Build Configuration"

Open hboon opened this issue 3 years ago • 1 comments

Refer https://github.com/AlphaWallet/alpha-wallet-ios/issues/4888#issuecomment-1175351309

@Hoanib would you help to describe how to reproduce this?

hboon avatar Jul 06 '22 03:07 hboon

Blue Sky NFT token (Polygon)

Contract address: 0x612ee4BfD2EE2EAA7ef44120543C78AB4Bd16635

Wallet: 0x32024F224b493Da02B2b9B985ee2fEe37Eed966b

Owner wallet managed, some how, to add manually the contract address of the token. And the token is displayed in his wallet as the screenshots show. (I couldn't add it, even using his wallet as Watch Wallet)

image

image

image

image

Hoanib avatar Jul 06 '22 03:07 Hoanib

Not sure if it's still reproducible

hboon avatar Mar 28 '23 03:03 hboon

will check

oa-s avatar Mar 29 '23 10:03 oa-s

yes this is still a case, we wrongly update imported token balance, mean create a token with incorrect balance value, and user have some time to open token screen and go throught send process. @hboon what if we remove creating a ercToken AddOrUpdateTokenAction case add(ercToken: ErcToken, shouldUpdateBalance: Bool) with its balance, as balance at this point can be incorrect. and will relay on balance fetcher, to get right balance value?

oa-s avatar Mar 30 '23 05:03 oa-s

what if we remove creating a ercToken AddOrUpdateTokenAction case add(ercToken: ErcToken, shouldUpdateBalance: Bool) with its balance, as balance at this point can be incorrect. and will relay on balance fetcher, to get right balance value?

Is this correct? —

  1. User manually imports token
  2. We auto detect token type correctly (so ERC-721 here) and add the wrong balance; do we add say 2, or do we have an invalid JSON representing 1, eg. [{}, {}]?
  3. User tries to send the token before the balance is updated

If so, where in the code does it throw TransactionConfiguratorError.impossibleToBuildConfiguration and why does the code do it?

And do you mean to just set it to 0/[] instead in step (2)?


Alternatively, what if we have a way to check/denote that the balance for each token is not ready yet? — I don't know how useful is this or if it just complicates things. Maybe a flag or switch the balance to an enum

hboon avatar Mar 31 '23 02:03 hboon

add pr with checking right token balance for each token type, also updated check is zero balance function. now should be good

oa-s avatar Mar 31 '23 07:03 oa-s

If so, where in the code does it throw TransactionConfiguratorError.impossibleToBuildConfiguration and why does the code do it?

i suppose that its here https://github.com/AlphaWallet/alpha-wallet-ios/blob/cfd411b1d9f46f9450207fed10499ca95fc8127f/AlphaWallet/Transfer/Collectibles/Coordinators/TransferCollectiblesCoordinator.swift#L113

oa-s avatar Mar 31 '23 07:03 oa-s