Skip to content

Commit

Permalink
test: fix wallet-migration for txdb.
Browse files Browse the repository at this point in the history
  • Loading branch information
nodech committed Oct 20, 2023
1 parent b53d392 commit 1f2251e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/wallet-migration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ describe('Wallet Migrations', function() {
assert.strictEqual(balance.clocked, expected.clocked);
};

let walletDB, ldb, wdbOpenSync;
let walletDB, ldb;
before(async () => {
WalletMigrator.migrations = {};
await fs.mkdirp(location);
Expand All @@ -736,7 +736,6 @@ describe('Wallet Migrations', function() {
beforeEach(async () => {
walletDB = new WalletDB(walletOptions);
ldb = walletDB.db;
wdbOpenSync = wdbOpenSyncFn(walletDB);
});

afterEach(async () => {
Expand All @@ -746,7 +745,7 @@ describe('Wallet Migrations', function() {

it('should write some coins w/o updating balance', async () => {
// generate credits for the first 10 addresses stored on initialization.
await wdbOpenSync();
await walletDB.open();

const wallet = walletDB.primary;

Expand Down Expand Up @@ -871,7 +870,7 @@ describe('Wallet Migrations', function() {
});

it('should have incorrect balance before migration', async () => {
await wdbOpenSync();
await walletDB.open();

const wallet = walletDB.primary;
const balance = await wallet.getBalance(-1);
Expand Down Expand Up @@ -903,7 +902,7 @@ describe('Wallet Migrations', function() {
it('should migrate', async () => {
walletDB.options.walletMigrate = 0;

await wdbOpenSync();
await walletDB.open();

const wallet = walletDB.primary;
const balance = await wallet.getBalance(-1);
Expand Down

0 comments on commit 1f2251e

Please sign in to comment.