taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 81b4a53a42c23e6f8e6b7e193a173b2c9cc35e83
parent 2a590ca82f3b63edcaeeba054961e6947df7a651
Author: Florian Dold <florian@dold.me>
Date:   Tue, 11 Jun 2024 15:39:34 +0200

wallet-core: fix bank integration API protocol range

Diffstat:
Mpackages/taler-util/src/http-client/bank-integration.ts | 4+++-
Mpackages/taler-wallet-core/src/versions.ts | 7-------
Mpackages/taler-wallet-core/src/wallet.ts | 21+++++++++++++++------
Mpackages/taler-wallet-core/src/withdraw.ts | 5+----
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 @@ -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 @@ -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 @@ -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 @@ -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"; /**