Some code cleanup, renamed test
MODIFY
WalletWasabi.Tests/LiveServerTests.cs
WalletWasabi.Tests/LiveServerTests.cs
@@ -25,7 +25,8 @@ namespace WalletWasabi.Tests
LiveServerTestsFixture = liveServerTestsFixture;
}
- // Blockchain
+ #region Blockchain
+
[Theory]
[InlineData(NetworkType.Mainnet)]
[InlineData(NetworkType.Testnet)]
@@ -68,34 +69,31 @@ namespace WalletWasabi.Tests
}
}
- // ChaumianCoinJoin
+ #endregion Blockchain
+
+ #region ChaumianCoinJoin
+
[Theory]
[InlineData(NetworkType.Testnet)]
- public async Task RegisterAliceInputAsync(NetworkType networkType)
+ public async Task RegisterAliceInputThenUnConfirmAsync(NetworkType networkType)
{
- Network network = Network.GetNetwork(networkType.ToString());
-
- var activeOutputAddress = LiveServerTestsFixture.AliceInputMappings[networkType].activeOutputAddress;
- var changeOutputAddress = LiveServerTestsFixture.AliceInputMappings[networkType].changeOutputAddress;
+ var aliceInputData = LiveServerTestsFixture.GetAliceInputData(networkType);
// blinded data created using activeOutputAddress ScriptPubKey
- var blindedDataAsHex = LiveServerTestsFixture.AliceInputMappings[networkType].blindedDataHex;
-
- // signed with private key that owns the utxos
- var proof = LiveServerTestsFixture.AliceInputMappings[networkType].proof;
+ var blindedDataAsHex = aliceInputData.blindedDataHex;
- byte[] blindedData = ByteHelpers.FromHex(blindedDataAsHex);
+ byte[] blinded = ByteHelpers.FromHex(blindedDataAsHex);
- // utxos
- var txoRefs = LiveServerTestsFixture.AliceInputMappings[networkType].utxos;
+ // signed with private key that owns the utxos
+ var proof = aliceInputData.proof;
- var inputProofModels = txoRefs.Select(txrf => new InputProofModel
+ var inputProofModels = aliceInputData.utxos.Select(txrf => new InputProofModel
{
- Input = new TxoRef(txrf.TransactionId, txrf.Index),
+ Input = txrf,
Proof = proof
});
- var aliceClient = await AliceClient.CreateNewAsync(changeOutputAddress, blindedData, inputProofModels, LiveServerTestsFixture.UriMappings[networkType]);
+ var aliceClient = await AliceClient.CreateNewAsync(aliceInputData.changeOutputAddress, ByteHelpers.FromHex(blindedDataAsHex), inputProofModels, LiveServerTestsFixture.UriMappings[networkType]);
Assert.NotNull(aliceClient?.RoundId);
Assert.NotNull(aliceClient?.UniqueId);
@@ -105,7 +103,10 @@ namespace WalletWasabi.Tests
await aliceClient.PostUnConfirmationAsync();
}
- // Offchain
+ #endregion ChaumianCoinJoin
+
+ #region Offchain
+
[Theory]
[InlineData(NetworkType.Mainnet)]
[InlineData(NetworkType.Testnet)]
@@ -118,5 +119,7 @@ namespace WalletWasabi.Tests
Assert.True(exchangeRates.NotNullAndNotEmpty());
}
}
+
+ #endregion Offchain
}
}

MODIFY
WalletWasabi.Tests/XunitConfiguration/LiveServerTestsFixture.cs
WalletWasabi.Tests/XunitConfiguration/LiveServerTestsFixture.cs
@@ -41,6 +41,11 @@ namespace WalletWasabi.Tests.XunitConfiguration
};
}
+ public (BitcoinPubKeyAddress activeOutputAddress, BitcoinPubKeyAddress changeOutputAddress, string blindedDataHex, string proof, List<TxoRef> utxos) GetAliceInputData(NetworkType networkType)
+ {
+ return AliceInputMappings[networkType];
+ }
+
public void Dispose()
{
//

Some code cleanup, renamed test