[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: make tipping work with latest
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: make tipping work with latest merchant protocol |
Date: |
Mon, 24 Jan 2022 20:51:55 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new 171d070a make tipping work with latest merchant protocol
171d070a is described below
commit 171d070a83c93082026c9e757f7520139ec655c9
Author: Florian Dold <florian@dold.me>
AuthorDate: Mon Jan 24 20:51:44 2022 +0100
make tipping work with latest merchant protocol
---
packages/taler-util/src/talerTypes.ts | 11 +++++++++++
packages/taler-wallet-core/src/operations/tip.ts | 11 ++++++++---
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/packages/taler-util/src/talerTypes.ts
b/packages/taler-util/src/talerTypes.ts
index 41aa53fd..2f2576d8 100644
--- a/packages/taler-util/src/talerTypes.ts
+++ b/packages/taler-util/src/talerTypes.ts
@@ -1654,3 +1654,14 @@ export enum ExchangeProtocolVersion {
V9 = 9,
V12 = 12,
}
+
+export enum MerchantProtocolVersion {
+ /**
+ * Legacy version that is still supported.
+ */
+ V1 = 1,
+ /**
+ * Current version supported by the wallet.
+ */
+ V3 = 3,
+}
diff --git a/packages/taler-wallet-core/src/operations/tip.ts
b/packages/taler-wallet-core/src/operations/tip.ts
index cf3502ec..f985d8aa 100644
--- a/packages/taler-wallet-core/src/operations/tip.ts
+++ b/packages/taler-wallet-core/src/operations/tip.ts
@@ -33,6 +33,7 @@ import {
DenomKeyType,
BlindedDenominationSignature,
codecForMerchantTipResponseV2,
+ MerchantProtocolVersion,
} from "@gnu-taler/taler-util";
import { DerivedTipPlanchet } from "../crypto/cryptoTypes.js";
import {
@@ -314,13 +315,15 @@ async function processTipImpl(
let blindedSigs: BlindedDenominationSignature[] = [];
- if (merchantInfo.protocolVersionCurrent === 2) {
+ if (merchantInfo.protocolVersionCurrent === MerchantProtocolVersion.V3) {
const response = await readSuccessResponseJsonOrThrow(
merchantResp,
codecForMerchantTipResponseV2(),
);
blindedSigs = response.blind_sigs.map((x) => x.blind_sig);
- } else if (merchantInfo.protocolVersionCurrent === 1) {
+ } else if (
+ merchantInfo.protocolVersionCurrent === MerchantProtocolVersion.V1
+ ) {
const response = await readSuccessResponseJsonOrThrow(
merchantResp,
codecForMerchantTipResponseV1(),
@@ -330,7 +333,9 @@ async function processTipImpl(
blinded_rsa_signature: x.blind_sig,
}));
} else {
- throw Error("unsupported merchant protocol version");
+ throw Error(
+ `unsupported merchant protocol version
(${merchantInfo.protocolVersionCurrent})`,
+ );
}
if (blindedSigs.length !== planchets.length) {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: make tipping work with latest merchant protocol,
gnunet <=