aboutsummaryrefslogtreecommitdiff
path: root/src/operations/history.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-12-16 16:20:45 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-12-16 16:20:45 +0100
commit35a7b76a7d935dc2c749fd39ac80c6af1096b795 (patch)
treeb7f0bb167d3c912a085e7b842e887d5c834208fb /src/operations/history.ts
parentfa4621e70c48500a372504eb8ae9b9481531c555 (diff)
downloadwallet-core-35a7b76a7d935dc2c749fd39ac80c6af1096b795.tar.xz
history WIP, DB naming
Diffstat (limited to 'src/operations/history.ts')
-rw-r--r--src/operations/history.ts15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/operations/history.ts b/src/operations/history.ts
index 7e985d218..eec398f37 100644
--- a/src/operations/history.ts
+++ b/src/operations/history.ts
@@ -201,7 +201,7 @@ export async function getHistory(
});
tx.iter(Stores.withdrawalSession).forEach(wsr => {
- if (wsr.finishTimestamp) {
+ if (wsr.timestampFinish) {
history.push({
type: HistoryEventType.Withdrawn,
withdrawSessionId: wsr.withdrawSessionId,
@@ -212,7 +212,8 @@ export async function getHistory(
amountWithdrawnEffective: Amounts.toString(wsr.totalCoinValue),
amountWithdrawnRaw: Amounts.toString(wsr.rawWithdrawalAmount),
exchangeBaseUrl: wsr.exchangeBaseUrl,
- timestamp: wsr.finishTimestamp,
+ timestamp: wsr.timestampFinish,
+ withdrawalSource: wsr.source,
});
}
});
@@ -239,7 +240,7 @@ export async function getHistory(
});
await tx.iter(Stores.refreshGroups).forEachAsync(async (rg) => {
- if (!rg.finishedTimestamp) {
+ if (!rg.timestampFinished) {
return;
}
let numInputCoins = 0;
@@ -252,8 +253,8 @@ export async function getHistory(
numInputCoins++;
if (session) {
numRefreshedInputCoins++;
- amountsRaw.push(session.valueWithFee);
- amountsEffective.push(session.valueOutput);
+ amountsRaw.push(session.amountRefreshInput);
+ amountsEffective.push(session.amountRefreshOutput);
numOutputCoins += session.newDenoms.length;
} else {
const c = await tx.get(Stores.coins, rg.oldCoinPubs[i]);
@@ -274,7 +275,7 @@ export async function getHistory(
type: HistoryEventType.Refreshed,
refreshGroupId: rg.refreshGroupId,
eventId: makeEventId(HistoryEventType.Refreshed, rg.refreshGroupId),
- timestamp: rg.finishedTimestamp,
+ timestamp: rg.timestampFinished,
refreshReason: rg.reason,
amountRefreshedEffective: Amounts.toString(amountRefreshedEffective),
amountRefreshedRaw: Amounts.toString(amountRefreshedRaw),
@@ -305,7 +306,7 @@ export async function getHistory(
eventId: makeEventId(HistoryEventType.ReserveBalanceUpdated, ru.reserveUpdateId),
amountExpected: ru.amountExpected,
amountReserveBalance: ru.amountReserveBalance,
- timestamp: reserve.created,
+ timestamp: reserve.timestampCreated,
newHistoryTransactions: ru.newHistoryTransactions,
reserveShortInfo: {
exchangeBaseUrl: reserve.exchangeBaseUrl,