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) {
|
||||
|
||||
if (err) {
|
||||
|
||||
@ -81,19 +81,19 @@ describe('Address Service', function() {
|
||||
addressService._getAddressTxidHistory = function(addr, options, cb) {
|
||||
options.txIdList = [
|
||||
{
|
||||
txid: "b",
|
||||
txid: "d",
|
||||
height: 10,
|
||||
},
|
||||
{
|
||||
txid: "c",
|
||||
height: 10,
|
||||
},
|
||||
{
|
||||
txid: "a",
|
||||
height: 10,
|
||||
},
|
||||
{
|
||||
txid: "d",
|
||||
height: 101,
|
||||
},
|
||||
{
|
||||
txid: "c",
|
||||
txid: "b",
|
||||
height: 100,
|
||||
},
|
||||
];
|
||||
@ -163,7 +163,7 @@ describe('Address Service', function() {
|
||||
}
|
||||
|
||||
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._getAddressTxHistory = old_getAddressTxHistory;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user