From 676ae5102b618e7e52ba289d453a470fe77ce9d5 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 13 Sep 2022 15:28:34 +0200 Subject: fix test and logging --- packages/taler-wallet-cli/src/index.ts | 3 +++ .../src/integrationtests/test-exchange-management.ts | 16 +++------------- .../src/integrationtests/test-payment-claim.ts | 9 +-------- 3 files changed, 7 insertions(+), 21 deletions(-) (limited to 'packages/taler-wallet-cli') diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts index 2ed371420..5fd608f77 100644 --- a/packages/taler-wallet-cli/src/index.ts +++ b/packages/taler-wallet-cli/src/index.ts @@ -226,6 +226,9 @@ async function withWallet( const wallet = await getDefaultNodeWallet({ persistentStoragePath: dbPath, httpLib: myHttpLib, + notifyHandler: (n) => { + logger.info(`wallet notification: ${j2s(n)}`); + }, }); if (checkEnvFlag("TALER_WALLET_BATCH_WITHDRAWAL")) { diff --git a/packages/taler-wallet-cli/src/integrationtests/test-exchange-management.ts b/packages/taler-wallet-cli/src/integrationtests/test-exchange-management.ts index 0193322fd..56c3cf23f 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-exchange-management.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-exchange-management.ts @@ -189,17 +189,10 @@ export async function runExchangeManagementTest( }); }); - // Updating the exchange from the base URL is technically a pending operation - // and it will be retried later. - t.assertTrue( - err1.hasErrorCode(TalerErrorCode.WALLET_PENDING_OPERATION_FAILED), - ); - // Response is malformed, since it didn't even contain a version code // in a format the wallet can understand. t.assertTrue( - err1.errorDetail.innerError.code === - TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE, + err1.errorDetail.code === TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE, ); exchangesList = await wallet.client.call( @@ -238,12 +231,9 @@ export async function runExchangeManagementTest( }); t.assertTrue( - err2.hasErrorCode(TalerErrorCode.WALLET_PENDING_OPERATION_FAILED), - ); - - t.assertTrue( - err2.errorDetail.innerError.code === + err2.hasErrorCode( TalerErrorCode.WALLET_EXCHANGE_PROTOCOL_VERSION_INCOMPATIBLE, + ), ); exchangesList = await wallet.client.call( diff --git a/packages/taler-wallet-cli/src/integrationtests/test-payment-claim.ts b/packages/taler-wallet-cli/src/integrationtests/test-payment-claim.ts index e878854f8..e93d2c44c 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-payment-claim.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-payment-claim.ts @@ -102,14 +102,7 @@ export async function runPaymentClaimTest(t: GlobalTestState) { }); }); - t.assertTrue( - err.hasErrorCode(TalerErrorCode.WALLET_PENDING_OPERATION_FAILED), - ); - - t.assertTrue( - err.errorDetail.innerError.code === - TalerErrorCode.WALLET_ORDER_ALREADY_CLAIMED, - ); + t.assertTrue(err.hasErrorCode(TalerErrorCode.WALLET_ORDER_ALREADY_CLAIMED)); await t.shutdown(); } -- cgit v1.2.3