From 166e33a637326bac1e77798460420cf1cb9bfeda Mon Sep 17 00:00:00 2001 From: jane rose Date: Thu, 24 Apr 2025 11:08:46 +0300 Subject: [PATCH] Add a global toggle key --- demo/App.config | 7 ++++++- demo/Program.cs | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/demo/App.config b/demo/App.config index bfe70c7..a13afe7 100644 --- a/demo/App.config +++ b/demo/App.config @@ -95,8 +95,13 @@ + + + + + - + \ No newline at end of file diff --git a/demo/Program.cs b/demo/Program.cs index 2a0236a..ac681fa 100644 --- a/demo/Program.cs +++ b/demo/Program.cs @@ -16,8 +16,12 @@ namespace ConsoleClient { internal sealed class Program - { - private static readonly ICoinService CoinService = new BitcoinService(useTestnet: true); + { + // Read 'UseTestnet' flag from App.config instead of hardcoding + private static readonly bool UseTestnet = bool.Parse(ConfigurationManager.AppSettings["UseTestnet"]); + + // Inject useTestnet setting into the BitcoinService + private static readonly ICoinService CoinService = new BitcoinService(useTestnet: UseTestnet); private static void Main() {