From 35d9338615a48d30bd72efd31db186b7a629819c Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Thu, 1 Oct 2020 17:06:49 -0500 Subject: [PATCH] Remove UserThreadMappedPersistableList and use PersistableList instead We will not need threading support anymore once we use the new persistenceManager as serialisation is done on the userThread. --- .../UserThreadMappedPersistableList.java | 31 ------------------- .../governance/blindvote/MyBlindVoteList.java | 4 +-- .../bond/reputation/MyReputationList.java | 4 +-- .../dao/governance/myvote/MyVoteList.java | 4 +-- .../proofofburn/MyProofOfBurnList.java | 4 +-- .../governance/proposal/MyProposalList.java | 4 +-- .../state/model/governance/BallotList.java | 4 +-- .../UnconfirmedBsqChangeOutputList.java | 4 +-- .../bisq/core/payment/PaymentAccountList.java | 4 +-- 9 files changed, 16 insertions(+), 47 deletions(-) delete mode 100644 common/src/main/java/bisq/common/proto/persistable/UserThreadMappedPersistableList.java diff --git a/common/src/main/java/bisq/common/proto/persistable/UserThreadMappedPersistableList.java b/common/src/main/java/bisq/common/proto/persistable/UserThreadMappedPersistableList.java deleted file mode 100644 index d9829910b5..0000000000 --- a/common/src/main/java/bisq/common/proto/persistable/UserThreadMappedPersistableList.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is part of Bisq. - * - * Bisq is free software: you can redistribute it and/or modify it - * under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * Bisq is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public - * License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Bisq. If not, see . - */ - -package bisq.common.proto.persistable; - -import java.util.List; - -public abstract class UserThreadMappedPersistableList extends PersistableList - implements UserThreadMappedPersistableEnvelope { - - public UserThreadMappedPersistableList(List list) { - super(list); - } - - public UserThreadMappedPersistableList() { - } -} diff --git a/core/src/main/java/bisq/core/dao/governance/blindvote/MyBlindVoteList.java b/core/src/main/java/bisq/core/dao/governance/blindvote/MyBlindVoteList.java index 313fc07d34..be0890b653 100644 --- a/core/src/main/java/bisq/core/dao/governance/blindvote/MyBlindVoteList.java +++ b/core/src/main/java/bisq/core/dao/governance/blindvote/MyBlindVoteList.java @@ -19,7 +19,7 @@ package bisq.core.dao.governance.blindvote; import bisq.core.dao.governance.ConsensusCritical; -import bisq.common.proto.persistable.UserThreadMappedPersistableList; +import bisq.common.proto.persistable.PersistableList; import com.google.protobuf.Message; @@ -33,7 +33,7 @@ import lombok.EqualsAndHashCode; * List of my own blind votes. Blind votes received from other voters are stored in the BlindVoteStore. */ @EqualsAndHashCode(callSuper = true) -public class MyBlindVoteList extends UserThreadMappedPersistableList implements ConsensusCritical { +public class MyBlindVoteList extends PersistableList implements ConsensusCritical { MyBlindVoteList() { super(); diff --git a/core/src/main/java/bisq/core/dao/governance/bond/reputation/MyReputationList.java b/core/src/main/java/bisq/core/dao/governance/bond/reputation/MyReputationList.java index 9e705d2642..2a39f78317 100644 --- a/core/src/main/java/bisq/core/dao/governance/bond/reputation/MyReputationList.java +++ b/core/src/main/java/bisq/core/dao/governance/bond/reputation/MyReputationList.java @@ -17,7 +17,7 @@ package bisq.core.dao.governance.bond.reputation; -import bisq.common.proto.persistable.UserThreadMappedPersistableList; +import bisq.common.proto.persistable.PersistableList; import java.util.ArrayList; import java.util.List; @@ -29,7 +29,7 @@ import lombok.EqualsAndHashCode; * PersistableEnvelope wrapper for list of MyReputations. */ @EqualsAndHashCode(callSuper = true) -public class MyReputationList extends UserThreadMappedPersistableList { +public class MyReputationList extends PersistableList { private MyReputationList(List list) { super(list); diff --git a/core/src/main/java/bisq/core/dao/governance/myvote/MyVoteList.java b/core/src/main/java/bisq/core/dao/governance/myvote/MyVoteList.java index c840faf7e6..05610f8dcb 100644 --- a/core/src/main/java/bisq/core/dao/governance/myvote/MyVoteList.java +++ b/core/src/main/java/bisq/core/dao/governance/myvote/MyVoteList.java @@ -17,7 +17,7 @@ package bisq.core.dao.governance.myvote; -import bisq.common.proto.persistable.UserThreadMappedPersistableList; +import bisq.common.proto.persistable.PersistableList; import com.google.protobuf.Message; @@ -28,7 +28,7 @@ import java.util.stream.Collectors; import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper = true) -public class MyVoteList extends UserThreadMappedPersistableList { +public class MyVoteList extends PersistableList { MyVoteList() { super(); diff --git a/core/src/main/java/bisq/core/dao/governance/proofofburn/MyProofOfBurnList.java b/core/src/main/java/bisq/core/dao/governance/proofofburn/MyProofOfBurnList.java index 0845b4efb7..a1f55c2499 100644 --- a/core/src/main/java/bisq/core/dao/governance/proofofburn/MyProofOfBurnList.java +++ b/core/src/main/java/bisq/core/dao/governance/proofofburn/MyProofOfBurnList.java @@ -17,7 +17,7 @@ package bisq.core.dao.governance.proofofburn; -import bisq.common.proto.persistable.UserThreadMappedPersistableList; +import bisq.common.proto.persistable.PersistableList; import java.util.ArrayList; import java.util.List; @@ -29,7 +29,7 @@ import lombok.EqualsAndHashCode; * PersistableEnvelope wrapper for list of MyProofOfBurn objects. */ @EqualsAndHashCode(callSuper = true) -public class MyProofOfBurnList extends UserThreadMappedPersistableList { +public class MyProofOfBurnList extends PersistableList { private MyProofOfBurnList(List list) { super(list); diff --git a/core/src/main/java/bisq/core/dao/governance/proposal/MyProposalList.java b/core/src/main/java/bisq/core/dao/governance/proposal/MyProposalList.java index 0729043232..7ec120d719 100644 --- a/core/src/main/java/bisq/core/dao/governance/proposal/MyProposalList.java +++ b/core/src/main/java/bisq/core/dao/governance/proposal/MyProposalList.java @@ -20,7 +20,7 @@ package bisq.core.dao.governance.proposal; import bisq.core.dao.governance.ConsensusCritical; import bisq.core.dao.state.model.governance.Proposal; -import bisq.common.proto.persistable.UserThreadMappedPersistableList; +import bisq.common.proto.persistable.PersistableList; import java.util.ArrayList; import java.util.List; @@ -32,7 +32,7 @@ import lombok.EqualsAndHashCode; * PersistableEnvelope wrapper for list of proposals. Used in vote consensus, so changes can break consensus! */ @EqualsAndHashCode(callSuper = true) -public class MyProposalList extends UserThreadMappedPersistableList implements ConsensusCritical { +public class MyProposalList extends PersistableList implements ConsensusCritical { public MyProposalList(List list) { super(list); diff --git a/core/src/main/java/bisq/core/dao/state/model/governance/BallotList.java b/core/src/main/java/bisq/core/dao/state/model/governance/BallotList.java index d3b4a1f97e..25eaa415e6 100644 --- a/core/src/main/java/bisq/core/dao/state/model/governance/BallotList.java +++ b/core/src/main/java/bisq/core/dao/state/model/governance/BallotList.java @@ -20,7 +20,7 @@ package bisq.core.dao.state.model.governance; import bisq.core.dao.governance.ConsensusCritical; import bisq.core.dao.state.model.ImmutableDaoStateModel; -import bisq.common.proto.persistable.UserThreadMappedPersistableList; +import bisq.common.proto.persistable.PersistableList; import java.util.ArrayList; import java.util.List; @@ -35,7 +35,7 @@ import javax.annotation.concurrent.Immutable; */ @Immutable @EqualsAndHashCode(callSuper = true) -public class BallotList extends UserThreadMappedPersistableList implements ConsensusCritical, ImmutableDaoStateModel { +public class BallotList extends PersistableList implements ConsensusCritical, ImmutableDaoStateModel { public BallotList(List list) { super(list); diff --git a/core/src/main/java/bisq/core/dao/state/unconfirmed/UnconfirmedBsqChangeOutputList.java b/core/src/main/java/bisq/core/dao/state/unconfirmed/UnconfirmedBsqChangeOutputList.java index 391afda22f..2deae25697 100644 --- a/core/src/main/java/bisq/core/dao/state/unconfirmed/UnconfirmedBsqChangeOutputList.java +++ b/core/src/main/java/bisq/core/dao/state/unconfirmed/UnconfirmedBsqChangeOutputList.java @@ -17,7 +17,7 @@ package bisq.core.dao.state.unconfirmed; -import bisq.common.proto.persistable.UserThreadMappedPersistableList; +import bisq.common.proto.persistable.PersistableList; import com.google.protobuf.Message; @@ -28,7 +28,7 @@ import java.util.stream.Collectors; import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper = true) -public class UnconfirmedBsqChangeOutputList extends UserThreadMappedPersistableList { +public class UnconfirmedBsqChangeOutputList extends PersistableList { UnconfirmedBsqChangeOutputList() { super(); diff --git a/core/src/main/java/bisq/core/payment/PaymentAccountList.java b/core/src/main/java/bisq/core/payment/PaymentAccountList.java index efe9cccc22..a35801705c 100644 --- a/core/src/main/java/bisq/core/payment/PaymentAccountList.java +++ b/core/src/main/java/bisq/core/payment/PaymentAccountList.java @@ -19,7 +19,7 @@ package bisq.core.payment; import bisq.core.proto.CoreProtoResolver; -import bisq.common.proto.persistable.UserThreadMappedPersistableList; +import bisq.common.proto.persistable.PersistableList; import com.google.protobuf.Message; @@ -30,7 +30,7 @@ import java.util.stream.Collectors; import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper = true) -public class PaymentAccountList extends UserThreadMappedPersistableList { +public class PaymentAccountList extends PersistableList { public PaymentAccountList(List list) { super(list);