diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-03-28 00:18:25 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-03-28 00:18:25 +0530 |
commit | c9012cbd4ce9ba1037807ec1b00a6c9c5e1b0d14 (patch) | |
tree | e83c60c67562b1425434aa0b4d81b4838b15ecde /src/operations | |
parent | 131d2b34d9d1f84782d749c9943a7da5ab9dab8a (diff) | |
download | wallet-core-c9012cbd4ce9ba1037807ec1b00a6c9c5e1b0d14.tar.xz |
add --extra-debug option to history
Diffstat (limited to 'src/operations')
-rw-r--r-- | src/operations/history.ts | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/operations/history.ts b/src/operations/history.ts index b19b9f195..65907de8d 100644 --- a/src/operations/history.ts +++ b/src/operations/history.ts @@ -218,7 +218,7 @@ export async function getHistory( }); let verboseDetails: VerboseWithdrawDetails | undefined = undefined; - if (historyQuery?.verboseDetails) { + if (historyQuery?.extraDebug) { verboseDetails = { coins: cs.map((x) => ({ value: Amounts.toString(x.coinValue), @@ -260,7 +260,7 @@ export async function getHistory( return; } let verboseDetails: VerbosePayCoinDetails | undefined = undefined; - if (historyQuery?.verboseDetails) { + if (historyQuery?.extraDebug) { const coins: { value: string, contribution: string; @@ -337,7 +337,7 @@ export async function getHistory( amountRefreshedEffective = Amounts.sum(amountsEffective).amount; } let verboseDetails: VerboseRefreshDetails | undefined = undefined; - if (historyQuery?.verboseDetails) { + if (historyQuery?.extraDebug) { const outputCoins: { value: string; denomPub: string, @@ -488,11 +488,19 @@ export async function getHistory( tx.iter(Stores.recoupGroups).forEach(rg => { if (rg.timestampFinished) { + let verboseDetails: any = undefined; + if (historyQuery?.extraDebug) { + verboseDetails = { + oldAmountPerCoin: rg.oldAmountPerCoin.map(Amounts.toString), + }; + } + history.push({ type: HistoryEventType.FundsRecouped, timestamp: rg.timestampFinished, eventId: makeEventId(HistoryEventType.FundsRecouped, rg.recoupGroupId), numCoinsRecouped: rg.coinPubs.length, + verboseDetails, }); } }); |