Add network for missing places
MODIFY
WalletWasabi.Tests/UnitTests/KeyManagementTests.cs
WalletWasabi.Tests/UnitTests/KeyManagementTests.cs
@@ -38,10 +38,10 @@ namespace WalletWasabi.Tests.UnitTests
Assert.NotNull(manager3.EncryptedSecret);
Assert.NotNull(manager3.ExtPubKey);
- var sameManager = new KeyManager(manager.EncryptedSecret, manager.ChainCode, manager.MasterFingerprint, manager.ExtPubKey, true, null, new BlockchainState());
- var sameManager2 = new KeyManager(manager.EncryptedSecret, manager.ChainCode, password);
+ var sameManager = new KeyManager(manager.EncryptedSecret, manager.ChainCode, manager.MasterFingerprint, manager.ExtPubKey, true, null, new BlockchainState(Network.Main));
+ var sameManager2 = new KeyManager(manager.EncryptedSecret, manager.ChainCode, password, Network.Main);
Logger.TurnOff();
- Assert.Throws<SecurityException>(() => new KeyManager(manager.EncryptedSecret, manager.ChainCode, "differentPassword"));
+ Assert.Throws<SecurityException>(() => new KeyManager(manager.EncryptedSecret, manager.ChainCode, "differentPassword", Network.Main));
Logger.TurnOn();
Assert.Equal(manager.ChainCode, sameManager.ChainCode);
@@ -58,7 +58,7 @@ namespace WalletWasabi.Tests.UnitTests
Assert.NotEqual(manager.EncryptedSecret, differentManager.EncryptedSecret);
Assert.NotEqual(manager.ExtPubKey, differentManager.ExtPubKey);
- var manager5 = new KeyManager(manager2.EncryptedSecret, manager2.ChainCode, password: null!);
+ var manager5 = new KeyManager(manager2.EncryptedSecret, manager2.ChainCode, password: null!, Network.Main);
Assert.Equal(manager2.ChainCode, manager5.ChainCode);
Assert.Equal(manager2.EncryptedSecret, manager5.EncryptedSecret);
Assert.Equal(manager2.ExtPubKey, manager5.ExtPubKey);

MODIFY
WalletWasabi/Blockchain/Keys/KeyManager.cs
WalletWasabi/Blockchain/Keys/KeyManager.cs
@@ -60,7 +60,7 @@ namespace WalletWasabi.Blockchain.Keys
ToFile();
}
- public KeyManager(BitcoinEncryptedSecretNoEC encryptedSecret, byte[] chainCode, string password, int minGapLimit = AbsoluteMinGapLimit, string? filePath = null, KeyPath? accountKeyPath = null)
+ public KeyManager(BitcoinEncryptedSecretNoEC encryptedSecret, byte[] chainCode, string password, Network network, int minGapLimit = AbsoluteMinGapLimit, string? filePath = null, KeyPath? accountKeyPath = null)
{
HdPubKeys = new List<HdPubKey>();
HdPubKeyScriptBytes = new List<byte[]>();
@@ -68,7 +68,7 @@ namespace WalletWasabi.Blockchain.Keys
HdPubKeysLock = new object();
HdPubKeyScriptBytesLock = new object();
ScriptHdPubKeyMapLock = new object();
- BlockchainState = new BlockchainState();
+ BlockchainState = new BlockchainState(network);
BlockchainStateLock = new object();
password ??= "";

Add network for missing places