Fix alternative token abi and token address for incoming transactions (#373)

This commit is contained in:
Germán Martínez 2019-12-17 21:30:31 +01:00 committed by GitHub
parent 80c87c6632
commit b30e5c9109
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,7 +204,7 @@ export const buildIncomingTransactionFrom = async (tx: IncomingTxServiceModel) =
symbol = tokenSymbol symbol = tokenSymbol
decimals = tokenDecimals decimals = tokenDecimals
} catch (err) { } catch (err) {
const { methods } = new web3.eth.Contract(ALTERNATIVE_TOKEN_ABI, tx.to) const { methods } = new web3.eth.Contract(ALTERNATIVE_TOKEN_ABI, tx.tokenAddress)
const [tokenSymbol, tokenDecimals] = await Promise.all([methods.symbol, methods.decimals].map((m) => m().call())) const [tokenSymbol, tokenDecimals] = await Promise.all([methods.symbol, methods.decimals].map((m) => m().call()))
symbol = web3.utils.toAscii(tokenSymbol) symbol = web3.utils.toAscii(tokenSymbol)
decimals = tokenDecimals decimals = tokenDecimals