Skip to content

Commit

Permalink
Fix test and log errors
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
  • Loading branch information
fab-10 committed Jun 28, 2023
1 parent 825d6f6 commit 3717795
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ public void setup() {
when(besuController.getNodeKey()).thenReturn(nodeKey);
when(besuController.getMiningParameters()).thenReturn(mock(MiningParameters.class));
when(besuController.getPrivacyParameters()).thenReturn(mock(PrivacyParameters.class));
when(besuController.getTransactionPool()).thenReturn(mock(TransactionPool.class));
when(besuController.getTransactionPool())
.thenReturn(mock(TransactionPool.class, RETURNS_DEEP_STUBS));
when(besuController.getSynchronizer()).thenReturn(mock(Synchronizer.class));
when(besuController.getMiningCoordinator()).thenReturn(mock(MiningCoordinator.class));
when(besuController.getMiningCoordinator()).thenReturn(mock(MergeMiningCoordinator.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,13 @@ public CompletableFuture<Void> setEnabled() {
isPoolEnabled.set(true);
subscribeConnectId =
OptionalLong.of(ethContext.getEthPeers().subscribeConnect(this::handleConnect));
return saveRestoreManager.loadFromDisk();
return saveRestoreManager
.loadFromDisk()
.exceptionally(
t -> {
LOG.error("Error while restoring transaction pool from disk", t);
return null;
});
}
return CompletableFuture.completedFuture(null);
}
Expand All @@ -543,7 +549,13 @@ public CompletableFuture<Void> setDisabled() {
pendingTransactionsListenersProxy.unsubscribe();
final PendingTransactions pendingTransactionsToSave = pendingTransactions;
pendingTransactions = new DisabledPendingTransactions();
return saveRestoreManager.saveToDisk(pendingTransactionsToSave);
return saveRestoreManager
.saveToDisk(pendingTransactionsToSave)
.exceptionally(
t -> {
LOG.error("Error while saving transaction pool to disk", t);
return null;
});
}
return CompletableFuture.completedFuture(null);
}
Expand Down

0 comments on commit 3717795

Please sign in to comment.