prettified sources

This commit is contained in:
MS 2021-02-03 14:35:29 +01:00
parent a3b84dca53
commit a98a7cd051
No known key found for this signature in database
GPG Key ID: 8D526861953F4C0F
10 changed files with 49 additions and 31 deletions

View File

@ -45,7 +45,10 @@ import { getTestInfo, runTests } from "./integrationtests/testrunner";
// This module also serves as the entry point for the crypto // This module also serves as the entry point for the crypto
// thread worker, and thus must expose these two handlers. // thread worker, and thus must expose these two handlers.
export { handleWorkerError, handleWorkerMessage } from "@gnu-taler/taler-wallet-core"; export {
handleWorkerError,
handleWorkerMessage,
} from "@gnu-taler/taler-wallet-core";
const logger = new Logger("taler-wallet-cli.ts"); const logger = new Logger("taler-wallet-cli.ts");

View File

@ -78,9 +78,7 @@ export const codecForPostOrderResponse = (): Codec<PostOrderResponse> =>
.property("token", codecOptional(codecForString())) .property("token", codecOptional(codecForString()))
.build("PostOrderResponse"); .build("PostOrderResponse");
export const codecForCheckPaymentPaidResponse = (): Codec< export const codecForCheckPaymentPaidResponse = (): Codec<CheckPaymentPaidResponse> =>
CheckPaymentPaidResponse
> =>
buildCodecForObject<CheckPaymentPaidResponse>() buildCodecForObject<CheckPaymentPaidResponse>()
.property("order_status_url", codecForString()) .property("order_status_url", codecForString())
.property("order_status", codecForConstString("paid")) .property("order_status", codecForConstString("paid"))
@ -97,9 +95,7 @@ export const codecForCheckPaymentPaidResponse = (): Codec<
.property("refund_details", codecForAny()) .property("refund_details", codecForAny())
.build("CheckPaymentPaidResponse"); .build("CheckPaymentPaidResponse");
export const codecForCheckPaymentUnpaidResponse = (): Codec< export const codecForCheckPaymentUnpaidResponse = (): Codec<CheckPaymentUnpaidResponse> =>
CheckPaymentUnpaidResponse
> =>
buildCodecForObject<CheckPaymentUnpaidResponse>() buildCodecForObject<CheckPaymentUnpaidResponse>()
.property("order_status", codecForConstString("unpaid")) .property("order_status", codecForConstString("unpaid"))
.property("taler_pay_uri", codecForString()) .property("taler_pay_uri", codecForString())
@ -107,17 +103,13 @@ export const codecForCheckPaymentUnpaidResponse = (): Codec<
.property("already_paid_order_id", codecOptional(codecForString())) .property("already_paid_order_id", codecOptional(codecForString()))
.build("CheckPaymentPaidResponse"); .build("CheckPaymentPaidResponse");
export const codecForCheckPaymentClaimedResponse = (): Codec< export const codecForCheckPaymentClaimedResponse = (): Codec<CheckPaymentClaimedResponse> =>
CheckPaymentClaimedResponse
> =>
buildCodecForObject<CheckPaymentClaimedResponse>() buildCodecForObject<CheckPaymentClaimedResponse>()
.property("order_status", codecForConstString("claimed")) .property("order_status", codecForConstString("claimed"))
.property("contract_terms", codecForContractTerms()) .property("contract_terms", codecForContractTerms())
.build("CheckPaymentClaimedResponse"); .build("CheckPaymentClaimedResponse");
export const codecForMerchantOrderPrivateStatusResponse = (): Codec< export const codecForMerchantOrderPrivateStatusResponse = (): Codec<MerchantOrderPrivateStatusResponse> =>
MerchantOrderPrivateStatusResponse
> =>
buildCodecForUnion<MerchantOrderPrivateStatusResponse>() buildCodecForUnion<MerchantOrderPrivateStatusResponse>()
.discriminateOn("order_status") .discriminateOn("order_status")
.alternative("paid", codecForCheckPaymentPaidResponse()) .alternative("paid", codecForCheckPaymentPaidResponse())

View File

@ -18,10 +18,7 @@
* Imports. * Imports.
*/ */
import { GlobalTestState } from "./harness"; import { GlobalTestState } from "./harness";
import { import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers";
createSimpleTestkudosEnvironment,
withdrawViaBank,
} from "./helpers";
/** /**
* Run test for basic, bank-integrated withdrawal and payment. * Run test for basic, bank-integrated withdrawal and payment.
@ -59,7 +56,7 @@ export async function runDepositTest(t: GlobalTestState) {
const trackResult = wallet.trackDepositGroup({ const trackResult = wallet.trackDepositGroup({
depositGroupId, depositGroupId,
}) });
console.log(JSON.stringify(trackResult, undefined, 2)); console.log(JSON.stringify(trackResult, undefined, 2));
} }

View File

@ -148,23 +148,23 @@ export async function createLibeufinTestEnvironment(
await LibeufinNexusApi.postPermission(libeufinNexus, { await LibeufinNexusApi.postPermission(libeufinNexus, {
action: "grant", action: "grant",
permission: { permission: {
subjectType: "user", subjectType: "user",
subjectId: "twguser", subjectId: "twguser",
resourceType: "facade", resourceType: "facade",
resourceId: "twg1", resourceId: "twg1",
permissionName: "facade.talerWireGateway.history" permissionName: "facade.talerWireGateway.history",
} },
}); });
await LibeufinNexusApi.postPermission(libeufinNexus, { await LibeufinNexusApi.postPermission(libeufinNexus, {
action: "grant", action: "grant",
permission: { permission: {
subjectType: "user", subjectType: "user",
subjectId: "twguser", subjectId: "twguser",
resourceType: "facade", resourceType: "facade",
resourceId: "twg1", resourceId: "twg1",
permissionName: "facade.talerWireGateway.transfer" permissionName: "facade.talerWireGateway.transfer",
} },
}); });
const exchange = ExchangeService.create(t, { const exchange = ExchangeService.create(t, {

View File

@ -30,7 +30,11 @@ import {
withdrawViaBank, withdrawViaBank,
SimpleTestEnvironment, SimpleTestEnvironment,
} from "./helpers"; } from "./helpers";
import { durationFromSpec, PreparePayResultType, URL } from "@gnu-taler/taler-wallet-core"; import {
durationFromSpec,
PreparePayResultType,
URL,
} from "@gnu-taler/taler-wallet-core";
import axios from "axios"; import axios from "axios";
async function testRefundApiWithFulfillmentUrl( async function testRefundApiWithFulfillmentUrl(

View File

@ -22,8 +22,15 @@
/** /**
* Imports. * Imports.
*/ */
import { PreparePayResultType, TalerErrorCode, URL } from "@gnu-taler/taler-wallet-core"; import {
import { FaultInjectionRequestContext, FaultInjectionResponseContext } from "./faultInjection"; PreparePayResultType,
TalerErrorCode,
URL,
} from "@gnu-taler/taler-wallet-core";
import {
FaultInjectionRequestContext,
FaultInjectionResponseContext,
} from "./faultInjection";
import { GlobalTestState, MerchantPrivateApi, setupDb } from "./harness"; import { GlobalTestState, MerchantPrivateApi, setupDb } from "./harness";
import { import {
createFaultInjectedMerchantTestkudosEnvironment, createFaultInjectedMerchantTestkudosEnvironment,

View File

@ -19,7 +19,10 @@
*/ */
import { GlobalTestState, MerchantPrivateApi, WalletCli } from "./harness"; import { GlobalTestState, MerchantPrivateApi, WalletCli } from "./harness";
import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers";
import { PreparePayResultType, TalerErrorCode } from "@gnu-taler/taler-wallet-core"; import {
PreparePayResultType,
TalerErrorCode,
} from "@gnu-taler/taler-wallet-core";
/** /**
* Run test for basic, bank-integrated withdrawal. * Run test for basic, bank-integrated withdrawal.

View File

@ -19,7 +19,11 @@
*/ */
import { GlobalTestState, delayMs, MerchantPrivateApi } from "./harness"; import { GlobalTestState, delayMs, MerchantPrivateApi } from "./harness";
import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers";
import { TransactionType, Amounts, durationFromSpec } from "@gnu-taler/taler-wallet-core"; import {
TransactionType,
Amounts,
durationFromSpec,
} from "@gnu-taler/taler-wallet-core";
/** /**
* Run test for basic, bank-integrated withdrawal. * Run test for basic, bank-integrated withdrawal.

View File

@ -19,7 +19,10 @@
*/ */
import { GlobalTestState, BankApi, BankAccessApi } from "./harness"; import { GlobalTestState, BankApi, BankAccessApi } from "./harness";
import { createSimpleTestkudosEnvironment } from "./helpers"; import { createSimpleTestkudosEnvironment } from "./helpers";
import { codecForBalancesResponse, TalerErrorCode } from "@gnu-taler/taler-wallet-core"; import {
codecForBalancesResponse,
TalerErrorCode,
} from "@gnu-taler/taler-wallet-core";
/** /**
* Run test for basic, bank-integrated withdrawal. * Run test for basic, bank-integrated withdrawal.

View File

@ -14,7 +14,12 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/ */
import { GlobalTestState, runTestWithState, shouldLingerInTest, TestRunResult } from "./harness"; import {
GlobalTestState,
runTestWithState,
shouldLingerInTest,
TestRunResult,
} from "./harness";
import { runPaymentTest } from "./test-payment"; import { runPaymentTest } from "./test-payment";
import * as fs from "fs"; import * as fs from "fs";
import * as path from "path"; import * as path from "path";