private string GetAddrmanFile() { string walletFolderPath = WalletFileTools.GetWalletFolder(_wallet.Id); var addrFilePath = Path.Combine(walletFolderPath, "addrman.dat"); return(addrFilePath); }
private string GetTrackerFile() { string walletFolderPath = WalletFileTools.GetWalletFolder(_wallet.Id); var trackerFilePath = Path.Combine(walletFolderPath, "tracker.dat"); return(trackerFilePath); }
private string GetChainFile() { string walletFolderPath = WalletFileTools.GetWalletFolder(_wallet.Id); var chainFilePath = Path.Combine(walletFolderPath, "chain.dat"); return(chainFilePath); }
public void GetWalletRecoveryFilePath() { string actualPath = WalletFileTools.GetWalletRecoveryFilePath(_wallet.Id); string expectedPath = Path.Combine(App.WalletsDir, _wallet.Id, "wallet.recover.jet"); Assert.AreEqual(expectedPath, actualPath); }
public void GetWalletFolder() { string actualFolderPath = WalletFileTools.GetWalletFolder(_wallet.Id); string expectedFolderPath = Path.Combine(App.WalletsDir, _wallet.Id); Assert.AreEqual(expectedFolderPath, actualFolderPath); }
public void CreateWalletFolder() { WalletFileTools.CreateWalletFolder(_wallet.Id); string folderPath = Path.Combine(App.WalletsDir, _wallet.Id); Assert.True(Directory.Exists(folderPath)); }
public void CleanWalletFolder() { string walletFolder = WalletFileTools.GetWalletFolder(_wallet.Id); if (Directory.Exists(walletFolder)) { Directory.Delete(walletFolder, true); } WalletFileTools.CreateWalletFolder(_mock.Object.Id); }
public void Init() { _wallet = WalletGenerator.GenerateMockWallet(); // for encryption and decryption tests _key = "238085A3C30982B6DBE1F6F5CEFA4584"; _path = WalletFileTools.GetWalletFilePath(_wallet.Id); _recoverypath = WalletFileTools.GetWalletRecoveryFilePath(_wallet.Id); }
private void CreateWrongChain() { string walletFolderPath = WalletFileTools.GetWalletFolder(_wallet.Id); var chainFilePath = Path.Combine(walletFolderPath, "chain.dat"); var wrongNetwork = Network.Main; // _wallet.NetworkChoice = Network.Testnet ConcurrentChain mainChain = new ConcurrentChain(wrongNetwork); using (var fs = File.Open(chainFilePath, FileMode.Create)) { mainChain.WriteTo(fs); } }
public JetWalletModel(string id, string name, ExtKey masterKey, Network net, WalletCreation walletSetup, string description = "No Description Provided") : base(walletSetup) { _wconnect = new JetWalletConnectModel(this); _id = id; _name = name; _description = description; _masterkey = masterKey; _walletkeys = new List <WalletKey>(); _net = net; WalletFileTools.CreateWalletFolder(Id); GenerateWalletKeys(); }
public void BadAddressManager() { _wconnect.Start(); _wconnect.Stop(); string walletFolderPath = WalletFileTools.GetWalletFolder(_wallet.Id); var addrmanFilePath = Path.Combine(walletFolderPath, "addrman.dat"); using (var fs = File.Open(addrmanFilePath, FileMode.Create)) { StreamWriter writer = new StreamWriter(fs); writer.WriteLine("BAD_ADDRESS_MANAGER"); writer.Dispose(); } Assert.Throws <OverflowException>(() => _wconnect.Start()); }
public void BadTrackerFile() { _wconnect.Start(); _wconnect.Stop(); string walletFolderPath = WalletFileTools.GetWalletFolder(_wallet.Id); var trackerFilePath = Path.Combine(walletFolderPath, "tracker.dat"); using (var fs = File.Open(trackerFilePath, FileMode.Create)) { StreamWriter writer = new StreamWriter(fs); writer.WriteLine("BAD_TRACKER"); writer.Dispose(); } Assert.Throws <JsonReaderException>(() => _wconnect.Start()); }
public void CheckWalletFilePath() { Assert.DoesNotThrow(() => WalletFileTools.CheckWalletFilePath(_wallet.Id)); }
public void Clear() { FileSecurity.LiftFileDefense(_path); FileSecurity.LiftFileDefense(_recoverypath); Directory.Delete(WalletFileTools.GetWalletFolder(_wallet.Id), true); }