diff options
author | Florian Dold <florian@dold.me> | 2021-11-23 23:51:12 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-11-23 23:51:12 +0100 |
commit | ae8af3f27c0ed1746c49a7608fe05af24ae8a18b (patch) | |
tree | c28f588071bdd1d4cda2279e62563a3664d79be9 /packages/taler-wallet-core/src/operations/exchanges.ts | |
parent | 829a59e1a24d6a99ce7554d28acfd05f21baeaf8 (diff) | |
download | wallet-core-ae8af3f27c0ed1746c49a7608fe05af24ae8a18b.tar.gz wallet-core-ae8af3f27c0ed1746c49a7608fe05af24ae8a18b.tar.bz2 wallet-core-ae8af3f27c0ed1746c49a7608fe05af24ae8a18b.zip |
wallet: tipping protocol change / merchant version info
Diffstat (limited to 'packages/taler-wallet-core/src/operations/exchanges.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/exchanges.ts | 8 |
1 files changed, 6 insertions, 2 deletions
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); |