diff options
author | Florian Dold <florian@dold.me> | 2022-10-05 12:52:49 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-10-05 12:52:49 +0200 |
commit | dd14e67c70cd7b5b6891295759cb08aa2f94f180 (patch) | |
tree | 296b07938b676d21ba9f75196cae621e292fc714 /packages/taler-util | |
parent | 4d232fd56510ae69b76fef4f4ecade1e0d4b230d (diff) | |
download | wallet-core-dd14e67c70cd7b5b6891295759cb08aa2f94f180.tar.xz |
wallet-core: improve crypto worker code duplication
Also add new testCrypto call for later testing
Diffstat (limited to 'packages/taler-util')
-rw-r--r-- | packages/taler-util/src/taler-error-codes.ts | 64 |
1 files changed, 48 insertions, 16 deletions
diff --git a/packages/taler-util/src/taler-error-codes.ts b/packages/taler-util/src/taler-error-codes.ts index a66ae8dbe..ee6a7a166 100644 --- a/packages/taler-util/src/taler-error-codes.ts +++ b/packages/taler-util/src/taler-error-codes.ts @@ -153,6 +153,14 @@ export enum TalerErrorCode { /** + * The reserve public key given as part of a /reserves/ endpoint was malformed. + * Returned with an HTTP status code of #MHD_HTTP_BAD_REQUEST (400). + * (A value of 0 indicates that the error is generated client-side). + */ + GENERIC_RESERVE_PUB_MALFORMED = 27, + + + /** * The currencies involved in the operation do not match. * Returned with an HTTP status code of #MHD_HTTP_BAD_REQUEST (400). * (A value of 0 indicates that the error is generated client-side). @@ -457,14 +465,6 @@ export enum TalerErrorCode { /** - * The reserve public key was malformed. - * Returned with an HTTP status code of #MHD_HTTP_BAD_REQUEST (400). - * (A value of 0 indicates that the error is generated client-side). - */ - EXCHANGE_GENERIC_RESERVE_PUB_MALFORMED = 1019, - - - /** * The time at the server is too far off from the time specified in the request. Most likely the client system time is wrong. * Returned with an HTTP status code of #MHD_HTTP_BAD_REQUEST (400). * (A value of 0 indicates that the error is generated client-side). @@ -1289,6 +1289,38 @@ export enum TalerErrorCode { /** + * The signature by the reserve affirming the open operation is invalid. + * Returned with an HTTP status code of #MHD_HTTP_FORBIDDEN (403). + * (A value of 0 indicates that the error is generated client-side). + */ + EXCHANGE_RESERVES_OPEN_BAD_SIGNATURE = 1785, + + + /** + * The signature by the reserve affirming the close operation is invalid. + * Returned with an HTTP status code of #MHD_HTTP_FORBIDDEN (403). + * (A value of 0 indicates that the error is generated client-side). + */ + EXCHANGE_RESERVES_CLOSE_BAD_SIGNATURE = 1786, + + + /** + * The signature by the reserve affirming the attestion request is invalid. + * Returned with an HTTP status code of #MHD_HTTP_FORBIDDEN (403). + * (A value of 0 indicates that the error is generated client-side). + */ + EXCHANGE_RESERVES_ATTEST_BAD_SIGNATURE = 1787, + + + /** + * The exchange does not know an origin account to which the remaining reserve balance could be wired to, and the wallet failed to provide one. + * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). + * (A value of 0 indicates that the error is generated client-side). + */ + EXCHANGE_RESERVES_CLOSE_NO_TARGET_ACCOUNT = 1788, + + + /** * The auditor that was supposed to be disabled is unknown to this exchange. * Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404). * (A value of 0 indicates that the error is generated client-side). @@ -1769,14 +1801,6 @@ export enum TalerErrorCode { /** - * The reserve key of given to a /reserves/ handler was malformed. - * Returned with an HTTP status code of #MHD_HTTP_BAD_REQUEST (400). - * (A value of 0 indicates that the error is generated client-side). - */ - MERCHANT_GENERIC_RESERVE_PUB_MALFORMED = 2002, - - - /** * The proposal is not known to the backend. * Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404). * (A value of 0 indicates that the error is generated client-side). @@ -3065,6 +3089,14 @@ export enum TalerErrorCode { /** + * The crypto worker received a bad request. + * Returned with an HTTP status code of #MHD_HTTP_UNINITIALIZED (0). + * (A value of 0 indicates that the error is generated client-side). + */ + WALLET_CRYPTO_WORKER_BAD_REQUEST = 7024, + + + /** * We encountered a timeout with our payment backend. * Returned with an HTTP status code of #MHD_HTTP_GATEWAY_TIMEOUT (504). * (A value of 0 indicates that the error is generated client-side). |