<p></p>
<p><b>@ghubstan</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/5103#discussion_r563895393">daemon/src/main/java/bisq/daemon/grpc/GrpcDisputeAgentsService.java</a>:</p>
<pre style='color:#555'>> +        Optional<ServerInterceptor> rateMeteringInterceptor = rateMeteringInterceptor();
+        return rateMeteringInterceptor.map(serverInterceptor ->
+                new ServerInterceptor[]{serverInterceptor}).orElseGet(() -> new ServerInterceptor[0]);
+    }
+
+    final Optional<ServerInterceptor> rateMeteringInterceptor() {
+        CallRateMeteringInterceptor defaultCallRateMeteringInterceptor =
+                new CallRateMeteringInterceptor(new HashMap<>() {{
+                    // You can only register mainnet dispute agents in the UI.
+                    // Do not limit devs' ability to register test agents.
+                    put("registerDisputeAgent", new GrpcCallRateMeter(1, SECONDS));
+                }});
+
+        return getCustomRateMeteringInterceptor(coreApi.getConfig().appDataDir, this.getClass())
+                .or(() -> Optional.of(defaultCallRateMeteringInterceptor));
+    }
</pre>
<p>But we could create an interceptor factory class to factor out some of the repetition.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/5103#discussion_r563895393">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNXYYSV27GN2AONO3XLS3WRJVANCNFSM4WOYERBA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNUF77T2OXPRP7DZIYLS3WRJVA5CNFSM4WOYERBKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOEJHUNHI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/5103#discussion_r563895393",
"url": "https://github.com/bisq-network/bisq/pull/5103#discussion_r563895393",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>