Avoid hard coded coordinator identifier in tests
MODIFY
WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
@@ -47,13 +47,13 @@ public static class WabiSabiFactory
}
public static CoinJoinInputCommitmentData CreateCommitmentData(uint256? RoundId = null)
- => new CoinJoinInputCommitmentData("wasabiwallet.io", RoundId ?? uint256.One);
+ => new CoinJoinInputCommitmentData(CoordinatorIdentifier, RoundId ?? uint256.One);
public static OwnershipProof CreateOwnershipProof(Key key, uint256? roundHash = null)
=> OwnershipProof.GenerateCoinJoinInputProof(
key,
GetOwnershipIdentifier(key.PubKey.WitHash.ScriptPubKey),
- new CoinJoinInputCommitmentData("wasabiwallet.io", roundHash ?? BitcoinFactory.CreateUint256()));
+ new CoinJoinInputCommitmentData(CoordinatorIdentifier, roundHash ?? BitcoinFactory.CreateUint256()));
public static OwnershipIdentifier GetOwnershipIdentifier(Script scriptPubKey)
{
@@ -148,7 +148,7 @@ public static class WabiSabiFactory
return new ArenaClient(
roundState.CreateAmountCredentialClient(random),
roundState.CreateVsizeCredentialClient(random),
- "wasabiwallet.io",
+ CoordinatorIdentifier,
arena);
}
@@ -314,7 +314,7 @@ public static class WabiSabiFactory
keyChain,
destinationProvider,
roundStateUpdater,
- "wasabiwallet.io",
+ "CoinJoinCoordinatorIdentifier",
int.MaxValue,
true,
redCoinIsolation,
@@ -347,4 +347,6 @@ public static class WabiSabiFactory
});
return mockRoundParameterFactory.Object;
}
+
+ private static string CoordinatorIdentifier = new WabiSabiConfig().CoordinatorIdentifier;
}

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Client/ArenaClientTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Client/ArenaClientTests.cs
@@ -75,7 +75,7 @@ public class ArenaClientTests
var aliceArenaClient = new ArenaClient(
roundState.CreateAmountCredentialClient(insecureRandom),
roundState.CreateVsizeCredentialClient(insecureRandom),
- "wasabiwallet.io",
+ config.CoordinatorIdentifier,
wabiSabiApi);
var ownershipProof = WabiSabiFactory.CreateOwnershipProof(key, round.Id);
@@ -128,7 +128,7 @@ public class ArenaClientTests
var bobArenaClient = new ArenaClient(
roundState.CreateAmountCredentialClient(insecureRandom),
roundState.CreateVsizeCredentialClient(insecureRandom),
- "wasabiwallet.io",
+ config.CoordinatorIdentifier,
wabiSabiApi);
var reissuanceResponse = await bobArenaClient.ReissueCredentialAsync(
@@ -191,7 +191,7 @@ public class ArenaClientTests
using CoinJoinFeeRateStatStore coinJoinFeeRateStatStore = new(config, arena.Rpc);
var wabiSabiApi = new WabiSabiController(idempotencyRequestCache, arena, coinJoinFeeRateStatStore);
- var apiClient = new ArenaClient(null!, null!, "wasabiwallet.io", wabiSabiApi);
+ var apiClient = new ArenaClient(null!, null!, config.CoordinatorIdentifier, wabiSabiApi);
round.SetPhase(Phase.InputRegistration);
@@ -234,7 +234,7 @@ public class ArenaClientTests
InsecureRandom rnd = InsecureRandom.Instance;
var amountClient = new WabiSabiClient(round.AmountCredentialIssuerParameters, rnd, 4300000000000L);
var vsizeClient = new WabiSabiClient(round.VsizeCredentialIssuerParameters, rnd, 2000L);
- var apiClient = new ArenaClient(amountClient, vsizeClient, "wasabiwallet.io", wabiSabiApi);
+ var apiClient = new ArenaClient(amountClient, vsizeClient, config.CoordinatorIdentifier, wabiSabiApi);
round.SetPhase(Phase.TransactionSigning);

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Client/BobClientTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Client/BobClientTests.cs
@@ -46,12 +46,12 @@ public class BobClientTests
var aliceArenaClient = new ArenaClient(
roundState.CreateAmountCredentialClient(insecureRandom),
roundState.CreateVsizeCredentialClient(insecureRandom),
- "wasabiwallet.io",
+ config.CoordinatorIdentifier,
wabiSabiApi);
var bobArenaClient = new ArenaClient(
roundState.CreateAmountCredentialClient(insecureRandom),
roundState.CreateVsizeCredentialClient(insecureRandom),
- "wasabiwallet.io",
+ config.CoordinatorIdentifier,
wabiSabiApi);
Assert.Equal(Phase.InputRegistration, round.Phase);

MODIFY
WalletWasabi.Tests/UnitTests/WabiSabi/Integration/WabiSabiApiApplicationFactory.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Integration/WabiSabiApiApplicationFactory.cs
@@ -83,7 +83,7 @@ public class WabiSabiApiApplicationFactory<TStartup> : WebApplicationFactory<TSt
var arenaClient = new ArenaClient(
round.CreateAmountCredentialClient(insecureRandom),
round.CreateVsizeCredentialClient(insecureRandom),
- "wasabiwallet.io",
+ round.CoinjoinState.Parameters.CoordinationIdentifier,
wabiSabiHttpApiClient);
return arenaClient;
}

Avoid hard coded coordinator identifier in tests