[bisq-network/bisq] Register dispute agents in apitest arbitrator daemon (#4462)

Stan notifications at github.com
Wed Sep 2 15:35:25 UTC 2020


@ghubstan commented on this pull request.



> +        this.keyRing = keyRing;
+        this.mediatorManager = mediatorManager;
+        this.refundAgentManager = refundAgentManager;
+        this.p2PService = p2PService;
+        setupListeners();
+    }
+
+    public Optional<Mediator> getMediator(NodeAddress nodeAddress) {
+        return mediatorManager.getDisputeAgentByNodeAddress(nodeAddress);
+    }
+
+    public Optional<RefundAgent> getRefundAgent(NodeAddress nodeAddress) {
+        return refundAgentManager.getDisputeAgentByNodeAddress(nodeAddress);
+    }
+
+    private boolean shouldRegisterTestArbitrationDisputeAgents() {

Until I write the API methods for registering dispute agents, it can only be done in the UI.  The test harness starts up supporting apps (bitcoind,seednode,arbnode,etc) in separate linux processes, so test cases can only change state in those supporting Bisq apps via the gRPC API.  I'm doing a little triage here, and writing gRPC API support for registering dispute agents from a CLI was moved to the back of the line.  Maybe that's a mistake, but this is my reasoning...

This odd class was a short cut for automatically registering dispute agents for api test cases only.  I did not want to automatically register dispute agents in any daemon but a test arb node.  On mainnet, a user should use the CLI to do this; during testing, a dev (or Travis CI) should not have to run a UI to register dispute agents during the dev/test cycle.

This is a short cut to getting a "simplest trading script" ready for demonstration -- but well tested, and without having to do anything in a UI.  I did not think that an arbitrator CLI + daemon would be in the scope of the "simplest trading script" work (maybe that was a mistake), and I intended to remove this test related code when I do build out the API to support arbitrator CLI + daemons.

It took much more time figuring out when dispute agents can be registered than coding this class.  If I had known already, I could have thought this through better than I did, and built the gRPC API support for registering dispute agents from a CLI instead of this temporary short cut.  If it's not acceptable, I can build the API support next, and remove this test code.

-- 
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/4462#discussion_r482167415
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200902/bd488478/attachment.html>


More information about the bisq-github mailing list