Conversation
|
Great, I think you should probably continue working on this in a separate branch for the time being. Are the build errors due to the required changes you refer to? |
| bitcoinNetwork = "StratisTest"; | ||
| else if (TumblerNetwork == Network.StratisRegTest) | ||
| bitcoinNetwork = "StratisRegTest"; | ||
| else if (TumblerNetwork == Network.Main) |
There was a problem hiding this comment.
Are we able to get the network name as a string in a cleaner way than checking against every type?
| { | ||
| var address = new Key().PubKey.GetAddress(network); | ||
| var isValid = ((JObject)rpcClient.SendCommand("validateaddress", address.ToString()).Result)["isvalid"].Value<bool>(); | ||
| var isValid = rpcClient.ValidateAddress(address).IsValid; |
| if (configFile.GetOrDefault<string>("network", "testnet").Equals("stratismain")) | ||
| { | ||
| TumblerNetwork = Network.StratisMain; | ||
| } |
There was a problem hiding this comment.
Shouldn't this be converted from 3 ifs to if->else if -> else if or for a cleaner code to a switch statement. There is no need to test all conditions if one of the succeeds
| else if (breezeConfig.TumblerNetwork == Network.StratisTest) | ||
| argsTemp.Add("-stratistest"); | ||
| else if (breezeConfig.TumblerNetwork == Network.StratisRegTest) | ||
| argsTemp.Add("-stratisregtest"); |
There was a problem hiding this comment.
Feels like we need some sort of extension method for a Network enum so that we can put that logic into one place and replace all this code with just argsTemp.Add(breezeConfig.TumblerNetwork.ToSuffix()) or something along those lines. Same for bitcoin network string above. Something like bitcoinNetwork = TumblerNetwork.ToNamedString() would be cleaner
ValidateAddress