[bisq-network/bisq] (5/4) Test P2PDataStore expiration code and make testing time sensitive code easier. (#3568)

Julian Knutsen notifications at github.com
Thu Nov 7 15:09:13 UTC 2019


julianknutsen commented on this pull request.



> @@ -41,25 +43,29 @@
     private int sequenceNumber;
     private byte[] signature;
     private long creationTimeStamp;
+    transient private final Clock clock;

There is an alternative here that doesn't involve storing the clock inside the data structure. The Public API methods that need a clock (ctor/refresh/backdate/isExpired) can take one as a parameter for the work they need individually. This will involve plumbing a Clock into OfferBookService, but that is easy enough.

The protobuf deserialization path still needs access to a clock, so it will still need the resolver instance where it can be used in maybeAdjustCreationTimeStamp().

If someone has a strong opinion on this or maybe @christophsturm can comment on what he envisioned with the clock injections throughout the code. I'd rather stick to a common pattern to make this work consistent in the future.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/3568#pullrequestreview-313407739
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191107/e57c76c6/attachment.html>


More information about the bisq-github mailing list