aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-05-11 14:29:55 +0200
committerFlorian Dold <florian@dold.me>2023-05-11 14:29:55 +0200
commit359b9860a615b8421dcbb72b763b20f3cae24083 (patch)
tree57ef4df830541fbbae804ea29bd04b5780faa20f /packages/taler-wallet-core/src/wallet.ts
parentedd3a39a0ca01a299b6d9ebed8d34c29a9c3bb30 (diff)
downloadwallet-core-359b9860a615b8421dcbb72b763b20f3cae24083.tar.xz
wallet-core: remove legacy operation names
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r--packages/taler-wallet-core/src/wallet.ts27
1 files changed, 4 insertions, 23 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
index 01df4a5e1..6009ff096 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -80,7 +80,7 @@ import {
codecForGetWithdrawalDetailsForUri,
codecForImportDbRequest,
codecForInitiatePeerPullPaymentRequest,
- codecForInitiatePeerPushPaymentRequest,
+ codecForInitiatePeerPushDebitRequest,
codecForIntegrationTestArgs,
codecForIntegrationTestV2Args,
codecForListKnownBankAccounts,
@@ -202,7 +202,7 @@ import {
confirmPeerPullDebit,
confirmPeerPushCredit,
initiatePeerPullPayment,
- initiatePeerPushPayment,
+ initiatePeerPushDebit,
preparePeerPullDebit,
preparePeerPushCredit,
processPeerPullCredit,
@@ -1443,8 +1443,8 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>(
return await checkPeerPushDebit(ws, req);
}
case WalletApiOperation.InitiatePeerPushDebit: {
- const req = codecForInitiatePeerPushPaymentRequest().decode(payload);
- return await initiatePeerPushPayment(ws, req);
+ const req = codecForInitiatePeerPushDebitRequest().decode(payload);
+ return await initiatePeerPushDebit(ws, req);
}
case WalletApiOperation.PreparePeerPushCredit: {
const req = codecForPreparePeerPushCreditRequest().decode(payload);
@@ -1502,23 +1502,6 @@ export function getVersion(ws: InternalWalletState): WalletCoreVersion {
return version;
}
-function translateLegacyOperationNames(operation: string): string {
- switch (operation) {
- case "initiatePeerPullPayment":
- return WalletApiOperation.InitiatePeerPullCredit.toString();
- case "initiatePeerPushPayment":
- return WalletApiOperation.InitiatePeerPushDebit.toString();
- case "checkPeerPullPayment":
- return WalletApiOperation.PreparePeerPullDebit.toString();
- case "acceptPeerPullPayment":
- return WalletApiOperation.ConfirmPeerPullDebit.toString();
- case "checkPeerPushPayment":
- return WalletApiOperation.PreparePeerPushCredit.toString();
- case "acceptPeerPushPayment":
- return WalletApiOperation.ConfirmPeerPushCredit.toString();
- }
- return operation;
-}
/**
* Handle a request to the wallet-core API.
@@ -1529,8 +1512,6 @@ export async function handleCoreApiRequest(
id: string,
payload: unknown,
): Promise<CoreApiResponse> {
- operation = translateLegacyOperationNames(operation);
-
try {
const result = await dispatchRequestInternal(ws, operation as any, payload);
return {