Simplify 'new' expression
MODIFY
WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
@@ -47,7 +47,7 @@ namespace WalletWasabi.Tests.Helpers
public static Mock<IRPCClient> CreatePreconfiguredRpcClient(params Coin[] coins)
{
- using Key key = new Key();
+ using Key key = new();
var mockRpc = new Mock<IRPCClient>();
mockRpc.Setup(rpc => rpc.GetTxOutAsync(It.IsAny<uint256>(), It.IsAny<int>(), It.IsAny<bool>()))
.ReturnsAsync(new NBitcoin.RPC.GetTxOutResponse
@@ -105,7 +105,7 @@ namespace WalletWasabi.Tests.Helpers
}
public static Alice CreateAlice(Coin coin, OwnershipProof ownershipProof)
- => new Alice(coin, ownershipProof) { Deadline = DateTimeOffset.UtcNow + TimeSpan.FromHours(1) };
+ => new(coin, ownershipProof) { Deadline = DateTimeOffset.UtcNow + TimeSpan.FromHours(1) };
public static Alice CreateAlice(Key key, Money amount)
=> CreateAlice(CreateCoin(key, amount), CreateOwnershipProof(key));

MODIFY
WalletWasabi/WabiSabi/Models/RoundState.cs
WalletWasabi/WabiSabi/Models/RoundState.cs
@@ -21,7 +21,7 @@ namespace WalletWasabi.WabiSabi.Models
MultipartyTransactionState CoinjoinState)
{
public static RoundState FromRound(Round round) =>
- new RoundState(
+ new(
round.Id,
round.AmountCredentialIssuerParameters,
round.VsizeCredentialIssuerParameters,
@@ -41,9 +41,9 @@ namespace WalletWasabi.WabiSabi.Models
};
public WabiSabiClient CreateAmountCredentialClient(ZeroCredentialPool zeroAmountCredentialPool, WasabiRandom random) =>
- new WabiSabiClient(AmountCredentialIssuerParameters, random, (ulong)MaxRegistrableAmount, zeroAmountCredentialPool);
+ new(AmountCredentialIssuerParameters, random, (ulong)MaxRegistrableAmount, zeroAmountCredentialPool);
public WabiSabiClient CreateVsizeCredentialClient(ZeroCredentialPool zeroVsizeCredentialPool, WasabiRandom random) =>
- new WabiSabiClient(VsizeCredentialIssuerParameters, random, (ulong)MaxRegistrableVsize, zeroVsizeCredentialPool);
+ new(VsizeCredentialIssuerParameters, random, (ulong)MaxRegistrableVsize, zeroVsizeCredentialPool);
}
}

Simplify 'new' expression