Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nashatyrev committed Jun 23, 2016
1 parent ddbb6e6 commit 77d57ad
Showing 1 changed file with 8 additions and 10 deletions.
Expand Up @@ -25,9 +25,7 @@

import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.ethereum.listener.EthereumListener.PendingTransactionState.DROPPED;
import static org.ethereum.listener.EthereumListener.PendingTransactionState.INCLUDED;
import static org.ethereum.listener.EthereumListener.PendingTransactionState.PENDING;
import static org.ethereum.listener.EthereumListener.PendingTransactionState.*;
import static org.ethereum.util.BIUtil.toBI;
import static org.ethereum.util.blockchain.EtherUtil.Unit.ETHER;
import static org.ethereum.util.blockchain.EtherUtil.convert;
Expand Down Expand Up @@ -129,10 +127,10 @@ public void testSimple() throws InterruptedException {
pendingState.addPendingTransaction(tx3);

txUpd = l.pollTxUpdate(tx2);
Assert.assertEquals(txUpd.getMiddle(), PENDING);
Assert.assertEquals(txUpd.getMiddle(), NEW_PENDING);
Assert.assertTrue(txUpd.getLeft().isValid());
txUpd = l.pollTxUpdate(tx3);
Assert.assertEquals(txUpd.getMiddle(), PENDING);
Assert.assertEquals(txUpd.getMiddle(), NEW_PENDING);
Assert.assertTrue(txUpd.getLeft().isValid());
Assert.assertTrue(pendingState.getRepository().getBalance(alice.getAddress()).
compareTo(BigInteger.valueOf(2000000 - 100000)) > 0);
Expand Down Expand Up @@ -191,8 +189,8 @@ public void testRebranch1() throws InterruptedException {
Transaction tx2 = bc.createTransaction(charlie, 0, alice.getAddress(), BigInteger.valueOf(1000000), new byte[0]);;
pendingState.addPendingTransaction(tx2);

Assert.assertEquals(l.pollTxUpdateState(tx1), PENDING);
Assert.assertEquals(l.pollTxUpdateState(tx2), PENDING);
Assert.assertEquals(l.pollTxUpdateState(tx1), NEW_PENDING);
Assert.assertEquals(l.pollTxUpdateState(tx2), NEW_PENDING);
Assert.assertTrue(pendingState.getRepository().getBalance(alice.getAddress()).
compareTo(BigInteger.valueOf(2000000)) == 0);

Expand Down Expand Up @@ -235,7 +233,7 @@ public void testRebranch1() throws InterruptedException {
}

@Test
public void testRebranch2_() throws InterruptedException {
public void testRebranch2() throws InterruptedException {
StandaloneBlockchain bc = new StandaloneBlockchain();
PendingListener l = new PendingListener();
bc.addEthereumListener(l);
Expand All @@ -256,8 +254,8 @@ public void testRebranch2_() throws InterruptedException {
Transaction tx2 = bc.createTransaction(charlie, 0, alice.getAddress(), BigInteger.valueOf(1000000), new byte[0]);;
pendingState.addPendingTransaction(tx2);

Assert.assertEquals(l.pollTxUpdateState(tx1), PENDING);
Assert.assertEquals(l.pollTxUpdateState(tx2), PENDING);
Assert.assertEquals(l.pollTxUpdateState(tx1), NEW_PENDING);
Assert.assertEquals(l.pollTxUpdateState(tx2), NEW_PENDING);
Assert.assertTrue(pendingState.getRepository().getBalance(alice.getAddress()).
compareTo(BigInteger.valueOf(2000000)) == 0);

Expand Down

0 comments on commit 77d57ad

Please sign in to comment.