wdb-test: rename lookahead migration data.
This commit is contained in:
parent
006aa97888
commit
c5dfced233
6 changed files with 11 additions and 7 deletions
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 = {};
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue