diff options
author | Florian Dold <florian@dold.me> | 2022-02-21 12:40:51 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-02-21 12:40:57 +0100 |
commit | 5c93f15157b4fc9d0fefb6bb2a9956592ebb1ec9 (patch) | |
tree | cd7e7500376f0b0ee560348e792ac4cbbb576925 /packages/taler-wallet-core/src/operations/tip.ts | |
parent | 606be7577be2bd249f19204d0c80b3b48e3065ca (diff) | |
download | wallet-core-5c93f15157b4fc9d0fefb6bb2a9956592ebb1ec9.tar.xz |
towards implementing breaking exchange protocol changes
Diffstat (limited to 'packages/taler-wallet-core/src/operations/tip.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/tip.ts | 44 |
1 files changed, 7 insertions, 37 deletions
diff --git a/packages/taler-wallet-core/src/operations/tip.ts b/packages/taler-wallet-core/src/operations/tip.ts index f985d8aad..039fb64a1 100644 --- a/packages/taler-wallet-core/src/operations/tip.ts +++ b/packages/taler-wallet-core/src/operations/tip.ts @@ -306,37 +306,13 @@ async function processTipImpl( // FIXME: Maybe we want to signal to the caller that the transient error happened? return; } - - // FIXME: Do this earlier? - const merchantInfo = await ws.merchantOps.getMerchantInfo( - ws, - tipRecord.merchantBaseUrl, - ); - let blindedSigs: BlindedDenominationSignature[] = []; - if (merchantInfo.protocolVersionCurrent === MerchantProtocolVersion.V3) { - const response = await readSuccessResponseJsonOrThrow( - merchantResp, - codecForMerchantTipResponseV2(), - ); - blindedSigs = response.blind_sigs.map((x) => x.blind_sig); - } else if ( - merchantInfo.protocolVersionCurrent === MerchantProtocolVersion.V1 - ) { - const response = await readSuccessResponseJsonOrThrow( - merchantResp, - codecForMerchantTipResponseV1(), - ); - blindedSigs = response.blind_sigs.map((x) => ({ - cipher: DenomKeyType.Rsa, - blinded_rsa_signature: x.blind_sig, - })); - } else { - throw Error( - `unsupported merchant protocol version (${merchantInfo.protocolVersionCurrent})`, - ); - } + const response = await readSuccessResponseJsonOrThrow( + merchantResp, + codecForMerchantTipResponseV2(), + ); + blindedSigs = response.blind_sigs.map((x) => x.blind_sig); if (blindedSigs.length !== planchets.length) { throw Error("number of tip responses does not match requested planchets"); @@ -352,17 +328,11 @@ async function processTipImpl( const planchet = planchets[i]; checkLogicInvariant(!!planchet); - if ( - denom.denomPub.cipher !== DenomKeyType.Rsa && - denom.denomPub.cipher !== DenomKeyType.LegacyRsa - ) { + if (denom.denomPub.cipher !== DenomKeyType.Rsa) { throw Error("unsupported cipher"); } - if ( - blindedSig.cipher !== DenomKeyType.Rsa && - blindedSig.cipher !== DenomKeyType.LegacyRsa - ) { + if (blindedSig.cipher !== DenomKeyType.Rsa) { throw Error("unsupported cipher"); } |