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
// 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");

View File

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

View File

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

View File

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

View File

@ -30,7 +30,11 @@ import {
withdrawViaBank,
SimpleTestEnvironment,
} 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";
async function testRefundApiWithFulfillmentUrl(

View File

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

View File

@ -19,7 +19,10 @@
*/
import { GlobalTestState, MerchantPrivateApi, WalletCli } from "./harness";
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.

View File

@ -19,7 +19,11 @@
*/
import { GlobalTestState, delayMs, MerchantPrivateApi } from "./harness";
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.

View File

@ -19,7 +19,10 @@
*/
import { GlobalTestState, BankApi, BankAccessApi } from "./harness";
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.

View File

@ -14,7 +14,12 @@
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 * as fs from "fs";
import * as path from "path";