Skip to content

Commit

Permalink
Downgrade bitcoind to Java 11
Browse files Browse the repository at this point in the history
  • Loading branch information
alvasw committed Sep 20, 2024
1 parent 0914966 commit d85bda1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void sendBtcAndListTxs() throws MalformedURLException, InterruptedExcepti
List<BitcoindListTransactionsResponse.Entry> txs = receiverBackend.listTransactions(10);
assertEquals(3, txs.size());

BitcoindListTransactionsResponse.Entry firstTx = txs.getFirst();
BitcoindListTransactionsResponse.Entry firstTx = txs.stream().findFirst().orElseThrow();
assertEquals(firstTxReceiverAddress, firstTx.getAddress());
assertEquals("receive", firstTx.getCategory());
assertEquals(100000000, firstTx.getAmount());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ public enum BitcoindZmqTopic {
}

public static BitcoindZmqTopic parse(String topicName) {
return switch (topicName) {
case BitcoindZmqTopic.HASHBLOCK_TOPIC_NAME -> TOPIC_HASHBLOCK;
case BitcoindZmqTopic.RAWTX_TOPIC_NAME -> TOPIC_RAWTX;
default -> throw new IllegalStateException("Unknown ZMQ topic: " + topicName);
};
if (topicName.equals(BitcoindZmqTopic.HASHBLOCK_TOPIC_NAME)) {
return TOPIC_HASHBLOCK;
} else if (topicName.equals(BitcoindZmqTopic.RAWTX_TOPIC_NAME)) {
return TOPIC_RAWTX;
} else {
throw new IllegalStateException("Unknown ZMQ topic: " + topicName);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private String findZmqAddress(List<BitcoindGetZmqNotificationsResponse.Entry> zm
throw new CannotFindZmqAddressException("ZeroMQ: All topics need to published on the same address.");
}

return zmqNotifications.getFirst().getAddress();
return zmqNotifications.stream().findFirst().orElseThrow().getAddress();
}

private boolean canSubscribeToAllTopics(List<BitcoindGetZmqNotificationsResponse.Entry> zmqNotifications) {
Expand Down

0 comments on commit d85bda1

Please sign in to comment.