diff options
author | Florian Dold <florian@dold.me> | 2021-03-02 21:47:57 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-03-02 21:47:57 +0100 |
commit | 90a77de2f4b89bfa545f7cb7f81be6b8f6164f72 (patch) | |
tree | 1695f4a2af502ef419487929cd244ff82ce9a8b1 /packages/taler-wallet-cli/src/integrationtests/harness.ts | |
parent | 9c2440718d566bf28a61c732849a3aa5d3ad82bb (diff) | |
download | wallet-core-90a77de2f4b89bfa545f7cb7f81be6b8f6164f72.tar.xz |
add test
Diffstat (limited to 'packages/taler-wallet-cli/src/integrationtests/harness.ts')
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/harness.ts | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/harness.ts b/packages/taler-wallet-cli/src/integrationtests/harness.ts index cb8b59a5c..118bc35d4 100644 --- a/packages/taler-wallet-cli/src/integrationtests/harness.ts +++ b/packages/taler-wallet-cli/src/integrationtests/harness.ts @@ -1186,6 +1186,14 @@ export class MerchantApiClient { }); } + async createInstance(req: MerchantInstanceConfig): Promise<void> { + const baseUrl = this.baseUrl; + const url = new URL("private/instances", baseUrl); + await axios.post(url.href, req, { + headers: this.makeAuthHeader(), + }); + } + async getInstances(): Promise<MerchantInstancesResponse> { const url = new URL("private/instances", this.baseUrl); const resp = await axios.get(url.href, { @@ -1214,6 +1222,9 @@ export class MerchantApiClient { } } +/** + * FIXME: This should be deprecated in favor of MerchantApiClient + */ export namespace MerchantPrivateApi { export async function createOrder( merchantService: MerchantServiceInterface, @@ -1444,7 +1455,7 @@ export class MerchantService implements MerchantServiceInterface { config.write(this.configFilename); } - async addInstance(instanceConfig: MerchantInstanceConfig): Promise<void> { + async addInstance(instanceConfig: PartialMerchantInstanceConfig): Promise<void> { if (!this.proc) { throw Error("merchant must be running to add instance"); } @@ -1492,7 +1503,7 @@ export interface MerchantAuthConfiguration { token?: string; } -export interface MerchantInstanceConfig { +export interface PartialMerchantInstanceConfig { auth?: MerchantAuthConfiguration; id: string; name: string; @@ -1506,6 +1517,20 @@ export interface MerchantInstanceConfig { defaultPayDelay?: Duration; } +export interface MerchantInstanceConfig { + auth: MerchantAuthConfiguration; + id: string; + name: string; + payto_uris: string[]; + address: unknown; + jurisdiction: unknown; + default_max_wire_fee: string; + default_max_deposit_fee: string; + default_wire_fee_amortization: number; + default_wire_transfer_delay: Duration; + default_pay_delay: Duration; +} + type TestStatus = "pass" | "fail" | "skip"; export interface TestRunResult { |