Преглед на файлове

give more balance to testrpc accounts

includes fix to MultisigWallet test because bigger balances result in
floating point errors (see #204)
Francisco Giordano преди 8 години
родител
ревизия
4d55d8fa8e
променени са 2 файла, в които са добавени 14 реда и са изтрити 2 реда
  1. 13 1
      scripts/test.sh
  2. 1 1
      test/MultisigWallet.js

+ 13 - 1
scripts/test.sh

@@ -4,7 +4,19 @@ output=$(nc -z localhost 8545; echo $?)
 [ $output -eq "0" ] && trpc_running=true
 if [ ! $trpc_running ]; then
   echo "Starting our own testrpc node instance"
-  testrpc > /dev/null &
+  # we give each account 1M ether, needed for high-value tests
+  testrpc \
+    --account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501200,1000000000000000000000000"  \
+    --account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501201,1000000000000000000000000"  \
+    --account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501202,1000000000000000000000000"  \
+    --account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501203,1000000000000000000000000"  \
+    --account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501204,1000000000000000000000000"  \
+    --account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501205,1000000000000000000000000"  \
+    --account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501206,1000000000000000000000000"  \
+    --account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501207,1000000000000000000000000"  \
+    --account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501208,1000000000000000000000000"  \
+    --account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501209,1000000000000000000000000"  \
+  > /dev/null &
   trpc_pid=$!
 fi
 ./node_modules/truffle/cli.js test

+ 1 - 1
test/MultisigWallet.js

@@ -52,7 +52,7 @@ contract('MultisigWallet', function(accounts) {
 
     //Balance of account2 should have increased
     let newAccountBalance = web3.eth.getBalance(accounts[2]);
-    assert.isTrue(newAccountBalance > accountBalance);
+    assert.isTrue(newAccountBalance.greaterThan(accountBalance));
   });
 
   it('should prevent execution of transaction if above daily limit', async function() {