aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-06-11 15:39:34 +0200
committerFlorian Dold <florian@dold.me>2024-06-11 15:39:34 +0200
commit81b4a53a42c23e6f8e6b7e193a173b2c9cc35e83 (patch)
treeffdba74b4defb7021592fc4d7911af59af9bad44 /packages
parent2a590ca82f3b63edcaeeba054961e6947df7a651 (diff)
downloadwallet-core-81b4a53a42c23e6f8e6b7e193a173b2c9cc35e83.tar.xz
wallet-core: fix bank integration API protocol range
Diffstat (limited to 'packages')
-rw-r--r--packages/taler-util/src/http-client/bank-integration.ts4
-rw-r--r--packages/taler-wallet-core/src/versions.ts7
-rw-r--r--packages/taler-wallet-core/src/wallet.ts21
-rw-r--r--packages/taler-wallet-core/src/withdraw.ts5
4 files changed, 19 insertions, 18 deletions
diff --git a/packages/taler-util/src/http-client/bank-integration.ts b/packages/taler-util/src/http-client/bank-integration.ts
index e07b6c5fa..23740328b 100644
--- a/packages/taler-util/src/http-client/bank-integration.ts
+++ b/packages/taler-util/src/http-client/bank-integration.ts
@@ -50,7 +50,9 @@ export type TalerBankIntegrationErrorsByMethod<
* The API is used by the wallets.
*/
export class TalerBankIntegrationHttpClient {
- public readonly PROTOCOL_VERSION = "2:0:0";
+ public static readonly PROTOCOL_VERSION = "2:0:1";
+ public readonly PROTOCOL_VERSION =
+ TalerBankIntegrationHttpClient.PROTOCOL_VERSION;
httpLib: HttpRequestLibrary;
diff --git a/packages/taler-wallet-core/src/versions.ts b/packages/taler-wallet-core/src/versions.ts
index 8c1ac5fc2..8b4b24351 100644
--- a/packages/taler-wallet-core/src/versions.ts
+++ b/packages/taler-wallet-core/src/versions.ts
@@ -29,13 +29,6 @@ export const WALLET_EXCHANGE_PROTOCOL_VERSION = "17:0:0";
export const WALLET_MERCHANT_PROTOCOL_VERSION = "5:0:1";
/**
- * Protocol version spoken with the bank (bank integration API).
- *
- * Uses libtool's current:revision:age versioning.
- */
-export const WALLET_BANK_INTEGRATION_PROTOCOL_VERSION = "1:0:0";
-
-/**
* Protocol version spoken with the bank (corebank API).
*
* Uses libtool's current:revision:age versioning.
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
index f1d53b7d5..7a69fcb21 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -56,6 +56,7 @@ import {
PrepareWithdrawExchangeResponse,
RecoverStoredBackupRequest,
StoredBackupList,
+ TalerBankIntegrationHttpClient,
TalerError,
TalerErrorCode,
TalerProtocolTimestamp,
@@ -295,7 +296,6 @@ import {
} from "./transactions.js";
import {
WALLET_BANK_CONVERSION_API_PROTOCOL_VERSION,
- WALLET_BANK_INTEGRATION_PROTOCOL_VERSION,
WALLET_COREBANK_API_PROTOCOL_VERSION,
WALLET_CORE_API_PROTOCOL_VERSION,
WALLET_EXCHANGE_PROTOCOL_VERSION,
@@ -479,7 +479,10 @@ async function setCoinSuspended(
c.denomPubHash,
c.maxAge,
]);
- checkDbInvariant(!!coinAvailability, `no denom info for ${c.denomPubHash} age ${c.maxAge}`);
+ checkDbInvariant(
+ !!coinAvailability,
+ `no denom info for ${c.denomPubHash} age ${c.maxAge}`,
+ );
if (suspended) {
if (c.status !== CoinStatus.Fresh) {
return;
@@ -1396,7 +1399,10 @@ async function dispatchRequestInternal(
return;
}
wex.ws.exchangeCache.clear();
- checkDbInvariant(!!existingRec.id, `no global exchange for ${j2s(key)}`);
+ checkDbInvariant(
+ !!existingRec.id,
+ `no global exchange for ${j2s(key)}`,
+ );
await tx.globalCurrencyExchanges.delete(existingRec.id);
},
);
@@ -1445,7 +1451,10 @@ async function dispatchRequestInternal(
if (!existingRec) {
return;
}
- checkDbInvariant(!!existingRec.id, `no global currency for ${j2s(key)}`);
+ checkDbInvariant(
+ !!existingRec.id,
+ `no global currency for ${j2s(key)}`,
+ );
await tx.globalCurrencyAuditors.delete(existingRec.id);
wex.ws.exchangeCache.clear();
},
@@ -1580,9 +1589,9 @@ export function getVersion(wex: WalletExecutionContext): WalletCoreVersion {
exchange: WALLET_EXCHANGE_PROTOCOL_VERSION,
merchant: WALLET_MERCHANT_PROTOCOL_VERSION,
bankConversionApiRange: WALLET_BANK_CONVERSION_API_PROTOCOL_VERSION,
- bankIntegrationApiRange: WALLET_BANK_INTEGRATION_PROTOCOL_VERSION,
+ bankIntegrationApiRange: TalerBankIntegrationHttpClient.PROTOCOL_VERSION,
corebankApiRange: WALLET_COREBANK_API_PROTOCOL_VERSION,
- bank: WALLET_BANK_INTEGRATION_PROTOCOL_VERSION,
+ bank: TalerBankIntegrationHttpClient.PROTOCOL_VERSION,
devMode: wex.ws.config.testing.devModeActive,
};
return result;
diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts
index 0434aefc2..e90aa1dd3 100644
--- a/packages/taler-wallet-core/src/withdraw.ts
+++ b/packages/taler-wallet-core/src/withdraw.ts
@@ -162,10 +162,7 @@ import {
notifyTransition,
parseTransactionIdentifier,
} from "./transactions.js";
-import {
- WALLET_BANK_INTEGRATION_PROTOCOL_VERSION,
- WALLET_EXCHANGE_PROTOCOL_VERSION,
-} from "./versions.js";
+import { WALLET_EXCHANGE_PROTOCOL_VERSION } from "./versions.js";
import { WalletExecutionContext, getDenomInfo } from "./wallet.js";
/**