[bisq-network/bisq] Tidy persistable envelope inheritance (#4102)
notifications at github.com
Mon Mar 30 15:40:25 UTC 2020
- make yourself familiar with the CONTRIBUTING.md if you have not already (https://github.com/bisq-network/bisq/blob/master/CONTRIBUTING.md)
- make sure you follow our [coding style guidelines][https://github.com/bisq-network/style/issues)
- pick a descriptive title
- provide some meaningful PR description below
- create the PR
- in case you receive a "Change request" and/or a NACK, please react within 30 days. If not, we will close your PR and it can not be up for compensation.
- After addressing the change request, __please re-request a review!__ Otherwise we might miss your PR as we tend to only look at pull requests tagged with a "review required".
This refactoring is a continuation from the concurrency fixes in #4025, to remove all the remaining superfluous `PersistableEnvelope` interfaces on classes implementing `Proto`.
- Remove an unused `PersistableEnvelope` interface from the following five `PersistableNetworkPayload` implementations:
> AccountAgeWitness, BlindVotePayload, ProposalPayload, SignedWitness, TradeStatistics2
These already have corresponding `*Store` envelope classes which correctly implement the interface.
- Additionally, delete the unused class `PersistableHashMap`, make `(UserThreadMapped)PersistableList` abstract and remove some unused functionality from the base class.
- The last commit in this PR touches the DAO packages, as the consensus-critical classes `MeritList` and `VoteWithProposalTxIdList` needlessly implement the `PersistableEnvelope` interface prior to this change, via the base class `PersistableList`. I inlined the `list` field, instead of inheriting it from the base class, and made them standalone classes instead. This shouldn't observably alter behaviour and would hopefully also reduce the chance of future inadvertent changes in behaviour (as `PersistableList` lies outside the DAO packages).
You can view, comment on, or merge this pull request online at:
-- Commit Summary --
* Tidy payload instances wrongly implementing PersistableEnvelope
* Delete PersistableHashMap & simplify PersistableList
* Make MeritList & VoteWithProposalTxIdList standalone classes
-- File Changes --
M common/src/main/java/bisq/common/proto/ProtoResolver.java (5)
D common/src/main/java/bisq/common/proto/persistable/PersistableHashMap.java (50)
M common/src/main/java/bisq/common/proto/persistable/PersistableList.java (27)
M common/src/main/java/bisq/common/proto/persistable/UserThreadMappedPersistableList.java (2)
M core/src/main/java/bisq/core/account/sign/SignedWitness.java (3)
M core/src/main/java/bisq/core/account/witness/AccountAgeWitness.java (3)
M core/src/main/java/bisq/core/dao/governance/blindvote/VoteWithProposalTxIdList.java (21)
M core/src/main/java/bisq/core/dao/governance/blindvote/storage/BlindVotePayload.java (3)
M core/src/main/java/bisq/core/dao/governance/proposal/storage/appendonly/ProposalPayload.java (3)
M core/src/main/java/bisq/core/dao/governance/voteresult/VoteResultService.java (8)
M core/src/main/java/bisq/core/dao/state/model/governance/MeritList.java (19)
M core/src/main/java/bisq/core/proto/CoreProtoResolver.java (6)
M core/src/main/java/bisq/core/proto/persistable/CorePersistenceProtoResolver.java (3)
M core/src/main/java/bisq/core/trade/statistics/TradeStatistics2.java (4)
M p2p/src/test/java/bisq/network/p2p/TestUtils.java (8)
M proto/src/main/proto/pb.proto (2)
-- Patch Links --
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the bisq-github