Use PersistenceManager

This commit is contained in:
chimp1984 2020-10-01 19:57:54 -05:00
parent fac4200825
commit 486e6f4985
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3
2 changed files with 5 additions and 5 deletions

View file

@ -57,9 +57,9 @@ import bisq.common.crypto.KeyRing;
import bisq.common.crypto.KeyStorage;
import bisq.common.crypto.PubKeyRing;
import bisq.common.file.CorruptedStorageFileHandler;
import bisq.common.persistence.PersistenceManager;
import bisq.common.proto.network.NetworkProtoResolver;
import bisq.common.proto.persistable.PersistenceProtoResolver;
import bisq.common.storage.Storage;
import com.google.inject.Guice;
import com.google.inject.Injector;
@ -148,7 +148,7 @@ public class GuiceSetupTest {
assertSingleton(MediationDisputeListService.class);
assertSingleton(TraderChatManager.class);
assertNotSingleton(Storage.class);
assertNotSingleton(PersistenceManager.class);
}
private void assertSingleton(Class<?> type) {

View file

@ -28,8 +28,8 @@ import bisq.network.p2p.seed.SeedNodeRepository;
import bisq.common.ClockWatcher;
import bisq.common.file.CorruptedStorageFileHandler;
import bisq.common.persistence.PersistenceManager;
import bisq.common.proto.persistable.PersistenceProtoResolver;
import bisq.common.storage.Storage;
import java.nio.file.Files;
@ -59,8 +59,8 @@ public class MockNode {
this.maxConnections = maxConnections;
networkNode = mock(NetworkNode.class);
File storageDir = Files.createTempDirectory("storage").toFile();
Storage<PeerList> storage = new Storage<>(storageDir, mock(PersistenceProtoResolver.class), mock(CorruptedStorageFileHandler.class));
peerManager = new PeerManager(networkNode, mock(SeedNodeRepository.class), new ClockWatcher(), maxConnections, storage);
PersistenceManager<PeerList> persistenceManager = new PersistenceManager<>(storageDir, mock(PersistenceProtoResolver.class), mock(CorruptedStorageFileHandler.class));
peerManager = new PeerManager(networkNode, mock(SeedNodeRepository.class), new ClockWatcher(), maxConnections, persistenceManager);
connections = new HashSet<>();
when(networkNode.getAllConnections()).thenReturn(connections);
}