Fix some other null warnings
MODIFY
WalletWasabi.Tests/AcceptanceTests/HwiKatas.cs
WalletWasabi.Tests/AcceptanceTests/HwiKatas.cs
@@ -55,7 +55,7 @@ namespace WalletWasabi.Tests.AcceptanceTests
string devicePath = entry.Path;
HardwareWalletModels deviceType = entry.Model;
- HDFingerprint fingerprint = entry.Fingerprint.Value;
+ HDFingerprint fingerprint = entry.Fingerprint!.Value;
await Assert.ThrowsAsync<HwiException>(async () => await client.SetupAsync(deviceType, devicePath, false, cts.Token));
@@ -157,7 +157,7 @@ namespace WalletWasabi.Tests.AcceptanceTests
string devicePath = entry.Path;
HardwareWalletModels deviceType = entry.Model;
- HDFingerprint fingerprint = entry.Fingerprint.Value;
+ HDFingerprint fingerprint = entry.Fingerprint!.Value;
// ColdCard doesn't support it.
await Assert.ThrowsAsync<HwiException>(async () => await client.WipeAsync(deviceType, devicePath, cts.Token));
@@ -243,7 +243,7 @@ namespace WalletWasabi.Tests.AcceptanceTests
string devicePath = entry.Path;
HardwareWalletModels deviceType = entry.Model;
- HDFingerprint fingerprint = entry.Fingerprint.Value;
+ HDFingerprint fingerprint = entry.Fingerprint!.Value;
await Assert.ThrowsAsync<HwiException>(async () => await client.SetupAsync(deviceType, devicePath, false, cts.Token));
@@ -326,7 +326,7 @@ namespace WalletWasabi.Tests.AcceptanceTests
string devicePath = entry.Path;
HardwareWalletModels deviceType = entry.Model;
- HDFingerprint fingerprint = entry.Fingerprint.Value;
+ HDFingerprint fingerprint = entry.Fingerprint!.Value;
await Assert.ThrowsAsync<HwiException>(async () => await client.SetupAsync(deviceType, devicePath, false, cts.Token));

MODIFY
WalletWasabi.Tests/RegressionTests/CoinJoinTests.cs
WalletWasabi.Tests/RegressionTests/CoinJoinTests.cs
@@ -141,9 +141,9 @@ namespace WalletWasabi.Tests.RegressionTests
// Inputs request tests
var inputsRequest = new InputsRequest4
{
- BlindedOutputScripts = null,
- ChangeOutputAddress = null,
- Inputs = null,
+ BlindedOutputScripts = null!, // null is not allowed and that's what want here: try with invalid requests.
+ ChangeOutputAddress = null!,
+ Inputs = null!,
};
Assert.True(coordinator.TryGetCurrentInputRegisterableRound(out CoordinatorRound? round));
@@ -215,7 +215,7 @@ namespace WalletWasabi.Tests.RegressionTests
Assert.True(coordinator.TryGetCurrentInputRegisterableRound(out round));
var requester = new Requester();
uint256 msg = new(NBitcoin.Crypto.Hashes.SHA256(network.Consensus.ConsensusFactory.CreateTransaction().ToBytes()));
- var nonce = round.NonceProvider.GetNextNonce();
+ var nonce = round!.NonceProvider.GetNextNonce();
BlindedOutputWithNonceIndex blindedData = new(nonce.N, requester.BlindMessage(msg, nonce.R, round.MixingLevels.GetBaseLevel().SignerKey.PubKey));
inputsRequest.BlindedOutputScripts = new[] { blindedData };
uint256 blindedOutputScriptsHash = new(NBitcoin.Crypto.Hashes.SHA256(blindedData.BlindedOutput.ToBytes()));
@@ -230,7 +230,7 @@ namespace WalletWasabi.Tests.RegressionTests
coordinator.AbortAllRoundsInInputRegistration("");
await Task.Delay(200).ConfigureAwait(false);
Assert.True(coordinator.TryGetCurrentInputRegisterableRound(out round));
- roundId = round.RoundId;
+ roundId = round!.RoundId;
inputsRequest.RoundId = roundId;
signerPubKeys = round.MixingLevels.SignerPubKeys;
httpRequestException = await Assert.ThrowsAsync<HttpRequestException>(async () => await CreateNewAliceClientAsync(roundId, registeredAddresses, signerPubKeys, requesters, inputsRequest));
@@ -689,7 +689,10 @@ namespace WalletWasabi.Tests.RegressionTests
await aliceClient1.PostSignaturesAsync(myDic1);
await aliceClient2.PostSignaturesAsync(myDic2);
- ((CachedRpcClient)rpc)?.Cache.Remove("GetRawMempoolAsync");
+ if (rpc is CachedRpcClient cachedRpc)
+ {
+ cachedRpc.Cache.Remove("GetRawMempoolAsync");
+ }
uint256[] mempooltxs = await rpc.GetRawMempoolAsync();
Assert.Contains(unsignedCoinJoin.GetHash(), mempooltxs);
@@ -948,7 +951,7 @@ namespace WalletWasabi.Tests.RegressionTests
}
long roundId = 0;
- var users = new List<(Requester requester, BlindedOutputWithNonceIndex blinded, BitcoinAddress activeOutputAddress, BitcoinAddress changeOutputAddress, IEnumerable<InputProofModel> inputProofModels, List<(Key key, BitcoinAddress address, uint256 txHash, Transaction tx, OutPoint input)> userInputData, AliceClient4 aliceClient, UnblindedSignature unblindedSignature)>();
+ var users = new List<(Requester requester, BlindedOutputWithNonceIndex blinded, BitcoinAddress activeOutputAddress, BitcoinAddress changeOutputAddress, IEnumerable<InputProofModel> inputProofModels, List<(Key key, BitcoinAddress address, uint256 txHash, Transaction tx, OutPoint input)> userInputData, AliceClient4 aliceClient)>();
for (int i = 0; i < inputRegistrationUsers.Count; i++)
{
var user = inputRegistrationUsers[i];
@@ -964,7 +967,7 @@ namespace WalletWasabi.Tests.RegressionTests
Assert.Equal(roundId, aliceClient.RoundId);
}
// Because it's valuetuple.
- users.Add((user.requester, user.blinded, user.activeOutputAddress, user.changeOutputAddress, user.inputProofModels, user.userInputData, aliceClient, null));
+ users.Add((user.requester, user.blinded, user.activeOutputAddress, user.changeOutputAddress, user.inputProofModels, user.userInputData, aliceClient));
}
Logger.TurnOn();
@@ -979,6 +982,7 @@ namespace WalletWasabi.Tests.RegressionTests
RoundPhase roundPhase = RoundPhase.InputRegistration;
int k = 0;
+ var usersWithSignatures = new List<(Requester requester, BlindedOutputWithNonceIndex blinded, BitcoinAddress activeOutputAddress, BitcoinAddress changeOutputAddress, IEnumerable<InputProofModel> inputProofModels, List<(Key key, BitcoinAddress address, uint256 txHash, Transaction tx, OutPoint input)> userInputData, AliceClient4 aliceClient, UnblindedSignature unblindedSignature)>();
foreach (var request in confirmationRequests)
{
var resp = await request;
@@ -993,12 +997,11 @@ namespace WalletWasabi.Tests.RegressionTests
// Because it's valuetuple.
var user = users.ElementAt(k);
- users.RemoveAt(k);
- users.Add((user.requester, user.blinded, user.activeOutputAddress, user.changeOutputAddress, user.inputProofModels, user.userInputData, user.aliceClient, resp.Item2.First().Signature));
+ usersWithSignatures.Add((user.requester, user.blinded, user.activeOutputAddress, user.changeOutputAddress, user.inputProofModels, user.userInputData, user.aliceClient, resp.Item2.First().Signature));
}
var outputRequests = new List<Task>();
- foreach (var user in users)
+ foreach (var user in usersWithSignatures)
{
var bobClient = new BobClient(BackendClearnetHttpClient);
outputRequests.Add(bobClient.PostOutputAsync(roundId, new ActiveOutput(user.activeOutputAddress, user.unblindedSignature, 0)));
@@ -1010,7 +1013,7 @@ namespace WalletWasabi.Tests.RegressionTests
}
var coinjoinRequests = new List<Task<Transaction>>();
- foreach (var user in users)
+ foreach (var user in usersWithSignatures)
{
coinjoinRequests.Add(user.aliceClient.GetUnsignedCoinJoinAsync());
}
@@ -1020,7 +1023,7 @@ namespace WalletWasabi.Tests.RegressionTests
Assert.All(coinjoinRequests, async x => Assert.Equal(unsignedCoinJoinHex, (await x).ToHex()));
var signatureRequests = new List<Task>();
- foreach (var user in users)
+ foreach (var user in usersWithSignatures)
{
var partSignedCj = Transaction.Parse(unsignedCoinJoinHex, network);
partSignedCj.Sign(
@@ -1047,7 +1050,10 @@ namespace WalletWasabi.Tests.RegressionTests
await Task.WhenAll(signatureRequests);
- ((CachedRpcClient)rpc)?.Cache.Remove("GetRawMempoolAsync");
+ if (rpc is CachedRpcClient cachedRpc)
+ {
+ cachedRpc.Cache.Remove("GetRawMempoolAsync");
+ }
uint256[] mempooltxs = await rpc.GetRawMempoolAsync();
Assert.Contains(unsignedCoinJoin.GetHash(), mempooltxs);

MODIFY
WalletWasabi.Tests/RegressionTests/DosTests.cs
WalletWasabi.Tests/RegressionTests/DosTests.cs
@@ -125,7 +125,7 @@ namespace WalletWasabi.Tests.RegressionTests
foreach (var user in inputRegistrationUsers)
{
- aliceClients.Add(AliceClientBase.CreateNewAsync(round.RoundId, new[] { user.activeOutputAddress }, new[] { round.MixingLevels.GetBaseLevel().SignerKey.PubKey }, new[] { user.requester }, network, user.changeOutputAddress, new[] { user.blinded }, user.inputProofModels, BackendHttpClient));
+ aliceClients.Add(AliceClientBase.CreateNewAsync(round!.RoundId, new[] { user.activeOutputAddress }, new[] { round!.MixingLevels.GetBaseLevel().SignerKey.PubKey }, new[] { user.requester }, network, user.changeOutputAddress, new[] { user.blinded }, user.inputProofModels, BackendHttpClient));
}
long roundId = 0;
@@ -147,7 +147,7 @@ namespace WalletWasabi.Tests.RegressionTests
}
// Because it's a value tuple.
- users.Add((user.requester, user.blinded, user.activeOutputAddress, user.changeOutputAddress, user.inputProofModels, user.userInputData, aliceClient, null));
+ users.Add((user.requester, user.blinded, user.activeOutputAddress, user.changeOutputAddress, user.inputProofModels, user.userInputData, aliceClient, null!));
}
Assert.Equal(users.Count, roundConfig.AnonymitySet);
@@ -218,7 +218,7 @@ namespace WalletWasabi.Tests.RegressionTests
}
// Because it's a value tuple.
- users.Add((user.requester, user.blinded, user.activeOutputAddress, user.changeOutputAddress, user.inputProofModels, user.userInputData, aliceClient, null));
+ users.Add((user.requester, user.blinded, user.activeOutputAddress, user.changeOutputAddress, user.inputProofModels, user.userInputData, aliceClient, null!));
}
Assert.Equal(users.Count, roundConfig.AnonymitySet);
@@ -306,7 +306,7 @@ namespace WalletWasabi.Tests.RegressionTests
foreach (var registerRequest in registerRequests)
{
- await AliceClientBase.CreateNewAsync(round!.RoundId, aliceClientBackup.RegisteredAddresses, round.MixingLevels.GetAllLevels().Select(x => x.SignerKey.PubKey), aliceClientBackup.Requesters, network, registerRequest.changeOutputAddress, new[] { registerRequest.blindedData }, registerRequest.inputsProofs, BackendHttpClient);
+ await AliceClientBase.CreateNewAsync(round!.RoundId, aliceClientBackup!.RegisteredAddresses, round.MixingLevels.GetAllLevels().Select(x => x.SignerKey.PubKey), aliceClientBackup.Requesters, network, registerRequest.changeOutputAddress, new[] { registerRequest.blindedData }, registerRequest.inputsProofs, BackendHttpClient);
}
await WaitForTimeoutAsync();

MODIFY
WalletWasabi.Tests/RpcTests.cs
WalletWasabi.Tests/RpcTests.cs
@@ -17,7 +17,7 @@ namespace WalletWasabi.Tests
{
"Invalid (broken) request",
Request("1", "substract").Replace("\"id\":", "\"id\","),
- Error(null, -32700, "Parse error")
+ Error(null!, -32700, "Parse error")
},
new[]
{
@@ -29,7 +29,7 @@ namespace WalletWasabi.Tests
{
"Invalid (missing method) request",
Request("1", "", "[42, 23]").Replace("\"method\":\"\",", ""),
- Error(null, -32700, "Parse error")
+ Error(null!, -32700, "Parse error")
},
new[]
{
@@ -58,20 +58,20 @@ namespace WalletWasabi.Tests
new[]
{
"Valid request (Notification)",
- Request(null, "substract", 42, 23),
+ Request(null!, "substract", 42, 23),
""
},
new[]
{
"Valid request for void procedure",
Request("log-id-01", "writelog", "blah blah blah" ),
- Ok("log-id-01", null)
+ Ok("log-id-01", null!)
},
new[]
{
"Valid request for async procedure with cancellation token",
Request("1", "format", "c:" ),
- Ok("1", null)
+ Ok("1", null!)
},
new[]
{

MODIFY
WalletWasabi.Tests/TestableRpcService.cs
WalletWasabi.Tests/TestableRpcService.cs
@@ -33,7 +33,7 @@ namespace WalletWasabi.Tests
{
Unused(unit);
Unused(ct);
- await Task.FromResult((JsonRpcResponse)null);
+ await Task.FromResult<JsonRpcResponse>(null!);
}
private void Unused(object item)

MODIFY
WalletWasabi.Tests/UnitTests/Clients/WasabiClientTests.cs
WalletWasabi.Tests/UnitTests/Clients/WasabiClientTests.cs
@@ -33,7 +33,7 @@ namespace WalletWasabi.Tests.UnitTests.Clients
Assert.True(parameters.Count <= 10);
- IEnumerable<uint256> requestedTxIds = parameters["transactionIds"].Split(",").Select(x => uint256.Parse(x));
+ IEnumerable<uint256> requestedTxIds = parameters["transactionIds"]!.Split(",").Select(x => uint256.Parse(x));
IEnumerable<string> result = mempool.Where(tx => requestedTxIds.Contains(tx.GetHash())).Select(tx => tx.ToHex());
var response = new HttpResponseMessage(HttpStatusCode.OK);

MODIFY
WalletWasabi.Tests/UnitTests/Crypto/StrobeTests.cs
WalletWasabi.Tests/UnitTests/Crypto/StrobeTests.cs
@@ -102,8 +102,9 @@ namespace WalletWasabi.Tests.UnitTests.Crypto
var testVectorFile = File.ReadAllText("./UnitTests/Data/StrobeTestVectors.json");
var testSet = JsonConvert.DeserializeObject<StrobeTestSet>(testVectorFile);
+ Assert.NotNull(testSet);
// return all test vectors except the one for streaming because it is not implemented.
- foreach (var vector in testSet.TestVectors.Where(x => !x.Name.Contains("streaming")))
+ foreach (var vector in testSet!.TestVectors.Where(x => !x.Name.Contains("streaming")))
{
yield return new object[] { vector };
}

MODIFY
WalletWasabi.Tests/UnitTests/ListExtensionTests.cs
WalletWasabi.Tests/UnitTests/ListExtensionTests.cs
@@ -73,9 +73,10 @@ namespace WalletWasabi.Tests.UnitTests
public int Value { get; }
- public int CompareTo([AllowNull] ReverseComparable other)
+ public int CompareTo(ReverseComparable? other)
{
- return other.Value.CompareTo(Value);
+ var nonNullOther = other ?? throw new ArgumentNullException(nameof(other));
+ return nonNullOther.Value.CompareTo(Value);
}
}
}

MODIFY
WalletWasabi.Tests/UnitTests/Transactions/AllTransactionStoreTests.cs
WalletWasabi.Tests/UnitTests/Transactions/AllTransactionStoreTests.cs
@@ -475,18 +475,19 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
Assert.Empty(reorgedTxs);
// reorgs most recent block
- reorgedTxs = txStore.ReleaseToMempoolFromBlock(newestConfirmedTx.BlockHash);
+ Assert.NotNull(tipHash);
+ reorgedTxs = txStore.ReleaseToMempoolFromBlock(tipHash!);
Assert.Equal(3, reorgedTxs.Count());
Assert.All(reorgedTxs, tx => Assert.False(tx?.Confirmed));
Assert.All(reorgedTxs, tx => Assert.True(txStore.TryGetTransaction(tx.GetHash(), out _)));
- Assert.False(txStore.TryGetTransaction(tipHash, out _));
+ Assert.False(txStore.TryGetTransaction(tipHash!, out _));
Assert.DoesNotContain(tipHash, txStore.GetTransactionHashes());
// reorgs the same block again
- reorgedTxs = txStore.ReleaseToMempoolFromBlock(newestConfirmedTx.BlockHash);
+ reorgedTxs = txStore.ReleaseToMempoolFromBlock(tipHash!);
Assert.Empty(reorgedTxs);
- Assert.False(txStore.TryGetTransaction(tipHash, out _));
+ Assert.False(txStore.TryGetTransaction(tipHash!, out _));
Assert.DoesNotContain(tipHash, txStore.GetTransactionHashes());
// reorgs deep block
@@ -494,7 +495,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
var firstBlockHash = oldestConfirmedTx.BlockHash;
// What to do here
- reorgedTxs = txStore.ReleaseToMempoolFromBlock(firstBlockHash);
+ reorgedTxs = txStore.ReleaseToMempoolFromBlock(firstBlockHash!);
Assert.NotEmpty(reorgedTxs);
}
}

MODIFY
WalletWasabi.Tests/UnitTests/Transactions/SmartTransactionTests.cs
WalletWasabi.Tests/UnitTests/Transactions/SmartTransactionTests.cs
@@ -58,8 +58,9 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
var serialized3 = JsonConvert.SerializeObject(smartTx3);
var deserialized3 = JsonConvert.DeserializeObject<SmartTransaction>(serialized3);
+ Assert.NotNull(deserialized);
Assert.Equal(smartTx, deserialized);
- Assert.Equal(smartTx.Height, deserialized.Height);
+ Assert.Equal(smartTx.Height, deserialized!.Height);
Assert.Equal(deserialized, deserialized2);
Assert.Equal(deserialized, deserialized3);
@@ -68,7 +69,8 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
var serializedWithoutLabel = "{\"Transaction\":\"02000000040aa8d0af84518df6e3a60c5bb19d9c3fcc3dc6e26b2f2449e8d7bf8d3fe84b87010000006a473044022018dfe9216c1209dd6c2b6c1607dbac4e499c1fce4878bc7d5d83fccbf3e24c9402202cac351c9c6a2b5eef338cbf0ec000d8de1c05e96a904cbba2b9e6ffc2d4e19501210364cc39da1091b1a9c12ec905a14a9e8478f951f7a1accdabeb40180533f2eaa5feffffff112c07d0f5e0617d720534f0b2b84dc0d5b7314b358c3ab338823b9e5bfbddf5010000006b483045022100ec155e7141e74661ee511ae980150a6c89261f31070999858738369afc28f2b6022006230d2aa24fac110b74ef15b84371486cf76c539b335a253c14462447912a300121020c2f41390f031d471b22abdb856e6cdbe0f4d74e72c197469bfd54e5a08f7e67feffffff38e799b8f6cf04fd021a9b135cdcd347da7aac4fd8bb8d0da9316a9fb228bb6e000000006b483045022100fc1944544a3f96edd8c8a9795c691e2725612b5ab2e1c999be11a2a4e3f841f1022077b2e088877829edeada0c707a9bb577aa79f26dafacba3d1d2d047f52524296012102e6015963dff9826836400cf8f45597c0705757d5dcdc6bf734f661c7dab89e69feffffff64c3f0377e86625123f2f1ee229319ed238e8ca8b7dda5bc080a2c5ecb984629000000006a47304402204233a90d6296182914424fd2901e16e6f5b13b451b67b0eec25a5eaacc5033c902203d8a13ef0b494c12009663475458e51da6bd55cc67688264230ece81d3eeca24012102f806d7152da2b52c1d9ad928e4a6253ccba080a5b9ab9efdd80e37274ac67f9bfeffffff0290406900000000001976a91491ac4e49b66f845180d98d8f8be6121588be6e3b88ac52371600000000001976a9142f44ed6749e8c84fd476e4440741f7e6f55542fa88acadd30700\",\"Height\":\"2147483646\"}";
var deserializedWithoutLabel = JsonConvert.DeserializeObject<SmartTransaction>(serializedWithoutLabel);
- Assert.True(deserializedWithoutLabel.Label.IsEmpty);
+ Assert.NotNull(deserializedWithoutLabel);
+ Assert.True(deserializedWithoutLabel!.Label.IsEmpty);
}
[Fact]
@@ -82,42 +84,43 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
// FirstSeenIfMempoolTime is null.
var serialized = "{\"FirstSeenIfMempoolTime\": null, \"Transaction\":\"02000000040aa8d0af84518df6e3a60c5bb19d9c3fcc3dc6e26b2f2449e8d7bf8d3fe84b87010000006a473044022018dfe9216c1209dd6c2b6c1607dbac4e499c1fce4878bc7d5d83fccbf3e24c9402202cac351c9c6a2b5eef338cbf0ec000d8de1c05e96a904cbba2b9e6ffc2d4e19501210364cc39da1091b1a9c12ec905a14a9e8478f951f7a1accdabeb40180533f2eaa5feffffff112c07d0f5e0617d720534f0b2b84dc0d5b7314b358c3ab338823b9e5bfbddf5010000006b483045022100ec155e7141e74661ee511ae980150a6c89261f31070999858738369afc28f2b6022006230d2aa24fac110b74ef15b84371486cf76c539b335a253c14462447912a300121020c2f41390f031d471b22abdb856e6cdbe0f4d74e72c197469bfd54e5a08f7e67feffffff38e799b8f6cf04fd021a9b135cdcd347da7aac4fd8bb8d0da9316a9fb228bb6e000000006b483045022100fc1944544a3f96edd8c8a9795c691e2725612b5ab2e1c999be11a2a4e3f841f1022077b2e088877829edeada0c707a9bb577aa79f26dafacba3d1d2d047f52524296012102e6015963dff9826836400cf8f45597c0705757d5dcdc6bf734f661c7dab89e69feffffff64c3f0377e86625123f2f1ee229319ed238e8ca8b7dda5bc080a2c5ecb984629000000006a47304402204233a90d6296182914424fd2901e16e6f5b13b451b67b0eec25a5eaacc5033c902203d8a13ef0b494c12009663475458e51da6bd55cc67688264230ece81d3eeca24012102f806d7152da2b52c1d9ad928e4a6253ccba080a5b9ab9efdd80e37274ac67f9bfeffffff0290406900000000001976a91491ac4e49b66f845180d98d8f8be6121588be6e3b88ac52371600000000001976a9142f44ed6749e8c84fd476e4440741f7e6f55542fa88acadd30700\",\"Height\":\"2147483646\"}";
var deserialized = JsonConvert.DeserializeObject<SmartTransaction>(serialized);
- Assert.Equal(now.UtcDateTime, deserialized.FirstSeen.UtcDateTime, TimeSpan.FromSeconds(1));
+ Assert.NotNull(deserialized);
+ Assert.Equal(now.UtcDateTime, deserialized!.FirstSeen.UtcDateTime, TimeSpan.FromSeconds(1));
// FirstSeenIfMempoolTime is empty.
serialized = "{\"FirstSeenIfMempoolTime\": \"\", \"Transaction\":\"02000000040aa8d0af84518df6e3a60c5bb19d9c3fcc3dc6e26b2f2449e8d7bf8d3fe84b87010000006a473044022018dfe9216c1209dd6c2b6c1607dbac4e499c1fce4878bc7d5d83fccbf3e24c9402202cac351c9c6a2b5eef338cbf0ec000d8de1c05e96a904cbba2b9e6ffc2d4e19501210364cc39da1091b1a9c12ec905a14a9e8478f951f7a1accdabeb40180533f2eaa5feffffff112c07d0f5e0617d720534f0b2b84dc0d5b7314b358c3ab338823b9e5bfbddf5010000006b483045022100ec155e7141e74661ee511ae980150a6c89261f31070999858738369afc28f2b6022006230d2aa24fac110b74ef15b84371486cf76c539b335a253c14462447912a300121020c2f41390f031d471b22abdb856e6cdbe0f4d74e72c197469bfd54e5a08f7e67feffffff38e799b8f6cf04fd021a9b135cdcd347da7aac4fd8bb8d0da9316a9fb228bb6e000000006b483045022100fc1944544a3f96edd8c8a9795c691e2725612b5ab2e1c999be11a2a4e3f841f1022077b2e088877829edeada0c707a9bb577aa79f26dafacba3d1d2d047f52524296012102e6015963dff9826836400cf8f45597c0705757d5dcdc6bf734f661c7dab89e69feffffff64c3f0377e86625123f2f1ee229319ed238e8ca8b7dda5bc080a2c5ecb984629000000006a47304402204233a90d6296182914424fd2901e16e6f5b13b451b67b0eec25a5eaacc5033c902203d8a13ef0b494c12009663475458e51da6bd55cc67688264230ece81d3eeca24012102f806d7152da2b52c1d9ad928e4a6253ccba080a5b9ab9efdd80e37274ac67f9bfeffffff0290406900000000001976a91491ac4e49b66f845180d98d8f8be6121588be6e3b88ac52371600000000001976a9142f44ed6749e8c84fd476e4440741f7e6f55542fa88acadd30700\",\"Height\":\"2147483646\"}";
deserialized = JsonConvert.DeserializeObject<SmartTransaction>(serialized);
- Assert.Equal(now.UtcDateTime, deserialized.FirstSeen.UtcDateTime, TimeSpan.FromSeconds(1));
+ Assert.Equal(now.UtcDateTime, deserialized!.FirstSeen.UtcDateTime, TimeSpan.FromSeconds(1));
// FirstSeenIfMempoolTime is value.
serialized = "{\"FirstSeenIfMempoolTime\": \"" + twoThousandEight.ToString(CultureInfo.InvariantCulture) + "\", \"Transaction\":\"02000000040aa8d0af84518df6e3a60c5bb19d9c3fcc3dc6e26b2f2449e8d7bf8d3fe84b87010000006a473044022018dfe9216c1209dd6c2b6c1607dbac4e499c1fce4878bc7d5d83fccbf3e24c9402202cac351c9c6a2b5eef338cbf0ec000d8de1c05e96a904cbba2b9e6ffc2d4e19501210364cc39da1091b1a9c12ec905a14a9e8478f951f7a1accdabeb40180533f2eaa5feffffff112c07d0f5e0617d720534f0b2b84dc0d5b7314b358c3ab338823b9e5bfbddf5010000006b483045022100ec155e7141e74661ee511ae980150a6c89261f31070999858738369afc28f2b6022006230d2aa24fac110b74ef15b84371486cf76c539b335a253c14462447912a300121020c2f41390f031d471b22abdb856e6cdbe0f4d74e72c197469bfd54e5a08f7e67feffffff38e799b8f6cf04fd021a9b135cdcd347da7aac4fd8bb8d0da9316a9fb228bb6e000000006b483045022100fc1944544a3f96edd8c8a9795c691e2725612b5ab2e1c999be11a2a4e3f841f1022077b2e088877829edeada0c707a9bb577aa79f26dafacba3d1d2d047f52524296012102e6015963dff9826836400cf8f45597c0705757d5dcdc6bf734f661c7dab89e69feffffff64c3f0377e86625123f2f1ee229319ed238e8ca8b7dda5bc080a2c5ecb984629000000006a47304402204233a90d6296182914424fd2901e16e6f5b13b451b67b0eec25a5eaacc5033c902203d8a13ef0b494c12009663475458e51da6bd55cc67688264230ece81d3eeca24012102f806d7152da2b52c1d9ad928e4a6253ccba080a5b9ab9efdd80e37274ac67f9bfeffffff0290406900000000001976a91491ac4e49b66f845180d98d8f8be6121588be6e3b88ac52371600000000001976a9142f44ed6749e8c84fd476e4440741f7e6f55542fa88acadd30700\",\"Height\":\"2147483646\"}";
deserialized = JsonConvert.DeserializeObject<SmartTransaction>(serialized);
- Assert.Equal(twoThousandEight.UtcDateTime, deserialized.FirstSeen.UtcDateTime, TimeSpan.FromSeconds(1));
+ Assert.Equal(twoThousandEight.UtcDateTime, deserialized!.FirstSeen.UtcDateTime, TimeSpan.FromSeconds(1));
// FirstSeen is null.
serialized = "{\"FirstSeen\": \"" + twoThousandEight.ToUnixTimeSeconds() + "\", \"Transaction\":\"02000000040aa8d0af84518df6e3a60c5bb19d9c3fcc3dc6e26b2f2449e8d7bf8d3fe84b87010000006a473044022018dfe9216c1209dd6c2b6c1607dbac4e499c1fce4878bc7d5d83fccbf3e24c9402202cac351c9c6a2b5eef338cbf0ec000d8de1c05e96a904cbba2b9e6ffc2d4e19501210364cc39da1091b1a9c12ec905a14a9e8478f951f7a1accdabeb40180533f2eaa5feffffff112c07d0f5e0617d720534f0b2b84dc0d5b7314b358c3ab338823b9e5bfbddf5010000006b483045022100ec155e7141e74661ee511ae980150a6c89261f31070999858738369afc28f2b6022006230d2aa24fac110b74ef15b84371486cf76c539b335a253c14462447912a300121020c2f41390f031d471b22abdb856e6cdbe0f4d74e72c197469bfd54e5a08f7e67feffffff38e799b8f6cf04fd021a9b135cdcd347da7aac4fd8bb8d0da9316a9fb228bb6e000000006b483045022100fc1944544a3f96edd8c8a9795c691e2725612b5ab2e1c999be11a2a4e3f841f1022077b2e088877829edeada0c707a9bb577aa79f26dafacba3d1d2d047f52524296012102e6015963dff9826836400cf8f45597c0705757d5dcdc6bf734f661c7dab89e69feffffff64c3f0377e86625123f2f1ee229319ed238e8ca8b7dda5bc080a2c5ecb984629000000006a47304402204233a90d6296182914424fd2901e16e6f5b13b451b67b0eec25a5eaacc5033c902203d8a13ef0b494c12009663475458e51da6bd55cc67688264230ece81d3eeca24012102f806d7152da2b52c1d9ad928e4a6253ccba080a5b9ab9efdd80e37274ac67f9bfeffffff0290406900000000001976a91491ac4e49b66f845180d98d8f8be6121588be6e3b88ac52371600000000001976a9142f44ed6749e8c84fd476e4440741f7e6f55542fa88acadd30700\",\"Height\":\"2147483646\"}";
deserialized = JsonConvert.DeserializeObject<SmartTransaction>(serialized);
- Assert.Equal(twoThousandEight.UtcDateTime, deserialized.FirstSeen.UtcDateTime, TimeSpan.FromSeconds(1));
+ Assert.Equal(twoThousandEight.UtcDateTime, deserialized!.FirstSeen.UtcDateTime, TimeSpan.FromSeconds(1));
// FirstSeen is empty.
serialized = "{\"FirstSeen\": \"\", \"Transaction\":\"02000000040aa8d0af84518df6e3a60c5bb19d9c3fcc3dc6e26b2f2449e8d7bf8d3fe84b87010000006a473044022018dfe9216c1209dd6c2b6c1607dbac4e499c1fce4878bc7d5d83fccbf3e24c9402202cac351c9c6a2b5eef338cbf0ec000d8de1c05e96a904cbba2b9e6ffc2d4e19501210364cc39da1091b1a9c12ec905a14a9e8478f951f7a1accdabeb40180533f2eaa5feffffff112c07d0f5e0617d720534f0b2b84dc0d5b7314b358c3ab338823b9e5bfbddf5010000006b483045022100ec155e7141e74661ee511ae980150a6c89261f31070999858738369afc28f2b6022006230d2aa24fac110b74ef15b84371486cf76c539b335a253c14462447912a300121020c2f41390f031d471b22abdb856e6cdbe0f4d74e72c197469bfd54e5a08f7e67feffffff38e799b8f6cf04fd021a9b135cdcd347da7aac4fd8bb8d0da9316a9fb228bb6e000000006b483045022100fc1944544a3f96edd8c8a9795c691e2725612b5ab2e1c999be11a2a4e3f841f1022077b2e088877829edeada0c707a9bb577aa79f26dafacba3d1d2d047f52524296012102e6015963dff9826836400cf8f45597c0705757d5dcdc6bf734f661c7dab89e69feffffff64c3f0377e86625123f2f1ee229319ed238e8ca8b7dda5bc080a2c5ecb984629000000006a47304402204233a90d6296182914424fd2901e16e6f5b13b451b67b0eec25a5eaacc5033c902203d8a13ef0b494c12009663475458e51da6bd55cc67688264230ece81d3eeca24012102f806d7152da2b52c1d9ad928e4a6253ccba080a5b9ab9efdd80e37274ac67f9bfeffffff0290406900000000001976a91491ac4e49b66f845180d98d8f8be6121588be6e3b88ac52371600000000001976a9142f44ed6749e8c84fd476e4440741f7e6f55542fa88acadd30700\",\"Height\":\"2147483646\"}";
deserialized = JsonConvert.DeserializeObject<SmartTransaction>(serialized);
- Assert.Equal(now.UtcDateTime, deserialized.FirstSeen.UtcDateTime, TimeSpan.FromSeconds(1));
+ Assert.Equal(now.UtcDateTime, deserialized!.FirstSeen.UtcDateTime, TimeSpan.FromSeconds(1));
// FirstSeen is real value.
serialized = "{\"FirstSeen\": \"" + twoThousandEight.ToUnixTimeSeconds() + "\", \"Transaction\":\"02000000040aa8d0af84518df6e3a60c5bb19d9c3fcc3dc6e26b2f2449e8d7bf8d3fe84b87010000006a473044022018dfe9216c1209dd6c2b6c1607dbac4e499c1fce4878bc7d5d83fccbf3e24c9402202cac351c9c6a2b5eef338cbf0ec000d8de1c05e96a904cbba2b9e6ffc2d4e19501210364cc39da1091b1a9c12ec905a14a9e8478f951f7a1accdabeb40180533f2eaa5feffffff112c07d0f5e0617d720534f0b2b84dc0d5b7314b358c3ab338823b9e5bfbddf5010000006b483045022100ec155e7141e74661ee511ae980150a6c89261f31070999858738369afc28f2b6022006230d2aa24fac110b74ef15b84371486cf76c539b335a253c14462447912a300121020c2f41390f031d471b22abdb856e6cdbe0f4d74e72c197469bfd54e5a08f7e67feffffff38e799b8f6cf04fd021a9b135cdcd347da7aac4fd8bb8d0da9316a9fb228bb6e000000006b483045022100fc1944544a3f96edd8c8a9795c691e2725612b5ab2e1c999be11a2a4e3f841f1022077b2e088877829edeada0c707a9bb577aa79f26dafacba3d1d2d047f52524296012102e6015963dff9826836400cf8f45597c0705757d5dcdc6bf734f661c7dab89e69feffffff64c3f0377e86625123f2f1ee229319ed238e8ca8b7dda5bc080a2c5ecb984629000000006a47304402204233a90d6296182914424fd2901e16e6f5b13b451b67b0eec25a5eaacc5033c902203d8a13ef0b494c12009663475458e51da6bd55cc67688264230ece81d3eeca24012102f806d7152da2b52c1d9ad928e4a6253ccba080a5b9ab9efdd80e37274ac67f9bfeffffff0290406900000000001976a91491ac4e49b66f845180d98d8f8be6121588be6e3b88ac52371600000000001976a9142f44ed6749e8c84fd476e4440741f7e6f55542fa88acadd30700\",\"Height\":\"2147483646\"}";
deserialized = JsonConvert.DeserializeObject<SmartTransaction>(serialized);
- Assert.Equal(twoThousandEight.UtcDateTime, deserialized.FirstSeen.UtcDateTime, TimeSpan.FromSeconds(1));
+ Assert.Equal(twoThousandEight.UtcDateTime, deserialized!.FirstSeen.UtcDateTime, TimeSpan.FromSeconds(1));
// FirstSeen and FirstSeenIfMempoolTime are both missing.
serialized = "{\"Transaction\":\"02000000040aa8d0af84518df6e3a60c5bb19d9c3fcc3dc6e26b2f2449e8d7bf8d3fe84b87010000006a473044022018dfe9216c1209dd6c2b6c1607dbac4e499c1fce4878bc7d5d83fccbf3e24c9402202cac351c9c6a2b5eef338cbf0ec000d8de1c05e96a904cbba2b9e6ffc2d4e19501210364cc39da1091b1a9c12ec905a14a9e8478f951f7a1accdabeb40180533f2eaa5feffffff112c07d0f5e0617d720534f0b2b84dc0d5b7314b358c3ab338823b9e5bfbddf5010000006b483045022100ec155e7141e74661ee511ae980150a6c89261f31070999858738369afc28f2b6022006230d2aa24fac110b74ef15b84371486cf76c539b335a253c14462447912a300121020c2f41390f031d471b22abdb856e6cdbe0f4d74e72c197469bfd54e5a08f7e67feffffff38e799b8f6cf04fd021a9b135cdcd347da7aac4fd8bb8d0da9316a9fb228bb6e000000006b483045022100fc1944544a3f96edd8c8a9795c691e2725612b5ab2e1c999be11a2a4e3f841f1022077b2e088877829edeada0c707a9bb577aa79f26dafacba3d1d2d047f52524296012102e6015963dff9826836400cf8f45597c0705757d5dcdc6bf734f661c7dab89e69feffffff64c3f0377e86625123f2f1ee229319ed238e8ca8b7dda5bc080a2c5ecb984629000000006a47304402204233a90d6296182914424fd2901e16e6f5b13b451b67b0eec25a5eaacc5033c902203d8a13ef0b494c12009663475458e51da6bd55cc67688264230ece81d3eeca24012102f806d7152da2b52c1d9ad928e4a6253ccba080a5b9ab9efdd80e37274ac67f9bfeffffff0290406900000000001976a91491ac4e49b66f845180d98d8f8be6121588be6e3b88ac52371600000000001976a9142f44ed6749e8c84fd476e4440741f7e6f55542fa88acadd30700\",\"Height\":\"2147483646\"}";
deserialized = JsonConvert.DeserializeObject<SmartTransaction>(serialized);
- Assert.Equal(now.UtcDateTime, deserialized.FirstSeen.UtcDateTime, TimeSpan.FromSeconds(1));
+ Assert.Equal(now.UtcDateTime, deserialized!.FirstSeen.UtcDateTime, TimeSpan.FromSeconds(1));
// FirstSeen and FirstSeenIfMempoolTime are both provided.
serialized = "{\"FirstSeen\": \"" + twoThousandEight.ToUnixTimeSeconds() + "\", \"FirstSeenIfMempoolTime\": \"" + twoThousandNine.ToString(CultureInfo.InvariantCulture) + "\", \"Transaction\":\"02000000040aa8d0af84518df6e3a60c5bb19d9c3fcc3dc6e26b2f2449e8d7bf8d3fe84b87010000006a473044022018dfe9216c1209dd6c2b6c1607dbac4e499c1fce4878bc7d5d83fccbf3e24c9402202cac351c9c6a2b5eef338cbf0ec000d8de1c05e96a904cbba2b9e6ffc2d4e19501210364cc39da1091b1a9c12ec905a14a9e8478f951f7a1accdabeb40180533f2eaa5feffffff112c07d0f5e0617d720534f0b2b84dc0d5b7314b358c3ab338823b9e5bfbddf5010000006b483045022100ec155e7141e74661ee511ae980150a6c89261f31070999858738369afc28f2b6022006230d2aa24fac110b74ef15b84371486cf76c539b335a253c14462447912a300121020c2f41390f031d471b22abdb856e6cdbe0f4d74e72c197469bfd54e5a08f7e67feffffff38e799b8f6cf04fd021a9b135cdcd347da7aac4fd8bb8d0da9316a9fb228bb6e000000006b483045022100fc1944544a3f96edd8c8a9795c691e2725612b5ab2e1c999be11a2a4e3f841f1022077b2e088877829edeada0c707a9bb577aa79f26dafacba3d1d2d047f52524296012102e6015963dff9826836400cf8f45597c0705757d5dcdc6bf734f661c7dab89e69feffffff64c3f0377e86625123f2f1ee229319ed238e8ca8b7dda5bc080a2c5ecb984629000000006a47304402204233a90d6296182914424fd2901e16e6f5b13b451b67b0eec25a5eaacc5033c902203d8a13ef0b494c12009663475458e51da6bd55cc67688264230ece81d3eeca24012102f806d7152da2b52c1d9ad928e4a6253ccba080a5b9ab9efdd80e37274ac67f9bfeffffff0290406900000000001976a91491ac4e49b66f845180d98d8f8be6121588be6e3b88ac52371600000000001976a9142f44ed6749e8c84fd476e4440741f7e6f55542fa88acadd30700\",\"Height\":\"2147483646\"}";
deserialized = JsonConvert.DeserializeObject<SmartTransaction>(serialized);
- Assert.Equal(twoThousandEight.UtcDateTime, deserialized.FirstSeen.UtcDateTime, TimeSpan.FromSeconds(1));
+ Assert.Equal(twoThousandEight.UtcDateTime, deserialized!.FirstSeen.UtcDateTime, TimeSpan.FromSeconds(1));
}
[Theory]

Fix some other null warnings