diff options
author | Florian Dold <florian@dold.me> | 2022-03-14 18:31:30 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-03-14 18:31:36 +0100 |
commit | 332745862e728dc5e79a424698b2736c4f2683bf (patch) | |
tree | 6617d10c145868741f751853261c9c126b6f580e /packages/taler-wallet-core/src/operations/refresh.ts | |
parent | 9e7ee06ad1870339d011a0be27867cc36f94490d (diff) | |
download | wallet-core-332745862e728dc5e79a424698b2736c4f2683bf.tar.xz |
wallet: towards db-less benchmarking, some refactoring
Diffstat (limited to 'packages/taler-wallet-core/src/operations/refresh.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/refresh.ts | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/packages/taler-wallet-core/src/operations/refresh.ts b/packages/taler-wallet-core/src/operations/refresh.ts index 550119de1..cc2a1c566 100644 --- a/packages/taler-wallet-core/src/operations/refresh.ts +++ b/packages/taler-wallet-core/src/operations/refresh.ts @@ -17,6 +17,7 @@ import { DenomKeyType, encodeCrock, + ExchangeMeltRequest, ExchangeProtocolVersion, ExchangeRefreshRevealRequest, getRandomBytes, @@ -394,17 +395,14 @@ async function refreshMelt( `coins/${oldCoin.coinPub}/melt`, oldCoin.exchangeBaseUrl, ); - let meltReqBody: any; - if (oldDenom.denomPub.cipher === DenomKeyType.Rsa) { - meltReqBody = { - coin_pub: oldCoin.coinPub, - confirm_sig: derived.confirmSig, - denom_pub_hash: oldCoin.denomPubHash, - denom_sig: oldCoin.denomSig, - rc: derived.hash, - value_with_fee: Amounts.stringify(derived.meltValueWithFee), - }; - } + const meltReqBody: ExchangeMeltRequest = { + coin_pub: oldCoin.coinPub, + confirm_sig: derived.confirmSig, + denom_pub_hash: oldCoin.denomPubHash, + denom_sig: oldCoin.denomSig, + rc: derived.hash, + value_with_fee: Amounts.stringify(derived.meltValueWithFee), + }; const resp = await ws.runSequentialized([EXCHANGE_COINS_LOCK], async () => { return await ws.http.postJson(reqUrl.href, meltReqBody, { |