bitbox-wallet-app icon indicating copy to clipboard operation
bitbox-wallet-app copied to clipboard

Better error message for insufficient funds / gas on ERC-20 transfer.

Open Egge21M opened this issue 11 months ago • 2 comments

BitBox App gives an error when wallet does not have enough funds for ERC-20 gas. However the error message starts with "Ein unbekannter Fehler ist aufgetreten" which might be confusing for users. Bildschirmfoto 2024-03-05 um 08 01 41

Egge21M avatar Mar 05 '24 07:03 Egge21M

@Beerosagos once made a fix for that:

https://github.com/digitalbitbox/bitbox-wallet-app/blob/0f7362d2c854f2971bd9ddb0af2956cf5d7214de/backend/coins/eth/etherscan/etherscan.go#L47

https://github.com/digitalbitbox/bitbox-wallet-app/blob/master/backend/coins/btc/handlers/handlers.go#L407-L410

@Beerosagos maybe it's cause the error string is checked for equality, but the EtherScan err msg has more stuff in it? Here we use string.Contains instead:

https://github.com/digitalbitbox/bitbox-wallet-app/blob/0f7362d2c854f2971bd9ddb0af2956cf5d7214de/backend/coins/eth/account.go#L575

benma avatar Mar 05 '24 08:03 benma

Beerosagos once made a fix for that:

Yeah, it seems like etherscan error text is more detailed now and the strict comparison fails. Opened a PR to fix it: https://github.com/digitalbitbox/bitbox-wallet-app/pull/2607

Beerosagos avatar Mar 06 '24 09:03 Beerosagos

PR merged, closing

Beerosagos avatar Mar 14 '24 09:03 Beerosagos