aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-08-29 09:45:45 +0200
committerFlorian Dold <florian@dold.me>2023-08-29 09:46:43 +0200
commit55bdc161b58ddf4f24e32dff9acd8011a4364327 (patch)
tree1506387802bff37c376cd50bc42c444344afe928 /packages/taler-wallet-core
parentb13bd85215ad64e7a2764ac7e7fee5945ffa1c07 (diff)
taler-harness: add exchange-purse test
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r--packages/taler-wallet-core/src/index.ts8
-rw-r--r--packages/taler-wallet-core/src/operations/pay-peer-common.ts22
-rw-r--r--packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts2
-rw-r--r--packages/taler-wallet-core/src/operations/pay-peer-push-credit.ts2
4 files changed, 4 insertions, 30 deletions
diff --git a/packages/taler-wallet-core/src/index.ts b/packages/taler-wallet-core/src/index.ts
index 8dd06fe2b..d64f7d5e6 100644
--- a/packages/taler-wallet-core/src/index.ts
+++ b/packages/taler-wallet-core/src/index.ts
@@ -51,12 +51,8 @@ export * from "./operations/refresh.js";
export * from "./dbless.js";
-export {
- nativeCryptoR,
- nativeCrypto,
- nullCrypto,
- TalerCryptoInterface,
-} from "./crypto/cryptoImplementation.js";
+export * from "./crypto/cryptoTypes.js";
+export * from "./crypto/cryptoImplementation.js";
export * from "./util/timer.js";
export * from "./util/denominations.js";
diff --git a/packages/taler-wallet-core/src/operations/pay-peer-common.ts b/packages/taler-wallet-core/src/operations/pay-peer-common.ts
index 1bc2e8d49..4fdfecb4d 100644
--- a/packages/taler-wallet-core/src/operations/pay-peer-common.ts
+++ b/packages/taler-wallet-core/src/operations/pay-peer-common.ts
@@ -420,28 +420,6 @@ export const codecForExchangePurseStatus = (): Codec<ExchangePurseStatus> =>
.property("merge_timestamp", codecOptional(codecForTimestamp))
.build("ExchangePurseStatus");
-export function talerPaytoFromExchangeReserve(
- exchangeBaseUrl: string,
- reservePub: string,
-): string {
- const url = new URL(exchangeBaseUrl);
- let proto: string;
- if (url.protocol === "http:") {
- proto = "taler-reserve-http";
- } else if (url.protocol === "https:") {
- proto = "taler-reserve";
- } else {
- throw Error(`unsupported exchange base URL protocol (${url.protocol})`);
- }
-
- let path = url.pathname;
- if (!path.endsWith("/")) {
- path = path + "/";
- }
-
- return `payto://${proto}/${url.host}${url.pathname}${reservePub}`;
-}
-
export async function getMergeReserveInfo(
ws: InternalWalletState,
req: {
diff --git a/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts b/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts
index 88b441cdd..954300264 100644
--- a/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts
+++ b/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts
@@ -45,6 +45,7 @@ import {
j2s,
makeErrorDetail,
stringifyTalerUri,
+ talerPaytoFromExchangeReserve,
} from "@gnu-taler/taler-util";
import {
readSuccessResponseJsonOrErrorCode,
@@ -74,7 +75,6 @@ import {
import {
codecForExchangePurseStatus,
getMergeReserveInfo,
- talerPaytoFromExchangeReserve,
} from "./pay-peer-common.js";
import {
constructTransactionIdentifier,
diff --git a/packages/taler-wallet-core/src/operations/pay-peer-push-credit.ts b/packages/taler-wallet-core/src/operations/pay-peer-push-credit.ts
index e76b934fa..c552d63f0 100644
--- a/packages/taler-wallet-core/src/operations/pay-peer-push-credit.ts
+++ b/packages/taler-wallet-core/src/operations/pay-peer-push-credit.ts
@@ -47,6 +47,7 @@ import {
j2s,
makeErrorDetail,
parsePayPushUri,
+ talerPaytoFromExchangeReserve,
} from "@gnu-taler/taler-util";
import { readSuccessResponseJsonOrThrow } from "@gnu-taler/taler-util/http";
import {
@@ -71,7 +72,6 @@ import { updateExchangeFromUrl } from "./exchanges.js";
import {
codecForExchangePurseStatus,
getMergeReserveInfo,
- talerPaytoFromExchangeReserve,
} from "./pay-peer-common.js";
import {
TransitionInfo,