Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Commit

Permalink
Remvoed imports, added assert messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Brord van Wierst committed May 14, 2019
1 parent cedb893 commit 0402ca4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/iota/iri/Iota.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.iota.iri.service.tipselection.*;
import com.iota.iri.service.tipselection.impl.*;
import com.iota.iri.service.transactionpruning.PrunedTransactionException;
import com.iota.iri.service.transactionpruning.PrunedTransactionProvider;
import com.iota.iri.service.transactionpruning.PrunedTransactionVerifier;
import com.iota.iri.service.transactionpruning.TransactionPruningException;
import com.iota.iri.service.transactionpruning.async.AsyncTransactionPruner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import com.iota.iri.controllers.TransactionViewModel;
import com.iota.iri.model.Hash;

/**
* Verifies the integrity of a chain of pruned transactions by checking each trunk/branch.
*/
public interface PrunedTransactionVerifier {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import com.iota.iri.TransactionTestUtils;
import com.iota.iri.conf.SnapshotConfig;
import com.iota.iri.controllers.TransactionViewModel;
import com.iota.iri.model.Hash;
import com.iota.iri.network.TransactionRequester;
import com.iota.iri.service.transactionpruning.impl.PrunedTransactionProviderImpl;
Expand Down Expand Up @@ -63,16 +62,16 @@ public void tearDown() {
public void isPossiblyPrunedTest() throws PrunedTransactionException {
Mockito.when(provider.containsTransaction(A)).thenReturn(true);

assertTrue(verifier.isPossiblyPruned(A));
assertFalse(verifier.isPossiblyPruned(B));
assertTrue("A should be seen as pruned", verifier.isPossiblyPruned(A));
assertFalse("B should not be seen as pruned", verifier.isPossiblyPruned(B));
}

@Test
public void waitingForHashTest() throws PrunedTransactionException {
assertFalse(verifier.isPruned(A));
assertTrue(verifier.waitingForHash(A));
assertFalse("A should not be seen as definitely pruned", verifier.isPruned(A));
assertTrue("Verifier should be waiting for TVM for A", verifier.waitingForHash(A));

assertFalse(verifier.waitingForHash(B));
assertFalse("Verifier should not be waitingfor TVM for B", verifier.waitingForHash(B));
}

@Test
Expand Down

0 comments on commit 0402ca4

Please sign in to comment.