Skip to content

Commit

Permalink
Remove Coordination Fee Rate concept (WalletWasabi#13297)
Browse files Browse the repository at this point in the history
* Remove Coordination Fee Rate concept

* Keep compatibility with CoordinatorConnectionString
  • Loading branch information
lontivero authored Aug 15, 2024
1 parent 78083ec commit 360cbd3
Show file tree
Hide file tree
Showing 41 changed files with 40 additions and 218 deletions.
6 changes: 0 additions & 6 deletions WalletWasabi.Daemon/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ [ nameof(EnableGpu)] = (
[ nameof(CoordinatorIdentifier)] = (
"-",
GetStringValue("CoordinatorIdentifier", PersistentConfig.CoordinatorIdentifier, cliArgs)),
[ nameof(MaxCoordinationFeeRate)] = (
"Max coordination fee rate the client is willing to accept to participate into a round",
GetDecimalValue("MaxCoordinationFeeRate", PersistentConfig.MaxCoordinationFeeRate, cliArgs)),
[ nameof(MaxCoinjoinMiningFeeRate)] = (
"Max mining fee rate in s/vb the client is willing to pay to participate into a round",
GetDecimalValue("MaxCoinjoinMiningFeeRate", PersistentConfig.MaxCoinJoinMiningFeeRate, cliArgs)),
Expand Down Expand Up @@ -193,9 +190,6 @@ [ nameof(AbsoluteMinInputCount)] = (

public bool EnableGpu => GetEffectiveValue<BoolValue, bool>(nameof(EnableGpu));
public string CoordinatorIdentifier => GetEffectiveValue<StringValue, string>(nameof(CoordinatorIdentifier));
public decimal MaxCoordinationFeeRate => decimal.Min(
GetEffectiveValue<DecimalValue, decimal>(nameof(MaxCoordinationFeeRate)),
Constants.AbsoluteMaxCoordinationFeeRate);
public decimal MaxCoinjoinMiningFeeRate => GetEffectiveValue<DecimalValue, decimal>(nameof(MaxCoinjoinMiningFeeRate));
public int AbsoluteMinInputCount => int.Max(
GetEffectiveValue<IntValue, int>(nameof(AbsoluteMinInputCount)),
Expand Down
3 changes: 2 additions & 1 deletion WalletWasabi.Daemon/Global.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
using WalletWasabi.WebClients.ShopWare;
using WalletWasabi.Wallets.FilterProcessor;
using WalletWasabi.Models;
using WalletWasabi.WabiSabi.Models;

namespace WalletWasabi.Daemon;

Expand Down Expand Up @@ -401,7 +402,7 @@ private void RegisterCoinJoinComponents()
Tor.Http.IHttpClient roundStateUpdaterHttpClient = CoordinatorHttpClientFactory.NewHttpClient(Mode.SingleCircuitPerLifetime, RoundStateUpdaterCircuit);
HostedServices.Register<RoundStateUpdater>(() => new RoundStateUpdater(TimeSpan.FromSeconds(10), new WabiSabiHttpApiClient(roundStateUpdaterHttpClient)), "Round info updater");

var coinJoinConfiguration = new CoinJoinConfiguration(Config.CoordinatorIdentifier, Config.MaxCoordinationFeeRate, Config.MaxCoinjoinMiningFeeRate, Config.AbsoluteMinInputCount, AllowSoloCoinjoining: false);
var coinJoinConfiguration = new CoinJoinConfiguration(Config.CoordinatorIdentifier, Config.MaxCoinjoinMiningFeeRate, Config.AbsoluteMinInputCount, AllowSoloCoinjoining: false);
HostedServices.Register<CoinJoinManager>(() => new CoinJoinManager(WalletManager, HostedServices.Get<RoundStateUpdater>(), CoordinatorHttpClientFactory, HostedServices.Get<WasabiSynchronizer>(), coinJoinConfiguration, CoinPrison), "CoinJoin Manager");
}

Expand Down
11 changes: 1 addition & 10 deletions WalletWasabi.Daemon/PersistentConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ public record PersistentConfig

public string CoordinatorIdentifier { get; init; } = "CoinJoinCoordinatorIdentifier";

public decimal MaxCoordinationFeeRate { get; init; } = Constants.DefaultMaxCoordinationFeeRate;

public decimal MaxCoinJoinMiningFeeRate { get; init; } = Constants.DefaultMaxCoinJoinMiningFeeRate;

public int AbsoluteMinInputCount { get; init; } = Constants.DefaultAbsoluteMinInputCount;
Expand Down Expand Up @@ -101,7 +99,6 @@ public bool DeepEquals(PersistentConfig other)
DustThreshold == other.DustThreshold &&
EnableGpu == other.EnableGpu &&
CoordinatorIdentifier == other.CoordinatorIdentifier &&
MaxCoordinationFeeRate == other.MaxCoordinationFeeRate &&
MaxCoinJoinMiningFeeRate == other.MaxCoinJoinMiningFeeRate &&
AbsoluteMinInputCount == other.AbsoluteMinInputCount;
}
Expand Down Expand Up @@ -156,13 +153,7 @@ public PersistentConfig Migrate()
return this;
}

private PersistentConfig MigrateMaxCoordinationFeeRate()
{
return this with
{
MaxCoordinationFeeRate = MaxCoordinationFeeRate / 100.0m
};
}
private PersistentConfig MigrateMaxCoordinationFeeRate() => this;

private PersistentConfig MigrateOldDefaultBackendUris()
{
Expand Down
15 changes: 1 addition & 14 deletions WalletWasabi.Fluent/Models/UI/ApplicationSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public partial class ApplicationSettings : ReactiveObject
[AutoNotify] private string _mainNetCoordinatorUri;
[AutoNotify] private string _testNetCoordinatorUri;
[AutoNotify] private string _regTestCoordinatorUri;
[AutoNotify] private string _maxCoordinationFeeRate;
[AutoNotify] private string _maxCoinJoinMiningFeeRate;
[AutoNotify] private string _absoluteMinInputCount;

Expand Down Expand Up @@ -100,7 +99,6 @@ public ApplicationSettings(string persistentConfigFilePath, PersistentConfig per
_mainNetCoordinatorUri = _startupConfig.MainNetCoordinatorUri;
_testNetCoordinatorUri = _startupConfig.TestNetCoordinatorUri;
_regTestCoordinatorUri = _startupConfig.RegTestCoordinatorUri;
_maxCoordinationFeeRate = _startupConfig.MaxCoordinationFeeRate.ToString(CultureInfo.InvariantCulture);
_maxCoinJoinMiningFeeRate = _startupConfig.MaxCoinJoinMiningFeeRate.ToString(CultureInfo.InvariantCulture);
_absoluteMinInputCount = _startupConfig.AbsoluteMinInputCount.ToString(CultureInfo.InvariantCulture);

Expand Down Expand Up @@ -142,13 +140,12 @@ public ApplicationSettings(string persistentConfigFilePath, PersistentConfig per
.Skip(1);
var configSaveTrigger2 =
this.WhenAnyValue(
x => x.MaxCoordinationFeeRate,
x => x.MaxCoinJoinMiningFeeRate,
x => x.AbsoluteMinInputCount,
x => x.MainNetCoordinatorUri,
x => x.TestNetCoordinatorUri,
x => x.RegTestCoordinatorUri,
(_, _, _, _, _, _) => Unit.Default)
(_, _, _, _, _) => Unit.Default)
.Skip(1);

Observable
Expand Down Expand Up @@ -286,9 +283,6 @@ private PersistentConfig ApplyChanges(PersistentConfig config)
DustThreshold = decimal.TryParse(DustThreshold, out var threshold) ?
Money.Coins(threshold) :
Money.Coins(Constants.DefaultDustThreshold),
MaxCoordinationFeeRate = decimal.TryParse(MaxCoordinationFeeRate, out var maxCoordinationFeeRate) ?
maxCoordinationFeeRate :
Constants.DefaultMaxCoordinationFeeRate,
MaxCoinJoinMiningFeeRate = decimal.TryParse(MaxCoinJoinMiningFeeRate, out var maxCoinjoinMiningFeeRate) ?
maxCoinjoinMiningFeeRate :
Constants.DefaultMaxCoinJoinMiningFeeRate,
Expand Down Expand Up @@ -322,12 +316,6 @@ private PersistentConfig ApplyChanges(PersistentConfig config)
public bool TryProcessCoordinatorConnectionString(CoordinatorConnectionString coordinatorConnectionString)
{
// Sanity checks
if (coordinatorConnectionString.CoordinationFeeRate > Constants.AbsoluteMaxCoordinationFeeRate)
{
Logger.LogWarning($"New intended coordinator fee rate was {coordinatorConnectionString.CoordinationFeeRate}, but absolute max is {Constants.AbsoluteMaxCoordinationFeeRate}.");
return false;
}

if (coordinatorConnectionString.AbsoluteMinInputCount < Constants.AbsoluteMinInputCount)
{
Logger.LogWarning($"New intended absolute min input count was {coordinatorConnectionString.AbsoluteMinInputCount}, but absolute min is {Constants.AbsoluteMinInputCount}");
Expand All @@ -339,7 +327,6 @@ public bool TryProcessCoordinatorConnectionString(CoordinatorConnectionString co
return false;
}

MaxCoordinationFeeRate = coordinatorConnectionString.CoordinationFeeRate.ToString(CultureInfo.InvariantCulture);
AbsoluteMinInputCount = coordinatorConnectionString.AbsoluteMinInputCount.ToString();

// TODO: Save Name and ReadMoreUri to display it after.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace WalletWasabi.Fluent.ViewModels.Settings;
public partial class CoordinatorTabSettingsViewModel : RoutableViewModel
{
[AutoNotify] private string _coordinatorUri;
[AutoNotify] private string _maxCoordinationFeeRate;
[AutoNotify] private string _maxCoinJoinMiningFeeRate;
[AutoNotify] private string _absoluteMinInputCount;

Expand All @@ -33,13 +32,11 @@ public CoordinatorTabSettingsViewModel(IApplicationSettings settings)
Settings = settings;

this.ValidateProperty(x => x.CoordinatorUri, ValidateCoordinatorUri);
this.ValidateProperty(x => x.MaxCoordinationFeeRate, ValidateMaxCoordinationFeeRate);
this.ValidateProperty(x => x.MaxCoinJoinMiningFeeRate, ValidateMaxCoinJoinMiningFeeRate);
this.ValidateProperty(x => x.AbsoluteMinInputCount, ValidateAbsoluteMinInputCount);


_coordinatorUri = settings.GetCoordinatorUri();
_maxCoordinationFeeRate = settings.MaxCoordinationFeeRate;
_maxCoinJoinMiningFeeRate = settings.MaxCoinJoinMiningFeeRate;
_absoluteMinInputCount = settings.AbsoluteMinInputCount;

Expand Down Expand Up @@ -74,36 +71,6 @@ private void ValidateCoordinatorUri(IValidationErrors errors)
Settings.TrySetCoordinatorUri(coordinatorUri);
}

private void ValidateMaxCoordinationFeeRate(IValidationErrors errors)
{
var maxCoordinationFeeRate = MaxCoordinationFeeRate;

if (string.IsNullOrEmpty(maxCoordinationFeeRate))
{
return;
}

if (!decimal.TryParse(maxCoordinationFeeRate, out var maxCoordinationFeeRateDecimal))
{
errors.Add(ErrorSeverity.Error, "Invalid number.");
return;
}

if (maxCoordinationFeeRateDecimal < 0)
{
errors.Add(ErrorSeverity.Error, "Cannot be lower than 0.0");
return;
}

if (maxCoordinationFeeRateDecimal > Constants.AbsoluteMaxCoordinationFeeRate)
{
errors.Add(ErrorSeverity.Error, $"Absolute maximum coordination fee rate is {Constants.AbsoluteMaxCoordinationFeeRate}");
return;
}

Settings.MaxCoordinationFeeRate = maxCoordinationFeeRateDecimal.ToString(CultureInfo.InvariantCulture);
}

private void ValidateMaxCoinJoinMiningFeeRate(IValidationErrors errors)
{
var maxCoinJoinMiningFeeRate = MaxCoinJoinMiningFeeRate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public partial class CoinJoinStateViewModel : ViewModelBase
private const string WaitingMessage = "Awaiting coinjoin";
private const string UneconomicalRoundMessage = "Awaiting cheaper coinjoins";
private const string RandomlySkippedRoundMessage = "Skipping a round for better privacy";
private const string CoordinationFeeRateTooHighMessage = "Coordination fee rate was too high";
private const string CoinjoinMiningFeeRateTooHighMessage = "Mining fee rate was too high";
private const string MinInputCountTooLowMessage = "Min input count was too low";
private const string PauseMessage = "Coinjoin is paused";
Expand Down Expand Up @@ -385,7 +384,6 @@ private void ProcessStatusChange(StatusChangedEventArgs e)
CoinjoinError.OnlyExcludedCoinsAvailable => OnlyExcludedCoinsAvailableMessage,
CoinjoinError.UneconomicalRound => UneconomicalRoundMessage,
CoinjoinError.RandomlySkippedRound => RandomlySkippedRoundMessage,
CoinjoinError.CoordinationFeeRateTooHigh => CoordinationFeeRateTooHighMessage,
CoinjoinError.MiningFeeRateTooHigh => CoinjoinMiningFeeRateTooHighMessage,
CoinjoinError.MinInputCountTooLow => MinInputCountTooLowMessage,
_ => GeneralErrorMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@
</PreviewItem>
<Separator />

<!-- CoordinationFee -->
<PreviewItem Label="Coordination fee rate"
Icon="{StaticResource money_24_regular}"
CopyableContent="{Binding CoordinatorConnection.CoordinationFeeRate}">
<TextBlock Text="{Binding CoordinatorConnection.CoordinationFeeRate, FallbackValue=0, StringFormat={}{0}}" />
</PreviewItem>
<Separator />

<!-- AbsoluteMinInputCount -->
<PreviewItem Label="Absolute minimum input count"
Icon="{StaticResource input_count}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
</TextBox>
</StackPanel>

<StackPanel ToolTip.Tip="The client will refuse to participate in rounds charging a coordination fee rate higher than the value indicated here.">
<TextBlock Text="Max Coordination Fee Rate" />
<CurrencyEntryBox Classes="standalone" Name="CoordinationFeeRateTextBox" Text="{Binding MaxCoordinationFeeRate}"/>
</StackPanel>

<StackPanel ToolTip.Tip="The client will refuse to participate in rounds with a mining fee rate (s/vb) higher than the value indicated here.">
<TextBlock Text="Max Coinjoin Mining Fee Rate" />
<CurrencyEntryBox Classes="standalone" Name="CoinJoinMiningFeeRateTextBox" Text="{Binding MaxCoinJoinMiningFeeRate}" CurrencyCode="s/vb"/>
Expand Down
8 changes: 3 additions & 5 deletions WalletWasabi.Tests/Helpers/WabiSabiFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public static RoundParameters CreateRoundParameters(WabiSabiConfig cfg) =>
cfg,
Network.Main,
new FeeRate(100m),
cfg.CoordinationFeeRate,
Money.Coins(Constants.MaximumNumberOfBitcoins));

public static Round CreateRound(RoundParameters parameters) =>
Expand Down Expand Up @@ -221,7 +220,7 @@ public static (Alice alice, RealCredentialsRequest amountRequest, RealCredential

var alice = round.Alices.FirstOrDefault() ?? CreateAlice(round);
var (realAmountCredentialRequest, _) = amClient.CreateRequest(
new[] { amount?.Satoshi ?? alice.CalculateRemainingAmountCredentials(round.Parameters.MiningFeeRate, round.Parameters.CoordinationFeeRate).Satoshi },
new[] { amount?.Satoshi ?? alice.CalculateRemainingAmountCredentials(round.Parameters.MiningFeeRate).Satoshi },
amZeroCredentials,
CancellationToken.None);
var (realVsizeCredentialRequest, _) = vsClient.CreateRequest(
Expand Down Expand Up @@ -255,7 +254,7 @@ public static OutputRegistrationRequest CreateOutputRegistrationRequest(Round ro

var alice = round.Alices.FirstOrDefault() ?? CreateAlice(round);
var (amCredentialRequest, amValid) = amClient.CreateRequest(
new[] { alice.CalculateRemainingAmountCredentials(round.Parameters.MiningFeeRate, round.Parameters.CoordinationFeeRate).Satoshi },
new[] { alice.CalculateRemainingAmountCredentials(round.Parameters.MiningFeeRate).Satoshi },
amZeroCredentials, // FIXME doesn't make much sense
CancellationToken.None);
long startingVsizeCredentialAmount = vsize ?? alice.CalculateRemainingVsizeCredentials(round.Parameters.MaxVsizeAllocationPerAlice);
Expand Down Expand Up @@ -291,7 +290,6 @@ public static BlameRound CreateBlameRound(Round round, WabiSabiConfig cfg)
cfg,
round.Parameters.Network,
round.Parameters.MiningFeeRate,
round.Parameters.CoordinationFeeRate,
round.Parameters.MaxSuggestedAmount) with
{
MinInputCountByRound = cfg.MinInputCountByBlameRound
Expand Down Expand Up @@ -342,7 +340,7 @@ public static CoinJoinClient CreateTestCoinJoinClient(
outputProvider,
roundStateUpdater,
coinSelector,
new CoinJoinConfiguration("CoinJoinCoordinatorIdentifier", 0.3m, 150.0m, 1, AllowSoloCoinjoining: true),
new CoinJoinConfiguration("CoinJoinCoordinatorIdentifier", 150.0m, 1, AllowSoloCoinjoining: true),
new LiquidityClueProvider(),
TimeSpan.Zero,
TimeSpan.Zero,
Expand Down
1 change: 0 additions & 1 deletion WalletWasabi.Tests/UnitTests/Bases/ConfigManagerNgTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ static string GetConfigString(string localBitcoinCoreDataDir)
"DustThreshold": "0.00005",
"EnableGpu": true,
"CoordinatorIdentifier": "CoinJoinCoordinatorIdentifier",
"MaxCoordinationFeeRate": 0.0,
"MaxCoinJoinMiningFeeRate": 150.0,
"AbsoluteMinInputCount": 21,
"ConfigVersion": 0
Expand Down
22 changes: 1 addition & 21 deletions WalletWasabi.Tests/UnitTests/Bases/ConfigManagerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,7 @@ public async Task CheckFileChangeTestAsync()
Assert.False(ConfigManager.CheckFileChange(configPath, config));
}

// Change coordination fee rate.
{
// Double coordination fee rate.
config.CoordinationFeeRate = new CoordinationFeeRate(rate: 0.005m);

// Change should be detected.
Assert.True(ConfigManager.CheckFileChange(configPath, config));

// Now store and check that JSON is as expected.
config.ToFile();

string expectedFileContents = GetVanillaConfigString(coordinationFeeRate: 0.005m);
string actualFileContents = ReadAllTextAndNormalize(configPath);

Assert.Equal(expectedFileContents, actualFileContents);
}

static string GetVanillaConfigString(decimal coordinationFeeRate = 0.0m)
static string GetVanillaConfigString()
=> $$"""
{
"ConfirmationTarget": 108,
Expand All @@ -83,9 +66,6 @@ static string GetVanillaConfigString(decimal coordinationFeeRate = 0.0m)
"MinInputCountByRoundMultiplier": 0.5,
"MinInputCountByBlameRoundMultiplier": 0.4,
"RoundDestroyerThreshold": 375,
"CoordinationFeeRate": {
"Rate": {{coordinationFeeRate}}
},
"CoordinatorExtPubKey": "xpub6C13JhXzjAhVRgeTcRSWqKEPe1vHi3Tmh2K9PN1cZaZFVjjSaj76y5NNyqYjc2bugj64LVDFYu8NZWtJsXNYKFb9J94nehLAPAKqKiXcebC",
"CoordinatorExtPubKeyCurrentDepth": 1,
"MaxSuggestedAmountBase": "0.10",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public class NullApplicationSettings : IApplicationSettings
public bool StopLocalBitcoinCoreOnShutdown { get; set; }
public string BitcoinP2PEndPoint { get; set; } = "";
public string RegTestCoordinatorUri { get; set; } = "";
public string MaxCoordinationFeeRate { get; set; } = "";
public string MaxCoinJoinMiningFeeRate { get; set; } = "";
public string AbsoluteMinInputCount { get; set; } = "";
public string BackendUri { get; set; } = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public async Task SomeBobsRegisteredTimeoutAsync()
MaxInputCountByRound = 2,
MinInputCountByRoundMultiplier = 0.5,
OutputRegistrationTimeout = TimeSpan.Zero,
CoordinationFeeRate = CoordinationFeeRate.Zero
};
var (keyChain, coin1, coin2) = WabiSabiFactory.CreateCoinKeyPairs();

Expand Down Expand Up @@ -124,7 +123,6 @@ public async Task DiffTooSmallToBlameAsync()
MaxInputCountByRound = 2,
MinInputCountByRoundMultiplier = 0.5,
OutputRegistrationTimeout = TimeSpan.Zero,
CoordinationFeeRate = CoordinationFeeRate.Zero
};
var (keyChain, coin1, coin2) = WabiSabiFactory.CreateCoinKeyPairs();

Expand Down Expand Up @@ -257,7 +255,6 @@ public async Task SomeBobsReusingAddressAsync()
{
MaxInputCountByRound = 2,
MinInputCountByRoundMultiplier = 0.5,
CoordinationFeeRate = CoordinationFeeRate.Zero
};

var keyManager1 = ServiceFactory.CreateKeyManager("");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public async Task ReissueExactDeltaAmountAsync()
// Step 1. Create credentials
var (amClient, vsClient, amIssuer, vsIssuer, amZeroCredentials, vsZeroCredentials) = WabiSabiFactory.CreateWabiSabiClientsAndIssuers(round);

var amountsToRequest = new[] { alice.CalculateRemainingAmountCredentials(round.Parameters.MiningFeeRate, round.Parameters.CoordinationFeeRate).Satoshi };
var amountsToRequest = new[] { alice.CalculateRemainingAmountCredentials(round.Parameters.MiningFeeRate).Satoshi };
var (amCredentialRequest, amValid) = amClient.CreateRequest(
amountsToRequest,
amZeroCredentials, // FIXME doesn't make much sense
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public void DecompositionsInvariantTest(decimal feeRateDecimal, long minOutputAm
var availableVsize = maxAvailableOutputs * outputVirtualSize;
var feeRate = new FeeRate(feeRateDecimal);
var feePerOutput = feeRate.GetFee(outputVirtualSize);
var registeredCoinEffectiveValues = GenerateRandomCoins().Take(3).Select(c => c.EffectiveValue(feeRate, CoordinationFeeRate.Zero)).ToList();
var theirCoinEffectiveValues = GenerateRandomCoins().Take(30).Select(c => c.EffectiveValue(feeRate, CoordinationFeeRate.Zero)).ToList();
var registeredCoinEffectiveValues = GenerateRandomCoins().Take(3).Select(c => c.EffectiveValue(feeRate)).ToList();
var theirCoinEffectiveValues = GenerateRandomCoins().Take(30).Select(c => c.EffectiveValue(feeRate)).ToList();
var allowedOutputAmountRange = new MoneyRange(Money.Satoshis(minOutputAmount), Money.Satoshis(ProtocolConstants.MaxAmountPerAlice));
var allowedOutputTypes = isTaprootEnabled ? new List<ScriptType>() { ScriptType.Taproot, ScriptType.P2WPKH } : new List<ScriptType>() { ScriptType.P2WPKH };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ private async Task TestFullCoinjoinAsync(ScriptPubKeyType scriptPubKeyType, int

var amountsToRequest = new[]
{
Money.Coins(.75m) - round.Parameters.MiningFeeRate.GetFee(inputVirtualSize) - round.Parameters.CoordinationFeeRate.GetFee(Money.Coins(1m)),
Money.Coins(.75m) - round.Parameters.MiningFeeRate.GetFee(inputVirtualSize),
Money.Coins(.25m),
}.Select(x => x.Satoshi).ToArray();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public async Task GenerateCoinsAsync(int numberOfCoins, int seed, CancellationTo
{
var feeRate = new FeeRate(4.0m);
var (splitTx, spendingCoin) = Wallet.CreateTemplateTransaction();
var availableAmount = spendingCoin.EffectiveValue(feeRate, CoordinationFeeRate.Zero);
var availableAmount = spendingCoin.EffectiveValue(feeRate);

var rnd = new Random(seed);
double NextNotTooSmall() => 0.00001 + (rnd.NextDouble() * 0.99999);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public void ConstructionStateFeeRateCalculation()
cfg,
Network.Main,
miningFeeRate,
cfg.CoordinationFeeRate,
Money.Coins(10));

var round = WabiSabiFactory.CreateRound(roundParameters);
Expand Down
Loading

0 comments on commit 360cbd3

Please sign in to comment.