aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/withdraw.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-02-21 12:40:51 +0100
committerFlorian Dold <florian@dold.me>2022-02-21 12:40:57 +0100
commit5c93f15157b4fc9d0fefb6bb2a9956592ebb1ec9 (patch)
treecd7e7500376f0b0ee560348e792ac4cbbb576925 /packages/taler-wallet-core/src/operations/withdraw.ts
parent606be7577be2bd249f19204d0c80b3b48e3065ca (diff)
downloadwallet-core-5c93f15157b4fc9d0fefb6bb2a9956592ebb1ec9.tar.xz
towards implementing breaking exchange protocol changes
Diffstat (limited to 'packages/taler-wallet-core/src/operations/withdraw.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/withdraw.ts29
1 files changed, 5 insertions, 24 deletions
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts
index 79220089b..731e9b3aa 100644
--- a/packages/taler-wallet-core/src/operations/withdraw.ts
+++ b/packages/taler-wallet-core/src/operations/withdraw.ts
@@ -43,6 +43,7 @@ import {
DenomKeyType,
LibtoolVersion,
UnblindedSignature,
+ ExchangeWithdrawRequest,
} from "@gnu-taler/taler-util";
import {
CoinRecord,
@@ -497,9 +498,8 @@ async function processPlanchetExchangeRequest(
`processing planchet #${coinIdx} in withdrawal ${withdrawalGroup.withdrawalGroupId}`,
);
- const reqBody: any = {
+ const reqBody: ExchangeWithdrawRequest = {
denom_pub_hash: planchet.denomPubHash,
- reserve_pub: planchet.reservePub,
reserve_sig: planchet.withdrawSig,
coin_ev: planchet.coinEv,
};
@@ -580,28 +580,12 @@ async function processPlanchetVerifyAndStoreCoin(
const { planchet, exchangeBaseUrl } = d;
const planchetDenomPub = planchet.denomPub;
- if (
- planchetDenomPub.cipher !== DenomKeyType.Rsa &&
- planchetDenomPub.cipher !== DenomKeyType.LegacyRsa
- ) {
+ if (planchetDenomPub.cipher !== DenomKeyType.Rsa) {
throw Error(`cipher (${planchetDenomPub.cipher}) not supported`);
}
let evSig = resp.ev_sig;
- if (typeof resp.ev_sig === "string") {
- evSig = {
- cipher: DenomKeyType.LegacyRsa,
- blinded_rsa_signature: resp.ev_sig,
- };
- } else {
- evSig = resp.ev_sig;
- }
- if (
- !(
- evSig.cipher === DenomKeyType.Rsa ||
- evSig.cipher === DenomKeyType.LegacyRsa
- )
- ) {
+ if (!(evSig.cipher === DenomKeyType.Rsa)) {
throw Error("unsupported cipher");
}
@@ -639,10 +623,7 @@ async function processPlanchetVerifyAndStoreCoin(
}
let denomSig: UnblindedSignature;
- if (
- planchet.denomPub.cipher === DenomKeyType.LegacyRsa ||
- planchet.denomPub.cipher === DenomKeyType.Rsa
- ) {
+ if (planchet.denomPub.cipher === DenomKeyType.Rsa) {
denomSig = {
cipher: planchet.denomPub.cipher,
rsa_signature: denomSigRsa,