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/test-libeufin-basic.ts | |
parent | 0b4976601fe2ecb0462fe72ae188b5cbba06d9cc (diff) | |
download | wallet-core-5df7ddba97aa4482c781bfe8e87f60c3bc195ae4.tar.xz |
use the new wallet core API interface in all tests
Diffstat (limited to 'packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts')
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts index 03d9fa357..34525844f 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts @@ -18,6 +18,7 @@ * Imports. */ import { CoreApiResponse } from "@gnu-taler/taler-util"; +import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { CoinConfig, defaultCoinConfig } from "./denomStructures"; import { DbInfo, @@ -237,24 +238,19 @@ export async function runLibeufinBasicTest(t: GlobalTestState) { libeufinNexus, } = await createLibeufinTestEnvironment(t); - let wresp: CoreApiResponse; - - // FIXME: add nicer api in the harness wallet for this. - wresp = await wallet.apiRequest("addExchange", { - exchangeBaseUrl: exchange.baseUrl, - }); - - t.assertTrue(wresp.type === "response"); - - // FIXME: add nicer api in the harness wallet for this. - wresp = await wallet.apiRequest("acceptManualWithdrawal", { + await wallet.client.call(WalletApiOperation.AddExchange, { exchangeBaseUrl: exchange.baseUrl, - amount: "EUR:10", }); - t.assertTrue(wresp.type === "response"); + const wr = await wallet.client.call( + WalletApiOperation.AcceptManualWithdrawal, + { + exchangeBaseUrl: exchange.baseUrl, + amount: "EUR:10", + }, + ); - const reservePub: string = (wresp.result as any).reservePub; + const reservePub: string = wr.reservePub; await LibeufinSandboxApi.simulateIncomingTransaction( libeufinSandbox, @@ -275,7 +271,7 @@ export async function runLibeufinBasicTest(t: GlobalTestState) { await wallet.runUntilDone(); - const bal = await wallet.getBalances(); + const bal = await wallet.client.call(WalletApiOperation.GetBalances, {}); console.log("balances", JSON.stringify(bal, undefined, 2)); t.assertAmountEquals(bal.balances[0].available, "EUR:14.7"); |