diff options
author | Florian Dold <florian@dold.me> | 2023-10-16 13:19:10 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-10-16 13:19:10 +0200 |
commit | 925a97c2e3a52222cb28b2b64d80c0b01305defe (patch) | |
tree | b0d6ec9e63f4020be59ca2c286166efecfa08ac1 /packages/taler-wallet-core/src/dbless.ts | |
parent | 9504687813d3ee47131f5b7f66c1426f9ccffd41 (diff) | |
download | wallet-core-925a97c2e3a52222cb28b2b64d80c0b01305defe.tar.xz |
-fix tests
Diffstat (limited to 'packages/taler-wallet-core/src/dbless.ts')
-rw-r--r-- | packages/taler-wallet-core/src/dbless.ts | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/packages/taler-wallet-core/src/dbless.ts b/packages/taler-wallet-core/src/dbless.ts index 4fc890788..b6b80009f 100644 --- a/packages/taler-wallet-core/src/dbless.ts +++ b/packages/taler-wallet-core/src/dbless.ts @@ -49,6 +49,9 @@ import { Logger, parsePaytoUri, UnblindedSignature, + ExchangeBatchWithdrawRequest, + ExchangeWithdrawBatchResponse, + codecForExchangeWithdrawBatchResponse, } from "@gnu-taler/taler-util"; import { HttpRequestLibrary, @@ -165,25 +168,29 @@ export async function withdrawCoin(args: { value: Amounts.parseOrThrow(denom.value), }); - const reqBody: ExchangeWithdrawRequest = { - denom_pub_hash: planchet.denomPubHash, - reserve_sig: planchet.withdrawSig, - coin_ev: planchet.coinEv, + const reqBody: ExchangeBatchWithdrawRequest = { + planchets: [ + { + denom_pub_hash: planchet.denomPubHash, + reserve_sig: planchet.withdrawSig, + coin_ev: planchet.coinEv, + }, + ], }; const reqUrl = new URL( - `reserves/${planchet.reservePub}/withdraw`, + `reserves/${planchet.reservePub}/batch-withdraw`, exchangeBaseUrl, ).href; - const resp = await http.postJson(reqUrl, reqBody); - const r = await readSuccessResponseJsonOrThrow( + const resp = await http.fetch(reqUrl, { method: "POST", body: reqBody }); + const rBatch = await readSuccessResponseJsonOrThrow( resp, - codecForWithdrawResponse(), + codecForExchangeWithdrawBatchResponse(), ); const ubSig = await cryptoApi.unblindDenominationSignature({ planchet, - evSig: r.ev_sig, + evSig: rBatch.ev_sigs[0].ev_sig, }); return { |