trezor / trezor-suite

Trezor Suite Monorepo
https://trezor.io/trezor-suite
Other
712 stars 247 forks source link

Error: [ethjs-unit] while converting number 0..2 to wei, too many decimal points #4627

Open sentry-io[bot] opened 2 years ago

sentry-io[bot] commented 2 years ago

https://sentry.io/organizations/satoshilabs/issues/?project=5193825&query=is%3Aunresolved+ethjs-unit&statsPeriod=90d

Sentry Issue: TREZOR-SUITE-2VB

Error: [ethjs-unit] while converting number 0..2 to wei,  too many decimal points
  at toWei (webpack://@trezor/suite-build/../../node_modules/ethjs-unit/lib/index.js:131:11)
  at toWei (webpack://@trezor/suite-build/../../node_modules/web3-utils/lib/index.js:251:75)
  at getSerializedAmount (webpack://@trezor/suite-build/../suite/src/utils/wallet/sendFormUtils.ts:77:66)
  at getEthereumEstimateFeeParams (webpack://@trezor/suite-build/../suite/src/utils/wallet/sendFormUtils.ts:108:25)
  at action (webpack://@trezor/suite-build/../suite/src/actions/wallet/send/sendFormEthereumActions.ts:127:24)
...
(8 additional frame(s) were not displayed)
tomasklim commented 2 years ago

I updated web3-utils lib, so lets see if this error dissapears

prusnak commented 2 years ago

while converting number 0..2 to wei

Isn't this just about that the user entered 0..2 as ETH amount in the Send dialog?

tomasklim commented 2 years ago

while converting number 0..2 to wei

Isn't this just about that the user entered 0..2 as ETH amount in the Send dialog?

There are validation rules on all inputs. If the input is not valid, then it should not use ethjs-unit.

I have no idea yet, how are users avoiding those validation rules and make e.g. 0,99315 ETH a valid number.

However, it is true, that updating the lib cannot help.

matejkriz commented 2 years ago

other similar occurances (~20 users/90 day) https://sentry.io/organizations/satoshilabs/issues/?project=5193825&query=is%3Aunresolved+converting+number&statsPeriod=90d