diff options
author | Florian Dold <florian@dold.me> | 2022-11-02 17:42:14 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-11-02 18:23:17 +0100 |
commit | d50294f76e0aa357d690a933bb6d696a2f6aef1b (patch) | |
tree | abe961337c5df1614b5095bce6c5b09e761cda2c /packages/taler-wallet-core/src/util/denominations.ts | |
parent | 6c3ef31d9a7ba44829e779afed0af9be3ab23723 (diff) | |
download | wallet-core-d50294f76e0aa357d690a933bb6d696a2f6aef1b.tar.xz |
wallet-core: DB FIXMEs (amount format)
Diffstat (limited to 'packages/taler-wallet-core/src/util/denominations.ts')
-rw-r--r-- | packages/taler-wallet-core/src/util/denominations.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/packages/taler-wallet-core/src/util/denominations.ts b/packages/taler-wallet-core/src/util/denominations.ts index 9cd931acd..c05df6c6e 100644 --- a/packages/taler-wallet-core/src/util/denominations.ts +++ b/packages/taler-wallet-core/src/util/denominations.ts @@ -18,6 +18,7 @@ import { AbsoluteTime, AmountJson, Amounts, + AmountString, DenominationInfo, FeeDescription, FeeDescriptionPair, @@ -51,7 +52,7 @@ export function selectBestForOverlappingDenominations< return minDeposit; } -export function selectMinimumFee<T extends { fee: AmountJson }>( +export function selectMinimumFee<T extends { fee: AmountString }>( list: T[], ): T | undefined { let minFee: T | undefined = undefined; @@ -285,7 +286,7 @@ export function createTimeline<Type extends object>( idProp: PropsWithReturnType<Type, string>, periodStartProp: PropsWithReturnType<Type, TalerProtocolTimestamp>, periodEndProp: PropsWithReturnType<Type, TalerProtocolTimestamp>, - feeProp: PropsWithReturnType<Type, AmountJson>, + feeProp: PropsWithReturnType<Type, AmountString>, groupProp: PropsWithReturnType<Type, string> | undefined, selectBestForOverlapping: (l: Type[]) => Type | undefined, ): FeeDescription[] { @@ -312,7 +313,7 @@ export function createTimeline<Type extends object>( } ps.push({ type: "start", - fee, + fee: Amounts.stringify(fee), group, id, moment: AbsoluteTime.fromTimestamp(stampStart), @@ -320,7 +321,7 @@ export function createTimeline<Type extends object>( }); ps.push({ type: "end", - fee, + fee: Amounts.stringify(fee), group, id, moment: AbsoluteTime.fromTimestamp(stampEnd), @@ -416,7 +417,7 @@ export function createTimeline<Type extends object>( group: cursor.group, from: cursor.moment, until: AbsoluteTime.never(), //not yet known - fee: currentFee, + fee: Amounts.stringify(currentFee), }); } else { prev.until = cursor.moment; |