aboutsummaryrefslogtreecommitdiff
path: root/packages/anastasis-core
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-11-02 17:42:14 +0100
committerFlorian Dold <florian@dold.me>2022-11-02 18:23:17 +0100
commitd50294f76e0aa357d690a933bb6d696a2f6aef1b (patch)
treeabe961337c5df1614b5095bce6c5b09e761cda2c /packages/anastasis-core
parent6c3ef31d9a7ba44829e779afed0af9be3ab23723 (diff)
wallet-core: DB FIXMEs (amount format)
Diffstat (limited to 'packages/anastasis-core')
-rw-r--r--packages/anastasis-core/src/index.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/anastasis-core/src/index.ts b/packages/anastasis-core/src/index.ts
index eb2b41e50..8cb86cd85 100644
--- a/packages/anastasis-core/src/index.ts
+++ b/packages/anastasis-core/src/index.ts
@@ -169,8 +169,8 @@ export class ReducerError extends Error {
constructor(public errorJson: ErrorDetails) {
super(
errorJson.message ??
- errorJson.hint ??
- `${TalerErrorCode[errorJson.code]}`,
+ errorJson.hint ??
+ `${TalerErrorCode[errorJson.code]}`,
);
// Set the prototype explicitly.
@@ -306,7 +306,7 @@ async function getProviderInfo(
status: "error",
code: TalerErrorCode.ANASTASIS_REDUCER_PROVIDER_CONFIG_FAILED,
hint: "provider did not have provider salt",
- }
+ };
}
return {
status: "ok",
@@ -559,8 +559,8 @@ async function uploadSecret(
"content-type": "application/json",
...(paySecret
? {
- "Anastasis-Payment-Identifier": paySecret,
- }
+ "Anastasis-Payment-Identifier": paySecret,
+ }
: {}),
},
body: JSON.stringify(tur),
@@ -651,8 +651,8 @@ async function uploadSecret(
[ANASTASIS_HTTP_HEADER_POLICY_META_DATA]: metadataEnc,
...(paySecret
? {
- "Anastasis-Payment-Identifier": paySecret,
- }
+ "Anastasis-Payment-Identifier": paySecret,
+ }
: {}),
},
body: decodeCrock(encRecoveryDoc),
@@ -663,12 +663,12 @@ async function uploadSecret(
let policyExpiration: TalerProtocolTimestamp = { t_s: 0 };
try {
policyVersion = Number(resp.headers.get("Anastasis-Version") ?? "0");
- } catch (e) { }
+ } catch (e) {}
try {
policyExpiration = {
t_s: Number(resp.headers.get("Anastasis-Policy-Expiration") ?? "0"),
};
- } catch (e) { }
+ } catch (e) {}
successDetails[prov.provider_url] = {
policy_version: policyVersion,
policy_expiration: policyExpiration,
@@ -1469,7 +1469,7 @@ async function updateUploadFees(
const addFee = (x: AmountLike) => {
x = Amounts.jsonifyAmount(x);
feePerCurrency[x.currency] = Amounts.add(
- feePerCurrency[x.currency] ?? Amounts.getZero(x.currency),
+ feePerCurrency[x.currency] ?? Amounts.zeroOfAmount(x),
x,
).amount;
};