From f6afb9a3f005cedc3ce4b1e40e258b7b450750af Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Fri, 26 Nov 2021 18:34:40 +0900 Subject: [PATCH] CheatMode should use NBXplorer RPC proxy rather than hardcoded client --- BTCPayServer.Tests/docker-compose.altcoins.yml | 1 + BTCPayServer.Tests/docker-compose.yml | 1 + BTCPayServer/Services/Cheater.cs | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/BTCPayServer.Tests/docker-compose.altcoins.yml b/BTCPayServer.Tests/docker-compose.altcoins.yml index dd628cf7d..c3e0e6485 100644 --- a/BTCPayServer.Tests/docker-compose.altcoins.yml +++ b/BTCPayServer.Tests/docker-compose.altcoins.yml @@ -115,6 +115,7 @@ services: NBXPLORER_MAXGAPSIZE: 10 NBXPLORER_VERBOSE: 1 NBXPLORER_NOAUTH: 1 + NBXPLORER_EXPOSERPC: 1 links: - bitcoind - litecoind diff --git a/BTCPayServer.Tests/docker-compose.yml b/BTCPayServer.Tests/docker-compose.yml index 6774630e5..6c139371d 100644 --- a/BTCPayServer.Tests/docker-compose.yml +++ b/BTCPayServer.Tests/docker-compose.yml @@ -103,6 +103,7 @@ services: NBXPLORER_MINGAPSIZE: 5 NBXPLORER_MAXGAPSIZE: 10 NBXPLORER_VERBOSE: 1 + NBXPLORER_EXPOSERPC: 1 NBXPLORER_NOAUTH: 1 links: - bitcoind diff --git a/BTCPayServer/Services/Cheater.cs b/BTCPayServer/Services/Cheater.cs index 9a988c9c2..e64967e44 100644 --- a/BTCPayServer/Services/Cheater.cs +++ b/BTCPayServer/Services/Cheater.cs @@ -15,9 +15,9 @@ namespace BTCPayServer.Services { private readonly ApplicationDbContextFactory _applicationDbContextFactory; - public Cheater(BTCPayServerOptions opts, ApplicationDbContextFactory applicationDbContextFactory) + public Cheater(BTCPayServerOptions opts, ExplorerClientProvider prov, ApplicationDbContextFactory applicationDbContextFactory) { - CashCow = new RPCClient(RPCCredentialString.Parse("server=http://127.0.0.1:43782;ceiwHEbqWI83:DwubwWsoo3"), Bitcoin.Instance.GetNetwork(opts.NetworkType)); + CashCow = prov.GetExplorerClient("BTC").RPCClient; _applicationDbContextFactory = applicationDbContextFactory; } public RPCClient CashCow