Remove some annoying warnings

This commit is contained in:
nicolas.dorier 2019-05-02 21:38:39 +09:00
parent a20db7f341
commit 7fadb4c5ad
3 changed files with 4 additions and 4 deletions

View file

@ -2639,7 +2639,7 @@ donation:
} }
}); });
Assert.Equal(1, invoice.SupportedTransactionCurrencies.Count); Assert.Single(invoice.SupportedTransactionCurrencies);
} }
} }

View file

@ -28,8 +28,8 @@ namespace BTCPayServer.Hosting
return JArray.Parse(content).OfType<JObject>() return JArray.Parse(content).OfType<JObject>()
.Select(jobj => new Bundle() .Select(jobj => new Bundle()
{ {
Name = jobj.Property("name")?.Value.Value<string>() ?? jobj.Property("outputFileName").Value.Value<string>(), Name = jobj.Property("name", StringComparison.OrdinalIgnoreCase)?.Value.Value<string>() ?? jobj.Property("outputFileName", StringComparison.OrdinalIgnoreCase).Value.Value<string>(),
OutputFileUrl = Path.Combine(hosting.ContentRootPath, jobj.Property("outputFileName").Value.Value<string>()) OutputFileUrl = Path.Combine(hosting.ContentRootPath, jobj.Property("outputFileName", StringComparison.OrdinalIgnoreCase).Value.Value<string>())
}).ToDictionary(o => o.Name, o => o); }).ToDictionary(o => o.Name, o => o);
} }
}, true); }, true);

View file

@ -118,7 +118,7 @@ namespace BTCPayServer.Services
if (network.NBitcoinNetwork.NetworkType == NetworkType.Mainnet) if (network.NBitcoinNetwork.NetworkType == NetworkType.Mainnet)
throw new Exception($"The opened ledger app does not seems to support {network.NBitcoinNetwork.Name}."); throw new Exception($"The opened ledger app does not seems to support {network.NBitcoinNetwork.Name}.");
} }
var fingerprint = onlyChaincode ? new byte[4] : (await ledger.GetWalletPubKeyAsync(account.Parent, cancellation: cancellation)).UncompressedPublicKey.Compress().Hash.ToBytes().Take(4).ToArray(); var fingerprint = onlyChaincode ? default : (await ledger.GetWalletPubKeyAsync(account.Parent, cancellation: cancellation)).UncompressedPublicKey.Compress().GetHDFingerPrint();
var extpubkey = new ExtPubKey(pubKey.UncompressedPublicKey.Compress(), pubKey.ChainCode, (byte)account.Indexes.Length, fingerprint, account.Indexes.Last()).GetWif(network.NBitcoinNetwork); var extpubkey = new ExtPubKey(pubKey.UncompressedPublicKey.Compress(), pubKey.ChainCode, (byte)account.Indexes.Length, fingerprint, account.Indexes.Last()).GetWif(network.NBitcoinNetwork);
return extpubkey; return extpubkey;
} }