Merge pull request #1101 from mgurzenski/master

FIX: Reduced batchsize to prevent "undefined" error when retrieving transactions
This commit is contained in:
Overtorment 2020-05-20 15:37:20 +01:00 committed by GitHub
commit b853268038
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 1 deletions

View File

@ -339,7 +339,7 @@ module.exports.multiGetHistoryByAddress = async function(addresses, batchsize) {
};
module.exports.multiGetTransactionByTxid = async function(txids, batchsize, verbose) {
batchsize = batchsize || 61;
batchsize = batchsize || 49;
// this value is fine-tuned so althrough wallets in test suite will occasionally
// throw 'response too large (over 1,000,000 bytes', test suite will pass
verbose = verbose !== false;

View File

@ -83,6 +83,27 @@ describe('LegacyWallet', function() {
}
});
it.each([
['addresses for vout missing', '1PVfrmbn1vSMoFZB2Ga7nDuXLFDyJZHrHK'],
['txdatas were coming back null from BlueElectrum because of high batchsize', '34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo'],
])(
'can fetch TXs when %s',
async (useCase, address) => {
let w = new LegacyWallet();
w._address = address;
await w.fetchTransactions();
assert.ok(w.getTransactions().length > 0);
for (let tx of w.getTransactions()) {
assert.ok(tx.hash);
assert.ok(tx.value);
assert.ok(tx.received);
assert.ok(tx.confirmations > 1);
}
},
240000,
);
it('can fetch UTXO', async () => {
let w = new LegacyWallet();
w._address = '12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX';