gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: check error code


From: gnunet
Subject: [taler-wallet-core] branch master updated: check error code
Date: Wed, 12 Aug 2020 16:22:56 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new 44dcfb37 check error code
44dcfb37 is described below

commit 44dcfb379005097e6337754f8bf8ff267e5c8deb
Author: Florian Dold <florian.dold@gmail.com>
AuthorDate: Wed Aug 12 19:52:51 2020 +0530

    check error code
---
 .../src/test-exchange-management.ts                     | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/packages/taler-integrationtests/src/test-exchange-management.ts 
b/packages/taler-integrationtests/src/test-exchange-management.ts
index 990a6fa4..9199c183 100644
--- a/packages/taler-integrationtests/src/test-exchange-management.ts
+++ b/packages/taler-integrationtests/src/test-exchange-management.ts
@@ -32,6 +32,7 @@ import {
   PreparePayResultType,
   ExchangesListRespose,
   URL,
+  TalerErrorCode,
 } from "taler-wallet-core";
 import {
   FaultInjectedExchangeService,
@@ -165,12 +166,19 @@ runTest(async (t: GlobalTestState) => {
     },
   });
 
-  await t.assertThrowsOperationErrorAsync(async () => {
+  const err1 = await t.assertThrowsOperationErrorAsync(async () => {
     await wallet.addExchange({
       exchangeBaseUrl: faultyExchange.baseUrl,
     });
   });
 
+  // Response is malformed, since it didn't even contain a version code
+  // in a format the wallet can understand.
+  t.assertTrue(
+    err1.operationError.talerErrorCode ===
+      TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE,
+  );
+
   exchangesList = await wallet.listExchanges();
   t.assertTrue(exchangesList.exchanges.length === 0);
 
@@ -197,12 +205,17 @@ runTest(async (t: GlobalTestState) => {
     },
   });
 
-  await t.assertThrowsOperationErrorAsync(async () => {
+  const err2 = await t.assertThrowsOperationErrorAsync(async () => {
     await wallet.addExchange({
       exchangeBaseUrl: faultyExchange.baseUrl,
     });
   });
 
+  t.assertTrue(
+    err2.operationError.talerErrorCode ===
+      TalerErrorCode.WALLET_EXCHANGE_PROTOCOL_VERSION_INCOMPATIBLE,
+  );
+
   exchangesList = await wallet.listExchanges();
   t.assertTrue(exchangesList.exchanges.length === 0);
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]