Remove unused fields, apply new params

This commit is contained in:
chimp1984 2020-10-01 19:57:44 -05:00
parent e825613f5c
commit fac4200825
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3

View file

@ -45,23 +45,17 @@ import bisq.core.user.UserPayload;
import bisq.network.p2p.peers.peerexchange.PeerList;
import bisq.network.p2p.storage.persistence.SequenceNumberMap;
import bisq.common.config.Config;
import bisq.common.file.CorruptedStorageFileHandler;
import bisq.common.proto.ProtobufferRuntimeException;
import bisq.common.proto.network.NetworkProtoResolver;
import bisq.common.proto.persistable.NavigationPath;
import bisq.common.proto.persistable.PersistableEnvelope;
import bisq.common.proto.persistable.PersistenceProtoResolver;
import bisq.common.storage.Storage;
import com.google.inject.Provider;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import java.io.File;
import lombok.extern.slf4j.Slf4j;
// TODO Use ProtobufferException instead of ProtobufferRuntimeException
@ -70,19 +64,12 @@ import lombok.extern.slf4j.Slf4j;
public class CorePersistenceProtoResolver extends CoreProtoResolver implements PersistenceProtoResolver {
private final Provider<BtcWalletService> btcWalletService;
private final NetworkProtoResolver networkProtoResolver;
private final File storageDir;
private final CorruptedStorageFileHandler corruptedStorageFileHandler;
@Inject
public CorePersistenceProtoResolver(Provider<BtcWalletService> btcWalletService,
NetworkProtoResolver networkProtoResolver,
@Named(Config.STORAGE_DIR) File storageDir,
CorruptedStorageFileHandler corruptedStorageFileHandler) {
NetworkProtoResolver networkProtoResolver) {
this.btcWalletService = btcWalletService;
this.networkProtoResolver = networkProtoResolver;
this.storageDir = storageDir;
this.corruptedStorageFileHandler = corruptedStorageFileHandler;
}
@Override
@ -96,22 +83,13 @@ public class CorePersistenceProtoResolver extends CoreProtoResolver implements P
case ADDRESS_ENTRY_LIST:
return AddressEntryList.fromProto(proto.getAddressEntryList());
case TRADABLE_LIST:
return TradableList.fromProto(proto.getTradableList(),
this,
new Storage<>(storageDir, this, corruptedStorageFileHandler),
btcWalletService.get());
return TradableList.fromProto(proto.getTradableList(), this, btcWalletService.get());
case ARBITRATION_DISPUTE_LIST:
return ArbitrationDisputeList.fromProto(proto.getArbitrationDisputeList(),
this,
new Storage<>(storageDir, this, corruptedStorageFileHandler));
return ArbitrationDisputeList.fromProto(proto.getArbitrationDisputeList(), this);
case MEDIATION_DISPUTE_LIST:
return MediationDisputeList.fromProto(proto.getMediationDisputeList(),
this,
new Storage<>(storageDir, this, corruptedStorageFileHandler));
return MediationDisputeList.fromProto(proto.getMediationDisputeList(), this);
case REFUND_DISPUTE_LIST:
return RefundDisputeList.fromProto(proto.getRefundDisputeList(),
this,
new Storage<>(storageDir, this, corruptedStorageFileHandler));
return RefundDisputeList.fromProto(proto.getRefundDisputeList(), this);
case PREFERENCES_PAYLOAD:
return PreferencesPayload.fromProto(proto.getPreferencesPayload(), this);
case USER_PAYLOAD: