From ae8af3f27c0ed1746c49a7608fe05af24ae8a18b Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 23 Nov 2021 23:51:12 +0100 Subject: wallet: tipping protocol change / merchant version info --- packages/taler-wallet-core/src/operations/exchanges.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/exchanges.ts') diff --git a/packages/taler-wallet-core/src/operations/exchanges.ts b/packages/taler-wallet-core/src/operations/exchanges.ts index c170c5469..638af813a 100644 --- a/packages/taler-wallet-core/src/operations/exchanges.ts +++ b/packages/taler-wallet-core/src/operations/exchanges.ts @@ -23,7 +23,6 @@ import { canonicalizeBaseUrl, codecForExchangeKeysJson, codecForExchangeWireJson, - compare, Denomination, Duration, durationFromSpec, @@ -40,6 +39,7 @@ import { TalerErrorDetails, Timestamp, hashDenomPub, + LibtoolVersion, } from "@gnu-taler/taler-util"; import { decodeCrock, encodeCrock, hash } from "@gnu-taler/taler-util"; import { CryptoApi } from "../crypto/workers/cryptoApi.js"; @@ -365,7 +365,10 @@ async function downloadKeysInfo( const protocolVersion = exchangeKeysJson.version; - const versionRes = compare(WALLET_EXCHANGE_PROTOCOL_VERSION, protocolVersion); + const versionRes = LibtoolVersion.compare( + WALLET_EXCHANGE_PROTOCOL_VERSION, + protocolVersion, + ); if (versionRes?.compatible != true) { const opErr = makeErrorDetails( TalerErrorCode.WALLET_EXCHANGE_PROTOCOL_VERSION_INCOMPATIBLE, @@ -548,6 +551,7 @@ async function updateExchangeFromUrlImpl( masterPublicKey: details.masterPublicKey, // FIXME: only change if pointer really changed updateClock: getTimestampNow(), + protocolVersionRange: keysInfo.protocolVersion, }; await tx.exchanges.put(r); await tx.exchangeDetails.put(details); -- cgit v1.2.3