wdb-test: rename lookahead migration data.

This commit is contained in:
Nodari Chkuaselidze 2024-07-11 17:10:01 +04:00
parent 006aa97888
commit c5dfced233
No known key found for this signature in database
GPG key ID: B018A7BB437D1F05
6 changed files with 11 additions and 7 deletions

View file

@ -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));
}

View file

@ -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 = {};

View file

@ -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);
}

View file

@ -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);
};

View file

@ -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 = {