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/deposits.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/deposits.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/deposits.ts | 41 |
1 files changed, 2 insertions, 39 deletions
diff --git a/packages/taler-wallet-core/src/operations/deposits.ts b/packages/taler-wallet-core/src/operations/deposits.ts index e45da7b4c..a5d6c93cf 100644 --- a/packages/taler-wallet-core/src/operations/deposits.ts +++ b/packages/taler-wallet-core/src/operations/deposits.ts @@ -20,6 +20,7 @@ import { buildCodecForObject, canonicalJson, Codec, + codecForDepositSuccess, codecForString, codecForTimestamp, codecOptional, @@ -32,6 +33,7 @@ import { GetFeeForDepositRequest, getRandomBytes, getTimestampNow, + hashWire, Logger, NotificationType, parsePaytoUri, @@ -57,7 +59,6 @@ import { generateDepositPermissions, getCandidatePayCoins, getTotalPaymentCost, - hashWire, } from "./pay.js"; import { getTotalRefreshCost } from "./refresh.js"; @@ -66,43 +67,6 @@ import { getTotalRefreshCost } from "./refresh.js"; */ const logger = new Logger("deposits.ts"); -interface DepositSuccess { - // Optional base URL of the exchange for looking up wire transfers - // associated with this transaction. If not given, - // the base URL is the same as the one used for this request. - // Can be used if the base URL for /transactions/ differs from that - // for /coins/, i.e. for load balancing. Clients SHOULD - // respect the transaction_base_url if provided. Any HTTP server - // belonging to an exchange MUST generate a 307 or 308 redirection - // to the correct base URL should a client uses the wrong base - // URL, or if the base URL has changed since the deposit. - transaction_base_url?: string; - - // timestamp when the deposit was received by the exchange. - exchange_timestamp: Timestamp; - - // the EdDSA signature of TALER_DepositConfirmationPS using a current - // signing key of the exchange affirming the successful - // deposit and that the exchange will transfer the funds after the refund - // deadline, or as soon as possible if the refund deadline is zero. - exchange_sig: string; - - // public EdDSA key of the exchange that was used to - // generate the signature. - // Should match one of the exchange's signing keys from /keys. It is given - // explicitly as the client might otherwise be confused by clock skew as to - // which signing key was used. - exchange_pub: string; -} - -const codecForDepositSuccess = (): Codec<DepositSuccess> => - buildCodecForObject<DepositSuccess>() - .property("exchange_pub", codecForString()) - .property("exchange_sig", codecForString()) - .property("exchange_timestamp", codecForTimestamp) - .property("transaction_base_url", codecOptional(codecForString())) - .build("DepositSuccess"); - async function resetDepositGroupRetry( ws: InternalWalletState, depositGroupId: string, @@ -202,7 +166,6 @@ async function processDepositGroupImpl( } const perm = depositPermissions[i]; let requestBody: any; - logger.info("creating v10 deposit request"); requestBody = { contribution: Amounts.stringify(perm.contribution), merchant_payto_uri: depositGroup.wire.payto_uri, |