Skip to content

Commit

Permalink
Fix getBalances number conversion to prevent decimals in a wei value
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandomg committed Dec 3, 2018
1 parent 2283b32 commit 778d948
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion checkWorker3.js
Expand Up @@ -7,7 +7,7 @@ async function checkWorker3() {
try {
logger.debug('calling stuckTransfers()')
const transfers = await stuckTransfers()
console.log(transfers)
// console.log(transfers)
if (!transfers) throw new Error('transfers is empty: ' + JSON.stringify(transfers))
fs.writeFileSync(
path.join(__dirname, '/responses/stuckTransfers.json'),
Expand Down
4 changes: 2 additions & 2 deletions getBalances.js
Expand Up @@ -95,11 +95,11 @@ async function main(bridgeMode) {
const totalSupplyBN = mintedCoinsBN.minus(burntCoinsBN)
const foreignErc20BalanceBN = new BN(foreignErc20Balance)

const diff = foreignErc20BalanceBN.minus(totalSupplyBN).toString(10)
const diff = foreignErc20BalanceBN.minus(totalSupplyBN).toFixed()
logger.debug('Done')
return {
home: {
totalSupply: Web3Utils.fromWei(totalSupplyBN.toString())
totalSupply: Web3Utils.fromWei(totalSupplyBN.toFixed())
},
foreign: {
erc20Balance: Web3Utils.fromWei(foreignErc20Balance)
Expand Down

0 comments on commit 778d948

Please sign in to comment.