|
|
@ -6027,7 +6027,6 @@ describe('Wallet service', function() { |
|
|
|
address: mainAddresses[0].address, |
|
|
|
amount: 200, |
|
|
|
}], |
|
|
|
size: 500, |
|
|
|
}]; |
|
|
|
helpers.stubHistory(txs); |
|
|
|
server.getTxHistory({}, function(err, txs) { |
|
|
@ -6039,7 +6038,6 @@ describe('Wallet service', function() { |
|
|
|
tx.amount.should.equal(200); |
|
|
|
tx.fees.should.equal(100); |
|
|
|
tx.time.should.equal(20); |
|
|
|
tx.lowFees.should.be.true; |
|
|
|
done(); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -6307,6 +6305,79 @@ describe('Wallet service', function() { |
|
|
|
done(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
it('should set lowFees atribute for sub-superEconomy level fees', function(done) { |
|
|
|
helpers.stubFeeLevels({ |
|
|
|
24: 10000, |
|
|
|
}); |
|
|
|
server._normalizeTxHistory = sinon.stub().returnsArg(0); |
|
|
|
var txs = [{ |
|
|
|
txid: '1', |
|
|
|
confirmations: 1, |
|
|
|
fees: 100, |
|
|
|
time: 20, |
|
|
|
inputs: [{ |
|
|
|
address: 'external', |
|
|
|
amount: 500, |
|
|
|
}], |
|
|
|
outputs: [{ |
|
|
|
address: mainAddresses[0].address, |
|
|
|
amount: 200, |
|
|
|
}], |
|
|
|
size: 500, |
|
|
|
}, { |
|
|
|
txid: '2', |
|
|
|
confirmations: 1, |
|
|
|
fees: 6000, |
|
|
|
time: 20, |
|
|
|
inputs: [{ |
|
|
|
address: 'external', |
|
|
|
amount: 500, |
|
|
|
}], |
|
|
|
outputs: [{ |
|
|
|
address: mainAddresses[0].address, |
|
|
|
amount: 200, |
|
|
|
}], |
|
|
|
size: 500, |
|
|
|
}]; |
|
|
|
helpers.stubHistory(txs); |
|
|
|
server.getTxHistory({}, function(err, txs) { |
|
|
|
should.not.exist(err); |
|
|
|
var tx = txs[0]; |
|
|
|
tx.feePerKb.should.equal(200); |
|
|
|
tx.lowFees.should.be.true; |
|
|
|
var tx = txs[1]; |
|
|
|
tx.feePerKb.should.equal(12000); |
|
|
|
tx.lowFees.should.be.false; |
|
|
|
done(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
it('should get tx history even if fee levels are unavailable', function(done) { |
|
|
|
blockchainExplorer.estimateFee = sinon.stub().yields('dummy error'); |
|
|
|
server._normalizeTxHistory = sinon.stub().returnsArg(0); |
|
|
|
var txs = [{ |
|
|
|
txid: '1', |
|
|
|
confirmations: 1, |
|
|
|
fees: 100, |
|
|
|
time: 20, |
|
|
|
inputs: [{ |
|
|
|
address: 'external', |
|
|
|
amount: 500, |
|
|
|
}], |
|
|
|
outputs: [{ |
|
|
|
address: mainAddresses[0].address, |
|
|
|
amount: 200, |
|
|
|
}], |
|
|
|
size: 500, |
|
|
|
}]; |
|
|
|
helpers.stubHistory(txs); |
|
|
|
server.getTxHistory({}, function(err, txs) { |
|
|
|
should.not.exist(err); |
|
|
|
var tx = txs[0]; |
|
|
|
tx.feePerKb.should.equal(200); |
|
|
|
should.not.exist(tx.lowFees); |
|
|
|
done(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
describe('#getTxHistory cache', function() { |
|
|
|