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