change order to 'desc'
This commit is contained in:
parent
01a3df31c8
commit
0c24271833
@ -79,7 +79,7 @@ AddressService.prototype.getAddressHistory = function(addresses, options, callba
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
options.txIdList = lodash.sortBy(list,['height','txid']);
|
options.txIdList = lodash.orderBy(list,['height','txid'], ['desc','asc']);
|
||||||
self._getAddressTxHistory(options, function(err, txList) {
|
self._getAddressTxHistory(options, function(err, txList) {
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|||||||
@ -81,19 +81,19 @@ describe('Address Service', function() {
|
|||||||
addressService._getAddressTxidHistory = function(addr, options, cb) {
|
addressService._getAddressTxidHistory = function(addr, options, cb) {
|
||||||
options.txIdList = [
|
options.txIdList = [
|
||||||
{
|
{
|
||||||
txid: "b",
|
txid: "d",
|
||||||
|
height: 10,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
txid: "c",
|
||||||
height: 10,
|
height: 10,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
txid: "a",
|
txid: "a",
|
||||||
height: 10,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
txid: "d",
|
|
||||||
height: 101,
|
height: 101,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
txid: "c",
|
txid: "b",
|
||||||
height: 100,
|
height: 100,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@ -163,7 +163,7 @@ describe('Address Service', function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expect(res.totalCount).equal(3);
|
expect(res.totalCount).equal(3);
|
||||||
expect(lodash.map(res.items,'txid')).to.be.deep.equal(['b','c','d']);
|
expect(lodash.map(res.items,'txid')).to.be.deep.equal(['d','c','b']);
|
||||||
|
|
||||||
addressService._getAddressTxidHistory = old_getAddressTxHistory;
|
addressService._getAddressTxidHistory = old_getAddressTxHistory;
|
||||||
addressService._getAddressTxHistory = old_getAddressTxHistory;
|
addressService._getAddressTxHistory = old_getAddressTxHistory;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user