This commit is contained in:
Overtorment 2018-07-02 19:14:44 +01:00
parent 6a65f35a8b
commit f8f8015bf4
2 changed files with 13 additions and 0 deletions

View File

@ -236,3 +236,14 @@ it('Wallet can fetch UTXO', async () => {
await w.fetchUtxo();
assert.ok(w.utxo.length > 0, 'unexpected empty UTXO');
});
it.skip('Wallet can fetch balance', async () => {
let w = new LegacyWallet();
w._address = '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa'; // hack internals
assert.ok(w.getBalance() === 0);
assert.ok(w._lastBalanceFetch === 0);
await w.fetchBalance();
console.log(w.getBalance());
assert.ok(w.getBalance() > 0);
assert.ok(w._lastBalanceFetch > 0);
});

View File

@ -74,6 +74,8 @@ export class LegacyWallet extends AbstractWallet {
* Fetches balance of the Wallet via API.
* Returns VOID. Get the actual balance via getter.
*
* TODO: rewrite on Frisbee
*
* @returns {Promise.<void>}
*/
async fetchBalance() {