1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Add backend fix for util in normalizeethstringtowei.

This commit is contained in:
Kevin Serrano 2017-12-27 17:31:38 -08:00
parent 414f89668e
commit 3e562f1a1e
No known key found for this signature in database
GPG Key ID: BF999DEFC7371BA1

View File

@ -193,6 +193,9 @@ function normalizeEthStringToWei (str) {
while (decimal.length < 18) { while (decimal.length < 18) {
decimal += '0' decimal += '0'
} }
if (decimal.length > 18) {
decimal = decimal.slice(0, 18)
}
const decimalBN = new ethUtil.BN(decimal, 10) const decimalBN = new ethUtil.BN(decimal, 10)
eth = eth.add(decimalBN) eth = eth.add(decimalBN)
} }