Improve signature
MODIFY
WalletWasabi.Tests/UnitTests/TestWallet.cs
WalletWasabi.Tests/UnitTests/TestWallet.cs
@@ -135,7 +135,7 @@ public class TestWallet : IKeyChain, IDestinationProvider
return transaction;
}
- public void NotifyScriptState(IEnumerable<Script> scripts, KeyState state)
+ public void TrySetScriptStates(KeyState state, IEnumerable<Script> scripts)
{
// Test wallet doesn't care
}

MODIFY
WalletWasabi/WabiSabi/Client/CoinJoinManager.cs
WalletWasabi/WabiSabi/Client/CoinJoinManager.cs
@@ -24,6 +24,7 @@ public class CoinJoinManager : BackgroundService
private record CoinJoinCommand(IWallet Wallet);
private record StartCoinJoinCommand(IWallet Wallet, bool StopWhenAllMixed, bool OverridePlebStop) : CoinJoinCommand(Wallet);
private record StopCoinJoinCommand(IWallet Wallet) : CoinJoinCommand(Wallet);
+
public CoinJoinManager(IWalletProvider walletProvider, RoundStateUpdater roundStatusUpdater, IWasabiHttpClientFactory backendHttpClientFactory, IWasabiBackendStatusProvider wasabiBackendStatusProvider, string coordinatorIdentifier)
{
WasabiBackendStatusProvide = wasabiBackendStatusProvider;
@@ -436,7 +437,7 @@ public class CoinJoinManager : BackgroundService
var wallets = await WalletProvider.GetWalletsAsync().ConfigureAwait(false);
foreach (var k in wallets)
{
- k.KeyChain.NotifyScriptState(hashSet, KeyState.Used);
+ k.KeyChain.TrySetScriptStates(KeyState.Used, hashSet);
}
}

MODIFY
WalletWasabi/WabiSabi/Client/DependencyGraphTaskScheduler.cs
WalletWasabi/WabiSabi/Client/DependencyGraphTaskScheduler.cs
@@ -178,7 +178,7 @@ public class DependencyGraphTaskScheduler
catch (WabiSabiProtocolException ex) when (ex.ErrorCode == WabiSabiProtocolErrorCode.AlreadyRegisteredScript)
{
Logger.LogDebug($"Output registration error, code:'{ex.ErrorCode}' message:'{ex.Message}'.");
- keyChain.NotifyScriptState(new []{txOut.ScriptPubKey}, KeyState.Used);
+ keyChain.TrySetScriptStates(KeyState.Used, new[] { txOut.ScriptPubKey });
}
catch (Exception ex)

MODIFY
WalletWasabi/WabiSabi/Client/IKeyChain.cs
WalletWasabi/WabiSabi/Client/IKeyChain.cs
@@ -10,5 +10,6 @@ public interface IKeyChain
OwnershipProof GetOwnershipProof(IDestination destination, CoinJoinInputCommitmentData committedData);
Transaction Sign(Transaction transaction, Coin coin, OwnershipProof ownershipProof);
- void NotifyScriptState(IEnumerable<Script> scripts, KeyState state);
+
+ void TrySetScriptStates(KeyState state, IEnumerable<Script> scripts);
}

MODIFY
WalletWasabi/WabiSabi/Client/KeyChain.cs
WalletWasabi/WabiSabi/Client/KeyChain.cs
@@ -24,7 +24,7 @@ public class KeyChain : BaseKeyChain
return KeyManager.GetMasterExtKey(Kitchen.SaltSoup()).PrivateKey;
}
- public override void NotifyScriptState(IEnumerable<Script> scripts, KeyState state)
+ public override void TrySetScriptStates(KeyState state, IEnumerable<Script> scripts)
{
foreach (var hdPubKey in KeyManager.GetKeys(key => scripts.Any(key.ContainsScript)))
{

Improve signature