diff --git a/test/data/migrations/wallet-0-migrate-migrations-gen.js b/test/data/migrations/wallet-0-migrate-migrations-gen.js index 7d4fd0f3..3c69ec9b 100644 --- a/test/data/migrations/wallet-0-migrate-migrations-gen.js +++ b/test/data/migrations/wallet-0-migrate-migrations-gen.js @@ -34,5 +34,5 @@ async function getMigrationDump(wdb) { 'M' ]; - return mutils.dumpWDB(wdb, prefixes.map(mutils.prefix2hex)); + return mutils.dumpDB(wdb, prefixes.map(mutils.prefix2hex)); } diff --git a/test/data/migrations/wallet-1-change-gen.js b/test/data/migrations/wallet-1-change-gen.js index 31cc9605..2d71d63c 100644 --- a/test/data/migrations/wallet-1-change-gen.js +++ b/test/data/migrations/wallet-1-change-gen.js @@ -162,8 +162,8 @@ async function getMigrationDump(wdb) { beforeOnlyPrefixes.push(layout.wdb.W.encode(0).toString('hex')); beforeOnlyPrefixes.push(layout.wdb.w.encode(0).toString('hex')); - const dump = await mutils.dumpWDB(wdb, prefixes); - const dumpBeforeOnly = await mutils.dumpWDB(wdb, beforeOnlyPrefixes); + const dump = await mutils.dumpDB(wdb, prefixes); + const dumpBeforeOnly = await mutils.dumpDB(wdb, beforeOnlyPrefixes); const beforeOnly = dumpBeforeOnly; const filtered = {}; diff --git a/test/data/migrations/wallet-2-account-lookahead-gen.js b/test/data/migrations/wallet-2-account-lookahead-gen.js index 93d36fdf..fe2d45f6 100644 --- a/test/data/migrations/wallet-2-account-lookahead-gen.js +++ b/test/data/migrations/wallet-2-account-lookahead-gen.js @@ -83,5 +83,5 @@ async function getMigrationDump(wdb) { prefixes.push(layout.wdb.a.encode(i, 0).slice(0, 5).toString('hex')); } - return await mutils.dumpWDB(wdb, prefixes); + return await mutils.dumpDB(wdb, prefixes); } diff --git a/test/data/migrations/wallet-2-account-lookahead-gen.json b/test/data/migrations/wallet-2-account-lookahead.json similarity index 100% rename from test/data/migrations/wallet-2-account-lookahead-gen.json rename to test/data/migrations/wallet-2-account-lookahead.json diff --git a/test/util/migrations.js b/test/util/migrations.js index 7929a0dd..7c4fbc16 100644 --- a/test/util/migrations.js +++ b/test/util/migrations.js @@ -200,8 +200,8 @@ exports.prefix2hex = function prefix2hex(prefix) { return Buffer.from(prefix, 'ascii').toString('hex'); }; -exports.dumpWDB = async (wdb, prefixes) => { - const data = await wdb.dump(); +exports.dumpDB = async (db, prefixes) => { + const data = await db.dump(); const filtered = {}; for (const [key, value] of Object.entries(data)) { @@ -215,3 +215,7 @@ exports.dumpWDB = async (wdb, prefixes) => { return filtered; }; + +exports.dumpChainDB = async (chaindb, prefixes) => { + return exports.dumpDB(chaindb.db, prefixes); +}; diff --git a/test/wallet-migration-test.js b/test/wallet-migration-test.js index 8f5560d1..3d853db0 100644 --- a/test/wallet-migration-test.js +++ b/test/wallet-migration-test.js @@ -375,7 +375,7 @@ describe('Wallet Migrations', function() { describe('Migrate change address (data)', function() { const location = testdir('wallet-lookahead-data'); const migrationsBAK = WalletMigrator.migrations; - const data = require('./data/migrations/wallet-2-account-lookahead-gen.json'); + const data = require('./data/migrations/wallet-2-account-lookahead.json'); const Migration = WalletMigrator.MigrateAccountLookahead; const walletOptions = {