From 982e3c242ee31dfed4c04db79ea9751ac3e98efb Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 29 Apr 2016 11:47:41 +0200 Subject: [PATCH] Split test: Parse new balances as floats --- tests/scenarios/split/run.py | 2 +- tests/scenarios/split/template.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/scenarios/split/run.py b/tests/scenarios/split/run.py index 54afeb6..959d8e8 100644 --- a/tests/scenarios/split/run.py +++ b/tests/scenarios/split/run.py @@ -50,7 +50,7 @@ def tokens_after_split(votes, original_balance, dao_balance, reward_tokens): for vote, orig in zip(votes, original_balance): if vote: - new_dao_balance.append(orig * dao_balance / totalSupply) + new_dao_balance.append(orig * dao_balance / float(totalSupply)) old_dao_balance.append(0) rewardToMove = float(orig) * reward_tokens / float(totalSupply) old_reward_tokens -= float(rewardToMove) diff --git a/tests/scenarios/split/template.js b/tests/scenarios/split/template.js index bdbb1a6..8107b2d 100644 --- a/tests/scenarios/split/template.js +++ b/tests/scenarios/split/template.js @@ -51,8 +51,8 @@ setTimeout(function() { oldDAOBalance = []; newDAOBalance = []; for (i = 0; i < eth.accounts.length; i++) { - oldDAOBalance.push(parseInt(web3.fromWei(dao.balanceOf(eth.accounts[i])))); - newDAOBalance.push(parseInt(web3.fromWei(newdao.balanceOf(eth.accounts[i])))); + oldDAOBalance.push(parseFloat(web3.fromWei(dao.balanceOf(eth.accounts[i])))); + newDAOBalance.push(parseFloat(web3.fromWei(newdao.balanceOf(eth.accounts[i])))); } addToTest('oldDAOBalance', oldDAOBalance); addToTest('newDAOBalance', newDAOBalance);