add bitcoinstore to unit tests
MODIFY
WalletWasabi.Tests/UnitTests/Transactions/PayjoinTests.cs
WalletWasabi.Tests/UnitTests/Transactions/PayjoinTests.cs
@@ -15,6 +15,9 @@ using System.Net.Http;
using System.Net;
using System.Text;
using WalletWasabi.Models;
+using System.IO;
+using WalletWasabi.Helpers;
+using WalletWasabi.Stores;
namespace WalletWasabi.Tests.UnitTests.Transactions
{
@@ -399,7 +402,12 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
}
}
var coinsView = new CoinsView(scoins);
- return new TransactionFactory(Network.Main, keyManager, coinsView, null, password, allowUnconfirmed);
+
+ var dataDir = Path.Combine(Global.Instance.DataDir, EnvironmentHelpers.GetCallerFileName());
+
+ var bitcoinStore = new BitcoinStore(Path.Combine(dataDir, EnvironmentHelpers.GetMethodName()), Network.Main, new IndexStore(Network.Main, new SmartHeaderChain()), new AllTransactionStore(), new MempoolService());
+
+ return new TransactionFactory(Network.Main, keyManager, coinsView, bitcoinStore, password, allowUnconfirmed);
}
private static (string, KeyManager) DefaultKeyManager()

MODIFY
WalletWasabi.Tests/UnitTests/Transactions/TransactionFactoryTests.cs
WalletWasabi.Tests/UnitTests/Transactions/TransactionFactoryTests.cs
using NBitcoin;
using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
using WalletWasabi.Blockchain.Analysis.Clustering;
+using WalletWasabi.Blockchain.Blocks;
using WalletWasabi.Blockchain.Keys;
+using WalletWasabi.Blockchain.Mempool;
using WalletWasabi.Blockchain.TransactionBuilding;
using WalletWasabi.Blockchain.TransactionOutputs;
using WalletWasabi.Blockchain.Transactions;
using WalletWasabi.Exceptions;
+using WalletWasabi.Helpers;
using WalletWasabi.Models;
+using WalletWasabi.Stores;
using WalletWasabi.Wallets;
using Xunit;
@@ -175,6 +180,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
[Fact]
public void SelectSameClusterCoins()
{
+
var (password, keyManager) = DefaultKeyManager();
keyManager.AssertCleanKeysIndexed();
@@ -212,7 +218,13 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
}
var coinsView = new CoinsView(scoins.ToArray());
- var transactionFactory = new TransactionFactory(Network.Main, keyManager, coinsView, null, password);
+
+ var dataDir = Path.Combine(Global.Instance.DataDir, EnvironmentHelpers.GetCallerFileName());
+
+ var bitcoinStore = new BitcoinStore(Path.Combine(dataDir, EnvironmentHelpers.GetMethodName()), Network.Main,
+ new IndexStore(Network.Main, new SmartHeaderChain()), new AllTransactionStore(), new MempoolService());
+
+ var transactionFactory = new TransactionFactory(Network.Main, keyManager, coinsView, bitcoinStore, password);
// Two 0.9btc coins are enough
var payment = new PaymentIntent(new Key().ScriptPubKey, Money.Coins(1.75m), label: "Sophie");
@@ -612,7 +624,14 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
}
}
var coinsView = new CoinsView(scoins);
- return new TransactionFactory(Network.Main, keyManager, coinsView, null, password, allowUnconfirmed);
+
+ var dataDir = Path.Combine(Global.Instance.DataDir, EnvironmentHelpers.GetCallerFileName());
+
+ var bitcoinStore = new BitcoinStore(Path.Combine(dataDir, EnvironmentHelpers.GetMethodName()), Network.Main, new IndexStore(Network.Main, new SmartHeaderChain()), new AllTransactionStore(), new MempoolService());
+
+ var transactionFactory = new TransactionFactory(Network.Main, keyManager, coinsView, bitcoinStore, password);
+
+ return new TransactionFactory(Network.Main, keyManager, coinsView, bitcoinStore, password, allowUnconfirmed);
}
}
}

add bitcoinstore to unit tests