summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-01-24 20:51:44 +0100
committerFlorian Dold <florian@dold.me>2022-01-24 20:51:47 +0100
commit171d070a83c93082026c9e757f7520139ec655c9 (patch)
tree0f3d83caf250780b01a2fdec7c2c2ec64665231d /packages/taler-wallet-core/src/operations
parentee492b255267b6cb2ceaa4aee065a5d690177ef5 (diff)
downloadwallet-core-171d070a83c93082026c9e757f7520139ec655c9.tar.gz
wallet-core-171d070a83c93082026c9e757f7520139ec655c9.tar.bz2
wallet-core-171d070a83c93082026c9e757f7520139ec655c9.zip
make tipping work with latest merchant protocol
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r--packages/taler-wallet-core/src/operations/tip.ts11
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/operations/tip.ts b/packages/taler-wallet-core/src/operations/tip.ts
index cf3502ecd..f985d8aad 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) {