|
|
|
@ -54,6 +54,22 @@ public class PendingTransactionsTest { |
|
|
|
|
private static final Address SENDER1 = Util.publicKeyToAddress(KEYS1.getPublicKey()); |
|
|
|
|
private static final Address SENDER2 = Util.publicKeyToAddress(KEYS2.getPublicKey()); |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void shouldReturnExclusivelyLocalTransactionsWhenAppropriate() { |
|
|
|
|
final Transaction localTransaction0 = createTransaction(0); |
|
|
|
|
transactions.addLocalTransaction(localTransaction0); |
|
|
|
|
assertThat(transactions.size()).isEqualTo(1); |
|
|
|
|
|
|
|
|
|
transactions.addRemoteTransaction(transaction1); |
|
|
|
|
assertThat(transactions.size()).isEqualTo(2); |
|
|
|
|
|
|
|
|
|
transactions.addRemoteTransaction(transaction2); |
|
|
|
|
assertThat(transactions.size()).isEqualTo(3); |
|
|
|
|
|
|
|
|
|
List<Transaction> localTransactions = transactions.getLocalTransactions(); |
|
|
|
|
assertThat(localTransactions.size()).isEqualTo(1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void shouldAddATransaction() { |
|
|
|
|
transactions.addRemoteTransaction(transaction1); |
|
|
|
|