mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
fix some api functions to work with parsed version of transaction
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
|
/* eslint-disable max-params */
|
||||||
'use strict';
|
'use strict';
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const utils = require('./utils');
|
const utils = require('./utils');
|
||||||
@@ -28,7 +29,7 @@ function transactionFilter(address, filters, tx) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (filters.counterparty && tx.address !== filters.counterparty
|
if (filters.counterparty && tx.address !== filters.counterparty
|
||||||
&& tx.Destination !== filters.counterparty) {
|
&& tx.specification.destination.address !== filters.counterparty) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -71,10 +71,12 @@ function signum(num) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function compareTransactions(first, second) {
|
function compareTransactions(first, second) {
|
||||||
if (first.ledgerVersion === second.ledgerVersion) {
|
if (first.outcome.ledgerVersion === second.outcome.ledgerVersion) {
|
||||||
return signum(Number(first.indexInLedger) - Number(second.indexInLedger));
|
return signum(Number(first.outcome.indexInLedger) -
|
||||||
|
Number(second.outcome.indexInLedger));
|
||||||
}
|
}
|
||||||
return Number(first.ledgerVersion) < Number(second.ledgerVersion) ? -1 : 1;
|
return Number(first.outcome.ledgerVersion) <
|
||||||
|
Number(second.outcome.ledgerVersion) ? -1 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function hasCompleteLedgerRange(remote, minLedgerVersion, maxLedgerVersion) {
|
function hasCompleteLedgerRange(remote, minLedgerVersion, maxLedgerVersion) {
|
||||||
|
|||||||
Reference in New Issue
Block a user