diff options
author | Florian Dold <florian@dold.me> | 2021-06-17 13:34:59 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-06-17 13:35:08 +0200 |
commit | 5df7ddba97aa4482c781bfe8e87f60c3bc195ae4 (patch) | |
tree | 0956d310a83f0fafbb7d5a93001566f9035269a0 /packages/taler-wallet-cli/src/integrationtests/helpers.ts | |
parent | 0b4976601fe2ecb0462fe72ae188b5cbba06d9cc (diff) |
use the new wallet core API interface in all tests
Diffstat (limited to 'packages/taler-wallet-cli/src/integrationtests/helpers.ts')
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/helpers.ts | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/helpers.ts b/packages/taler-wallet-cli/src/integrationtests/helpers.ts index ab8939eeb..aa9164c19 100644 --- a/packages/taler-wallet-cli/src/integrationtests/helpers.ts +++ b/packages/taler-wallet-cli/src/integrationtests/helpers.ts @@ -50,6 +50,7 @@ import { MerchantPrivateApi, HarnessExchangeBankAccount, } from "./harness.js"; +import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; export interface SimpleTestEnvironment { commonDb: DbInfo; @@ -265,10 +266,9 @@ export async function startWithdrawViaBank( // Hand it to the wallet - const r1 = await wallet.apiRequest("getWithdrawalDetailsForUri", { + await wallet.client.call(WalletApiOperation.GetWithdrawalDetailsForUri, { talerWithdrawUri: wop.taler_withdraw_uri, }); - t.assertTrue(r1.type === "response"); await wallet.runPending(); @@ -278,11 +278,10 @@ export async function startWithdrawViaBank( // Withdraw - const r2 = await wallet.apiRequest("acceptBankIntegratedWithdrawal", { + await wallet.client.call(WalletApiOperation.AcceptBankIntegratedWithdrawal, { exchangeBaseUrl: exchange.baseUrl, talerWithdrawUri: wop.taler_withdraw_uri, }); - t.assertTrue(r2.type === "response"); } /** @@ -305,8 +304,7 @@ export async function withdrawViaBank( // Check balance - const balApiResp = await wallet.apiRequest("getBalances", {}); - t.assertTrue(balApiResp.type === "response"); + await wallet.client.call(WalletApiOperation.GetBalances, {}); } export async function applyTimeTravel( @@ -365,15 +363,18 @@ export async function makeTestPayment( // Make wallet pay for the order - const preparePayResult = await wallet.preparePay({ - talerPayUri: orderStatus.taler_pay_uri, - }); + const preparePayResult = await wallet.client.call( + WalletApiOperation.PreparePayForUri, + { + talerPayUri: orderStatus.taler_pay_uri, + }, + ); t.assertTrue( preparePayResult.status === PreparePayResultType.PaymentPossible, ); - const r2 = await wallet.confirmPay({ + const r2 = await wallet.client.call(WalletApiOperation.ConfirmPay, { proposalId: preparePayResult.proposalId, }); |