diff --git a/package-lock.json b/package-lock.json index 50fd505..1f38c43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "beignet", - "version": "0.0.45", + "version": "0.0.47", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "beignet", - "version": "0.0.45", + "version": "0.0.47", "license": "MIT", "dependencies": { "@bitcoinerlab/secp256k1": "1.0.5", diff --git a/package.json b/package.json index 1188890..5fcb47a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "beignet", - "version": "0.0.46", + "version": "0.0.47", "description": "A self-custodial, JS Bitcoin wallet management library.", "main": "dist/index.js", "scripts": { diff --git a/src/wallet/index.ts b/src/wallet/index.ts index 375354c..0901658 100644 --- a/src/wallet/index.ts +++ b/src/wallet/index.ts @@ -273,8 +273,7 @@ export class Wallet { const res = await wallet.setWalletData(); if (res.isErr()) return err(res.error.message); wallet.updateFeeEstimates(true); - console.log('Syncing Wallet...'); - await wallet.refreshWallet({}); + wallet.refreshWallet({}); if (wallet._disableMessagesOnCreate) wallet.disableMessages = false; return ok(wallet); } catch (e) { diff --git a/tests/boost.test.ts b/tests/boost.test.ts index ca8cb32..cdfbc50 100644 --- a/tests/boost.test.ts +++ b/tests/boost.test.ts @@ -76,6 +76,7 @@ beforeEach(async function () { throw res.error; } wallet = res.value; + await wallet.refreshWallet({}); }); describe('Boost', async function () { diff --git a/tests/electrum.test.ts b/tests/electrum.test.ts index bb4a74b..485f1f7 100644 --- a/tests/electrum.test.ts +++ b/tests/electrum.test.ts @@ -13,7 +13,7 @@ const expect = chai.expect; const testTimeout = 60000; -let wallet; +let wallet: Wallet; before(async function () { this.timeout(testTimeout); @@ -33,6 +33,7 @@ before(async function () { return; } wallet = res.value; + await wallet.refreshWallet({}); }); describe('Electrum Methods', async function (): Promise { @@ -40,6 +41,7 @@ describe('Electrum Methods', async function (): Promise { it('connectToElectrum: Should connect to a random Electrum server', async () => { const connectResponse = await wallet.connectToElectrum(); expect(connectResponse.isErr()).to.equal(false); + if (connectResponse.isErr()) return; expect(connectResponse.value).to.equal('Connected to Electrum server.'); }); diff --git a/tests/storage.test.ts b/tests/storage.test.ts index 7eb34ff..1bc7e25 100644 --- a/tests/storage.test.ts +++ b/tests/storage.test.ts @@ -19,7 +19,7 @@ const expect = chai.expect; const testTimeout = 60000; -let wallet; +let wallet: Wallet; const WALLET_NAME = 'storagetestwallet0'; before(async function () { diff --git a/tests/transaction.test.ts b/tests/transaction.test.ts index 18ac1e9..f47b153 100644 --- a/tests/transaction.test.ts +++ b/tests/transaction.test.ts @@ -17,7 +17,7 @@ const expect = chai.expect; const testTimeout = 60000; -let wallet; +let wallet: Wallet; before(async function () { this.timeout(testTimeout); @@ -35,6 +35,7 @@ before(async function () { return; } wallet = res.value; + await wallet.refreshWallet({}); }); describe('Transaction Test', async function (): Promise { @@ -158,7 +159,11 @@ describe('Transaction Test', async function (): Promise { await wallet.transaction.resetSendTransaction(); const setupResponse = await wallet.transaction.setupTransaction({ outputs: [ - { address: 'tb1qaq7jszepjuntxx494xhwrxs746v94583ls02ke', value: 5000 } + { + index: 0, + address: 'tb1qaq7jszepjuntxx494xhwrxs746v94583ls02ke', + value: 5000 + } ] }); expect(setupResponse.isErr()).to.equal(false); diff --git a/tests/wallet.test.ts b/tests/wallet.test.ts index c48a34f..7187620 100644 --- a/tests/wallet.test.ts +++ b/tests/wallet.test.ts @@ -52,6 +52,7 @@ before(async function () { return; } wallet = res.value; + await wallet.refreshWallet({}); }); describe('Wallet Library', async function () {