fix some api functions to work with parsed version of transaction

This commit is contained in:
Ivan Tivonenko
2015-07-23 06:14:01 +03:00
parent dc2a6c75cf
commit ab694381d5
2 changed files with 7 additions and 4 deletions

View File

@@ -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;

View File

@@ -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) {