upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/selftest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/selftest.cpp')
-rw-r--r--src/selftest.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/selftest.cpp b/src/selftest.cpp
index 8a448f0..b112238 100644
--- a/src/selftest.cpp
+++ b/src/selftest.cpp
@@ -1314,6 +1314,21 @@ static int RunWalletPortabilitySelfTest()
1314 FileContainsText(strOriginalAudit, "SLIP-0044 BITFLASH"), 1314 FileContainsText(strOriginalAudit, "SLIP-0044 BITFLASH"),
1315 "the original wallet reports its recovery phrase") ? 0 : 1; 1315 "the original wallet reports its recovery phrase") ? 0 : 1;
1316 1316
1317 string strOriginalStorageAudit = tmp + "/original-storage-audit.txt";
1318 vector<string> vOriginalStorageAuditArgs;
1319 vOriginalStorageAuditArgs.push_back("-datadir=" + strOriginal);
1320 vOriginalStorageAuditArgs.push_back("-nomanagedtor");
1321 vOriginalStorageAuditArgs.push_back("-nogui");
1322 vOriginalStorageAuditArgs.push_back("-walletstorageaudit");
1323 int nOriginalStorageAuditRet =
1324 RunBitflashChild(strExe, vOriginalStorageAuditArgs, NULL, &strOriginalStorageAudit);
1325 nFail += Check(nOriginalStorageAuditRet == 0 &&
1326 FileContainsText(strOriginalStorageAudit, "Wallet storage audit") &&
1327 FileContainsText(strOriginalStorageAudit, "plain HD seed: complete") &&
1328 FileContainsText(strOriginalStorageAudit, "encrypted HD seed: none") &&
1329 FileContainsText(strOriginalStorageAudit, "malformed records: 0"),
1330 "the storage audit recognizes a plaintext phrase wallet") ? 0 : 1;
1331
1317 string strPortableWallet = tmp + "/portable-wallet.dat"; 1332 string strPortableWallet = tmp + "/portable-wallet.dat";
1318 string strBackupOut = tmp + "/backupwallet.txt"; 1333 string strBackupOut = tmp + "/backupwallet.txt";
1319 vector<string> vBackupArgs; 1334 vector<string> vBackupArgs;
@@ -1368,6 +1383,23 @@ static int RunWalletPortabilitySelfTest()
1368 nFail += Check(nEncryptRet == 0 && 1383 nFail += Check(nEncryptRet == 0 &&
1369 !DirectoryHasFileWithPrefix(strOriginal + "/database", "log."), 1384 !DirectoryHasFileWithPrefix(strOriginal + "/database", "log."),
1370 "the encryptwallet command purges Berkeley DB environment logs") ? 0 : 1; 1385 "the encryptwallet command purges Berkeley DB environment logs") ? 0 : 1;
1386
1387 string strEncryptedStorageAudit = tmp + "/encrypted-storage-audit.txt";
1388 vector<string> vEncryptedStorageAuditArgs;
1389 vEncryptedStorageAuditArgs.push_back("-datadir=" + strOriginal);
1390 vEncryptedStorageAuditArgs.push_back("-nomanagedtor");
1391 vEncryptedStorageAuditArgs.push_back("-nogui");
1392 vEncryptedStorageAuditArgs.push_back("-walletstorageaudit");
1393 int nEncryptedStorageAuditRet =
1394 RunBitflashChild(strExe, vEncryptedStorageAuditArgs, NULL, &strEncryptedStorageAudit);
1395 nFail += Check(nEncryptedStorageAuditRet == 0 &&
1396 FileContainsText(strEncryptedStorageAudit, "plain private keys: 0") &&
1397 FileContainsText(strEncryptedStorageAudit, "encrypted private keys:") &&
1398 FileContainsText(strEncryptedStorageAudit, "plain HD seed: none") &&
1399 FileContainsText(strEncryptedStorageAudit, "encrypted HD seed: complete") &&
1400 FileContainsText(strEncryptedStorageAudit, "wallet minimum version: present") &&
1401 FileContainsText(strEncryptedStorageAudit, "malformed records: 0"),
1402 "the storage audit recognizes an encrypted wallet") ? 0 : 1;
1371 } 1403 }
1372 catch (const std::exception& e) 1404 catch (const std::exception& e)
1373 { 1405 {