use node16 for wallet-core, delete unused taler-config-lib package
This commit is contained in:
parent
b0223d662a
commit
83d4a1addc
@ -1,3 +0,0 @@
|
|||||||
# @gnu-taler/taler-config-lib
|
|
||||||
|
|
||||||
This package deploys Taler according to TypeScript instructions.
|
|
@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@gnu-taler/taler-config-lib",
|
|
||||||
"version": "0.9.0-dev.1",
|
|
||||||
"description": "GNU Taler Configuration engine.",
|
|
||||||
"module": "./lib/index.node.js",
|
|
||||||
"main": "./lib/index.node.js",
|
|
||||||
"type": "commonjs",
|
|
||||||
"types": "./lib/index.node.d.ts",
|
|
||||||
"typesVersions": {
|
|
||||||
"*": {
|
|
||||||
"lib/index.node.d.ts": [
|
|
||||||
"lib/index.node.d.ts"
|
|
||||||
],
|
|
||||||
"src/*": [],
|
|
||||||
"*": []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"author": "MS",
|
|
||||||
"license": "AGPL-3.0-or-later",
|
|
||||||
"private": false,
|
|
||||||
"scripts": {
|
|
||||||
"prepare": "tsc",
|
|
||||||
"compile": "tsc",
|
|
||||||
"clean": "rimraf dist lib tsconfig.tsbuildinfo",
|
|
||||||
"pretty": "prettier --write src"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/node": "^18.8.5",
|
|
||||||
"ava": "^4.3.3",
|
|
||||||
"esbuild": "^0.14.21",
|
|
||||||
"prettier": "^2.5.1",
|
|
||||||
"rimraf": "^3.0.2",
|
|
||||||
"typescript": "^4.8.4"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"big-integer": "^1.6.51",
|
|
||||||
"jed": "^1.1.1",
|
|
||||||
"tslib": "^2.4.0"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
module.exports = function(subject: any) {
|
|
||||||
console.log("Hello, World!");
|
|
||||||
};
|
|
@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
"compileOnSave": true,
|
|
||||||
"compilerOptions": {
|
|
||||||
"composite": true,
|
|
||||||
"declaration": true,
|
|
||||||
"declarationMap": false,
|
|
||||||
"target": "ES6",
|
|
||||||
"module": "ESNext",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"sourceMap": true,
|
|
||||||
"lib": ["es6"],
|
|
||||||
"types": ["node"],
|
|
||||||
"noImplicitReturns": true,
|
|
||||||
"noFallthroughCasesInSwitch": true,
|
|
||||||
"strict": true,
|
|
||||||
"strictPropertyInitialization": false,
|
|
||||||
"outDir": "lib",
|
|
||||||
"noImplicitAny": true,
|
|
||||||
"noImplicitThis": true,
|
|
||||||
"incremental": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"importHelpers": true,
|
|
||||||
"rootDir": "./src",
|
|
||||||
"typeRoots": ["./node_modules/@types"]
|
|
||||||
},
|
|
||||||
"include": ["src/**/*"]
|
|
||||||
}
|
|
@ -20,13 +20,6 @@
|
|||||||
|
|
||||||
import test from "ava";
|
import test from "ava";
|
||||||
import { clk } from "./clk.js";
|
import { clk } from "./clk.js";
|
||||||
import {
|
|
||||||
Codec,
|
|
||||||
buildCodecForObject,
|
|
||||||
codecForConstString,
|
|
||||||
codecForString,
|
|
||||||
buildCodecForUnion,
|
|
||||||
} from "./codec.js";
|
|
||||||
|
|
||||||
test("bla", (t) => {
|
test("bla", (t) => {
|
||||||
const prog = clk.program("foo", {
|
const prog = clk.program("foo", {
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
"bin": {
|
"bin": {
|
||||||
"taler-wallet-cli": "./bin/taler-wallet-cli"
|
"taler-wallet-cli": "./bin/taler-wallet-cli"
|
||||||
},
|
},
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "tsc && rollup -c",
|
"prepare": "tsc && rollup -c",
|
||||||
"compile": "tsc && rollup -c",
|
"compile": "tsc && rollup -c",
|
||||||
|
@ -31,6 +31,7 @@ export default {
|
|||||||
plugins: [
|
plugins: [
|
||||||
replace({
|
replace({
|
||||||
__VERSION__: `"${printedVersion}"`,
|
__VERSION__: `"${printedVersion}"`,
|
||||||
|
preventAssignment: true,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
nodeResolve({
|
nodeResolve({
|
||||||
|
@ -55,7 +55,7 @@ import {
|
|||||||
WalletCoreApiClient,
|
WalletCoreApiClient,
|
||||||
} from "@gnu-taler/taler-wallet-core";
|
} from "@gnu-taler/taler-wallet-core";
|
||||||
import { deepStrictEqual } from "assert";
|
import { deepStrictEqual } from "assert";
|
||||||
import axios, { AxiosError } from "axios";
|
import axiosImp, { AxiosError } from "axios";
|
||||||
import { ChildProcess, spawn } from "child_process";
|
import { ChildProcess, spawn } from "child_process";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import * as http from "http";
|
import * as http from "http";
|
||||||
@ -79,6 +79,8 @@ import {
|
|||||||
|
|
||||||
const exec = util.promisify(require("child_process").exec);
|
const exec = util.promisify(require("child_process").exec);
|
||||||
|
|
||||||
|
const axios = axiosImp.default;
|
||||||
|
|
||||||
export async function delayMs(ms: number): Promise<void> {
|
export async function delayMs(ms: number): Promise<void> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
setTimeout(() => resolve(), ms);
|
setTimeout(() => resolve(), ms);
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This file defines most of the API calls offered
|
* This file defines most of the API calls offered
|
||||||
* by Nexus and Sandbox. They don't have state,
|
* by Nexus and Sandbox. They don't have state,
|
||||||
@ -6,8 +5,8 @@
|
|||||||
* the services get actually started and managed.
|
* the services get actually started and managed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import axiosImp from "axios";
|
||||||
import axios from "axios";
|
const axios = axiosImp.default;
|
||||||
import { URL } from "@gnu-taler/taler-util";
|
import { URL } from "@gnu-taler/taler-util";
|
||||||
|
|
||||||
export interface LibeufinSandboxServiceInterface {
|
export interface LibeufinSandboxServiceInterface {
|
||||||
@ -80,7 +79,6 @@ export interface PostNexusPermissionRequest {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface CreateAnastasisFacadeRequest {
|
export interface CreateAnastasisFacadeRequest {
|
||||||
name: string;
|
name: string;
|
||||||
connectionName: string;
|
connectionName: string;
|
||||||
@ -135,7 +133,6 @@ export interface SimulateIncomingTransactionRequest {
|
|||||||
amount: string;
|
amount: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface CreateEbicsBankAccountRequest {
|
export interface CreateEbicsBankAccountRequest {
|
||||||
subscriber: {
|
subscriber: {
|
||||||
hostID: string;
|
hostID: string;
|
||||||
@ -171,7 +168,6 @@ function getRandomString(): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export namespace LibeufinSandboxApi {
|
export namespace LibeufinSandboxApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return balance and payto-address of 'accountLabel'.
|
* Return balance and payto-address of 'accountLabel'.
|
||||||
* Note: the demobank serving the request is hard-coded
|
* Note: the demobank serving the request is hard-coded
|
||||||
@ -182,14 +178,17 @@ export namespace LibeufinSandboxApi {
|
|||||||
username: string,
|
username: string,
|
||||||
password: string,
|
password: string,
|
||||||
libeufinSandboxService: LibeufinSandboxServiceInterface,
|
libeufinSandboxService: LibeufinSandboxServiceInterface,
|
||||||
accountLabel: string
|
accountLabel: string,
|
||||||
) {
|
) {
|
||||||
let url = new URL(`accounts/${accountLabel}`,libeufinSandboxService.baseUrl);
|
let url = new URL(
|
||||||
|
`accounts/${accountLabel}`,
|
||||||
|
libeufinSandboxService.baseUrl,
|
||||||
|
);
|
||||||
return await axios.get(url.href, {
|
return await axios.get(url.href, {
|
||||||
auth: {
|
auth: {
|
||||||
username: username,
|
username: username,
|
||||||
password: password
|
password: password,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,10 +198,10 @@ export namespace LibeufinSandboxApi {
|
|||||||
password: string,
|
password: string,
|
||||||
libeufinSandboxService: LibeufinSandboxServiceInterface,
|
libeufinSandboxService: LibeufinSandboxServiceInterface,
|
||||||
) {
|
) {
|
||||||
let url = new URL("testing/register", libeufinSandboxService.baseUrl);
|
let url = new URL("testing/register", libeufinSandboxService.baseUrl);
|
||||||
await axios.post(url.href, {
|
await axios.post(url.href, {
|
||||||
username: username,
|
username: username,
|
||||||
password: password
|
password: password,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,17 +214,21 @@ export namespace LibeufinSandboxApi {
|
|||||||
) {
|
) {
|
||||||
// baseUrl should already be pointed to one demobank.
|
// baseUrl should already be pointed to one demobank.
|
||||||
let url = new URL("ebics/subscribers", libeufinSandboxService.baseUrl);
|
let url = new URL("ebics/subscribers", libeufinSandboxService.baseUrl);
|
||||||
await axios.post(url.href, {
|
await axios.post(
|
||||||
userID: req.userID,
|
url.href,
|
||||||
hostID: req.hostID,
|
{
|
||||||
partnerID: req.partnerID,
|
userID: req.userID,
|
||||||
demobankAccountLabel: demobankAccountLabel,
|
hostID: req.hostID,
|
||||||
}, {
|
partnerID: req.partnerID,
|
||||||
auth: {
|
demobankAccountLabel: demobankAccountLabel,
|
||||||
username: "admin",
|
|
||||||
password: "secret",
|
|
||||||
},
|
},
|
||||||
});
|
{
|
||||||
|
auth: {
|
||||||
|
username: "admin",
|
||||||
|
password: "secret",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function rotateKeys(
|
export async function rotateKeys(
|
||||||
@ -234,12 +237,16 @@ export namespace LibeufinSandboxApi {
|
|||||||
) {
|
) {
|
||||||
const baseUrl = libeufinSandboxService.baseUrl;
|
const baseUrl = libeufinSandboxService.baseUrl;
|
||||||
let url = new URL(`admin/ebics/hosts/${hostID}/rotate-keys`, baseUrl);
|
let url = new URL(`admin/ebics/hosts/${hostID}/rotate-keys`, baseUrl);
|
||||||
await axios.post(url.href, {}, {
|
await axios.post(
|
||||||
auth: {
|
url.href,
|
||||||
username: "admin",
|
{},
|
||||||
password: "secret",
|
{
|
||||||
|
auth: {
|
||||||
|
username: "admin",
|
||||||
|
password: "secret",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
);
|
||||||
}
|
}
|
||||||
export async function createEbicsHost(
|
export async function createEbicsHost(
|
||||||
libeufinSandboxService: LibeufinSandboxServiceInterface,
|
libeufinSandboxService: LibeufinSandboxServiceInterface,
|
||||||
@ -247,16 +254,19 @@ export namespace LibeufinSandboxApi {
|
|||||||
) {
|
) {
|
||||||
const baseUrl = libeufinSandboxService.baseUrl;
|
const baseUrl = libeufinSandboxService.baseUrl;
|
||||||
let url = new URL("admin/ebics/hosts", baseUrl);
|
let url = new URL("admin/ebics/hosts", baseUrl);
|
||||||
await axios.post(url.href, {
|
await axios.post(
|
||||||
hostID,
|
url.href,
|
||||||
ebicsVersion: "2.5",
|
{
|
||||||
},
|
hostID,
|
||||||
{
|
ebicsVersion: "2.5",
|
||||||
auth: {
|
|
||||||
username: "admin",
|
|
||||||
password: "secret",
|
|
||||||
},
|
},
|
||||||
});
|
{
|
||||||
|
auth: {
|
||||||
|
username: "admin",
|
||||||
|
password: "secret",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function createBankAccount(
|
export async function createBankAccount(
|
||||||
@ -347,16 +357,19 @@ export namespace LibeufinSandboxApi {
|
|||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
const baseUrl = libeufinSandboxService.baseUrl;
|
const baseUrl = libeufinSandboxService.baseUrl;
|
||||||
let url = new URL("admin/payments/camt", baseUrl);
|
let url = new URL("admin/payments/camt", baseUrl);
|
||||||
return await axios.post(url.href, {
|
return await axios.post(
|
||||||
bankaccount: accountLabel,
|
url.href,
|
||||||
type: 53,
|
{
|
||||||
},
|
bankaccount: accountLabel,
|
||||||
{
|
type: 53,
|
||||||
auth: {
|
|
||||||
username: "admin",
|
|
||||||
password: "secret",
|
|
||||||
},
|
},
|
||||||
});
|
{
|
||||||
|
auth: {
|
||||||
|
username: "admin",
|
||||||
|
password: "secret",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getAccountInfoWithBalance(
|
export async function getAccountInfoWithBalance(
|
||||||
@ -364,10 +377,7 @@ export namespace LibeufinSandboxApi {
|
|||||||
accountLabel: string,
|
accountLabel: string,
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
const baseUrl = libeufinSandboxService.baseUrl;
|
const baseUrl = libeufinSandboxService.baseUrl;
|
||||||
let url = new URL(
|
let url = new URL(`admin/bank-accounts/${accountLabel}`, baseUrl);
|
||||||
`admin/bank-accounts/${accountLabel}`,
|
|
||||||
baseUrl,
|
|
||||||
);
|
|
||||||
return await axios.get(url.href, {
|
return await axios.get(url.href, {
|
||||||
auth: {
|
auth: {
|
||||||
username: "admin",
|
username: "admin",
|
||||||
@ -439,22 +449,15 @@ export namespace LibeufinNexusApi {
|
|||||||
accountName: string,
|
accountName: string,
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
const baseUrl = libeufinNexusService.baseUrl;
|
const baseUrl = libeufinNexusService.baseUrl;
|
||||||
let url = new URL(
|
let url = new URL(`bank-accounts/${accountName}`, baseUrl);
|
||||||
`bank-accounts/${accountName}`,
|
return await axios.get(url.href, {
|
||||||
baseUrl,
|
auth: {
|
||||||
);
|
username: "admin",
|
||||||
return await axios.get(
|
password: "test",
|
||||||
url.href,
|
|
||||||
{
|
|
||||||
auth: {
|
|
||||||
username: "admin",
|
|
||||||
password: "test",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export async function submitInitiatedPayment(
|
export async function submitInitiatedPayment(
|
||||||
libeufinNexusService: LibeufinNexusServiceInterface,
|
libeufinNexusService: LibeufinNexusServiceInterface,
|
||||||
accountName: string,
|
accountName: string,
|
||||||
@ -582,7 +585,8 @@ export namespace LibeufinNexusApi {
|
|||||||
password: string = "test",
|
password: string = "test",
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
let url = new URL("history/incoming", anastasisBaseUrl);
|
let url = new URL("history/incoming", anastasisBaseUrl);
|
||||||
let response = await axios.get(url.href, { params: params,
|
let response = await axios.get(url.href, {
|
||||||
|
params: params,
|
||||||
auth: {
|
auth: {
|
||||||
username: username,
|
username: username,
|
||||||
password: password,
|
password: password,
|
||||||
@ -854,4 +858,3 @@ export namespace LibeufinNexusApi {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ import {
|
|||||||
WalletCoreApiClient,
|
WalletCoreApiClient,
|
||||||
walletCoreDebugFlags,
|
walletCoreDebugFlags,
|
||||||
} from "@gnu-taler/taler-wallet-core";
|
} from "@gnu-taler/taler-wallet-core";
|
||||||
import type { TalerCryptoInterface } from "@gnu-taler/taler-wallet-core/src/crypto/cryptoImplementation";
|
import type { TalerCryptoInterface } from "@gnu-taler/taler-wallet-core";
|
||||||
import { TextDecoder, TextEncoder } from "util";
|
import { TextDecoder, TextEncoder } from "util";
|
||||||
import { runBench1 } from "./bench1.js";
|
import { runBench1 } from "./bench1.js";
|
||||||
import { runBench2 } from "./bench2.js";
|
import { runBench2 } from "./bench2.js";
|
||||||
@ -68,7 +68,6 @@ import { runEnv1 } from "./env1.js";
|
|||||||
import { GlobalTestState, runTestWithState } from "./harness/harness.js";
|
import { GlobalTestState, runTestWithState } from "./harness/harness.js";
|
||||||
import { getTestInfo, runTests } from "./integrationtests/testrunner.js";
|
import { getTestInfo, runTests } from "./integrationtests/testrunner.js";
|
||||||
import { lintExchangeDeployment } from "./lint.js";
|
import { lintExchangeDeployment } from "./lint.js";
|
||||||
import { checkLogicInvariant } from "@gnu-taler/taler-wallet-core/src/util/invariants.js";
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
global.TextEncoder = TextEncoder;
|
global.TextEncoder = TextEncoder;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -27,7 +27,7 @@ import {
|
|||||||
getPayto,
|
getPayto,
|
||||||
} from "../harness/harness.js";
|
} from "../harness/harness.js";
|
||||||
import { createEddsaKeyPair, encodeCrock } from "@gnu-taler/taler-util";
|
import { createEddsaKeyPair, encodeCrock } from "@gnu-taler/taler-util";
|
||||||
import { defaultCoinConfig } from "../harness/denomStructures";
|
import { defaultCoinConfig } from "../harness/denomStructures.js";
|
||||||
import {
|
import {
|
||||||
BankApi,
|
BankApi,
|
||||||
BankAccessApi,
|
BankAccessApi,
|
||||||
|
@ -28,7 +28,7 @@ import {
|
|||||||
NodeHttpLib,
|
NodeHttpLib,
|
||||||
readSuccessResponseJsonOrThrow,
|
readSuccessResponseJsonOrThrow,
|
||||||
} from "@gnu-taler/taler-wallet-core";
|
} from "@gnu-taler/taler-wallet-core";
|
||||||
import { makeNoFeeCoinConfig } from "../harness/denomStructures";
|
import { makeNoFeeCoinConfig } from "../harness/denomStructures.js";
|
||||||
import {
|
import {
|
||||||
BankService,
|
BankService,
|
||||||
ExchangeService,
|
ExchangeService,
|
||||||
|
@ -25,7 +25,7 @@ import {
|
|||||||
LibeufinSandboxService,
|
LibeufinSandboxService,
|
||||||
LibeufinSandboxApi,
|
LibeufinSandboxApi,
|
||||||
findNexusPayment,
|
findNexusPayment,
|
||||||
} from "../harness/libeufin";
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run basic test with LibEuFin.
|
* Run basic test with LibEuFin.
|
||||||
|
@ -18,14 +18,7 @@
|
|||||||
* Imports.
|
* Imports.
|
||||||
*/
|
*/
|
||||||
import { GlobalTestState } from "../harness/harness.js";
|
import { GlobalTestState } from "../harness/harness.js";
|
||||||
import {
|
import { LibeufinNexusApi, LibeufinNexusService } from "../harness/libeufin.js";
|
||||||
NexusUserBundle,
|
|
||||||
LibeufinNexusApi,
|
|
||||||
LibeufinNexusService,
|
|
||||||
LibeufinSandboxService,
|
|
||||||
LibeufinSandboxApi,
|
|
||||||
findNexusPayment,
|
|
||||||
} from "../harness/libeufin";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run basic test with LibEuFin.
|
* Run basic test with LibEuFin.
|
||||||
|
@ -17,18 +17,18 @@
|
|||||||
/**
|
/**
|
||||||
* Imports.
|
* Imports.
|
||||||
*/
|
*/
|
||||||
import axios from "axios";
|
|
||||||
import { URL } from "@gnu-taler/taler-util";
|
import { URL } from "@gnu-taler/taler-util";
|
||||||
|
import axiosImp from "axios";
|
||||||
import { GlobalTestState } from "../harness/harness.js";
|
import { GlobalTestState } from "../harness/harness.js";
|
||||||
import {
|
import {
|
||||||
SandboxUserBundle,
|
|
||||||
NexusUserBundle,
|
|
||||||
launchLibeufinServices,
|
launchLibeufinServices,
|
||||||
LibeufinNexusApi,
|
NexusUserBundle,
|
||||||
} from "../harness/libeufin";
|
SandboxUserBundle,
|
||||||
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
|
const axios = axiosImp.default;
|
||||||
|
|
||||||
export async function runLibeufinApiFacadeBadRequestTest(t: GlobalTestState) {
|
export async function runLibeufinApiFacadeBadRequestTest(t: GlobalTestState) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User saltetd "01"
|
* User saltetd "01"
|
||||||
*/
|
*/
|
||||||
@ -37,7 +37,7 @@ export async function runLibeufinApiFacadeBadRequestTest(t: GlobalTestState) {
|
|||||||
"http://localhost:5010/ebicsweb",
|
"http://localhost:5010/ebicsweb",
|
||||||
);
|
);
|
||||||
const user01sandbox = new SandboxUserBundle("01");
|
const user01sandbox = new SandboxUserBundle("01");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch Sandbox and Nexus.
|
* Launch Sandbox and Nexus.
|
||||||
*/
|
*/
|
||||||
|
@ -23,7 +23,7 @@ import {
|
|||||||
NexusUserBundle,
|
NexusUserBundle,
|
||||||
launchLibeufinServices,
|
launchLibeufinServices,
|
||||||
LibeufinNexusApi,
|
LibeufinNexusApi,
|
||||||
} from "../harness/libeufin";
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run basic test with LibEuFin.
|
* Run basic test with LibEuFin.
|
||||||
|
@ -22,7 +22,7 @@ import {
|
|||||||
NexusUserBundle,
|
NexusUserBundle,
|
||||||
LibeufinNexusApi,
|
LibeufinNexusApi,
|
||||||
LibeufinNexusService,
|
LibeufinNexusService,
|
||||||
} from "../harness/libeufin";
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run basic test with LibEuFin.
|
* Run basic test with LibEuFin.
|
||||||
|
@ -19,19 +19,14 @@
|
|||||||
*/
|
*/
|
||||||
import { GlobalTestState } from "../harness/harness.js";
|
import { GlobalTestState } from "../harness/harness.js";
|
||||||
import {
|
import {
|
||||||
NexusUserBundle,
|
|
||||||
LibeufinNexusApi,
|
|
||||||
LibeufinNexusService,
|
|
||||||
LibeufinSandboxService,
|
|
||||||
LibeufinSandboxApi,
|
LibeufinSandboxApi,
|
||||||
findNexusPayment,
|
LibeufinSandboxService,
|
||||||
} from "../harness/libeufin";
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
// This test only checks that LibEuFin doesn't fail when
|
// This test only checks that LibEuFin doesn't fail when
|
||||||
// it generates Camt statements - no assertions take place.
|
// it generates Camt statements - no assertions take place.
|
||||||
// Furthermore, it prints the Camt.053 being generated.
|
// Furthermore, it prints the Camt.053 being generated.
|
||||||
export async function runLibeufinApiSandboxCamtTest(t: GlobalTestState) {
|
export async function runLibeufinApiSandboxCamtTest(t: GlobalTestState) {
|
||||||
|
|
||||||
const sandbox = await LibeufinSandboxService.create(t, {
|
const sandbox = await LibeufinSandboxService.create(t, {
|
||||||
httpPort: 5012,
|
httpPort: 5012,
|
||||||
databaseJdbcUri: `jdbc:sqlite:${t.testDir}/libeufin-sandbox.sqlite3`,
|
databaseJdbcUri: `jdbc:sqlite:${t.testDir}/libeufin-sandbox.sqlite3`,
|
||||||
@ -50,10 +45,30 @@ export async function runLibeufinApiSandboxCamtTest(t: GlobalTestState) {
|
|||||||
name: "Mock Name",
|
name: "Mock Name",
|
||||||
label: "mock-account-1",
|
label: "mock-account-1",
|
||||||
});
|
});
|
||||||
await sandbox.makeTransaction("mock-account-0", "mock-account-1", "EUR:1", "+1");
|
await sandbox.makeTransaction(
|
||||||
await sandbox.makeTransaction("mock-account-0", "mock-account-1", "EUR:1", "+1");
|
"mock-account-0",
|
||||||
await sandbox.makeTransaction("mock-account-0", "mock-account-1", "EUR:1", "+1");
|
"mock-account-1",
|
||||||
await sandbox.makeTransaction("mock-account-1", "mock-account-0", "EUR:5", "minus 5");
|
"EUR:1",
|
||||||
|
"+1",
|
||||||
|
);
|
||||||
|
await sandbox.makeTransaction(
|
||||||
|
"mock-account-0",
|
||||||
|
"mock-account-1",
|
||||||
|
"EUR:1",
|
||||||
|
"+1",
|
||||||
|
);
|
||||||
|
await sandbox.makeTransaction(
|
||||||
|
"mock-account-0",
|
||||||
|
"mock-account-1",
|
||||||
|
"EUR:1",
|
||||||
|
"+1",
|
||||||
|
);
|
||||||
|
await sandbox.makeTransaction(
|
||||||
|
"mock-account-1",
|
||||||
|
"mock-account-0",
|
||||||
|
"EUR:5",
|
||||||
|
"minus 5",
|
||||||
|
);
|
||||||
await sandbox.c53tick();
|
await sandbox.c53tick();
|
||||||
let ret = await LibeufinSandboxApi.getCamt053(sandbox, "mock-account-1");
|
let ret = await LibeufinSandboxApi.getCamt053(sandbox, "mock-account-1");
|
||||||
console.log(ret);
|
console.log(ret);
|
||||||
|
@ -19,16 +19,13 @@
|
|||||||
*/
|
*/
|
||||||
import { GlobalTestState } from "../harness/harness.js";
|
import { GlobalTestState } from "../harness/harness.js";
|
||||||
import {
|
import {
|
||||||
NexusUserBundle,
|
|
||||||
LibeufinNexusApi,
|
|
||||||
LibeufinNexusService,
|
|
||||||
LibeufinSandboxService,
|
|
||||||
LibeufinSandboxApi,
|
LibeufinSandboxApi,
|
||||||
findNexusPayment,
|
LibeufinSandboxService,
|
||||||
} from "../harness/libeufin";
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
export async function runLibeufinApiSandboxTransactionsTest(t: GlobalTestState) {
|
|
||||||
|
|
||||||
|
export async function runLibeufinApiSandboxTransactionsTest(
|
||||||
|
t: GlobalTestState,
|
||||||
|
) {
|
||||||
const sandbox = await LibeufinSandboxService.create(t, {
|
const sandbox = await LibeufinSandboxService.create(t, {
|
||||||
httpPort: 5012,
|
httpPort: 5012,
|
||||||
databaseJdbcUri: `jdbc:sqlite:${t.testDir}/libeufin-sandbox.sqlite3`,
|
databaseJdbcUri: `jdbc:sqlite:${t.testDir}/libeufin-sandbox.sqlite3`,
|
||||||
@ -42,30 +39,31 @@ export async function runLibeufinApiSandboxTransactionsTest(t: GlobalTestState)
|
|||||||
label: "mock-account",
|
label: "mock-account",
|
||||||
});
|
});
|
||||||
await LibeufinSandboxApi.simulateIncomingTransaction(
|
await LibeufinSandboxApi.simulateIncomingTransaction(
|
||||||
sandbox,
|
sandbox,
|
||||||
"mock-account",
|
"mock-account",
|
||||||
{
|
{
|
||||||
|
|
||||||
debtorIban: "DE84500105176881385584",
|
debtorIban: "DE84500105176881385584",
|
||||||
debtorBic: "BELADEBEXXX",
|
debtorBic: "BELADEBEXXX",
|
||||||
debtorName: "mock2",
|
debtorName: "mock2",
|
||||||
subject: "mock subject",
|
subject: "mock subject",
|
||||||
amount: "1" // EUR is default.
|
amount: "1", // EUR is default.
|
||||||
}
|
},
|
||||||
)
|
);
|
||||||
await LibeufinSandboxApi.simulateIncomingTransaction(
|
await LibeufinSandboxApi.simulateIncomingTransaction(
|
||||||
sandbox,
|
sandbox,
|
||||||
"mock-account",
|
"mock-account",
|
||||||
{
|
{
|
||||||
|
|
||||||
debtorIban: "DE84500105176881385584",
|
debtorIban: "DE84500105176881385584",
|
||||||
debtorBic: "BELADEBEXXX",
|
debtorBic: "BELADEBEXXX",
|
||||||
debtorName: "mock2",
|
debtorName: "mock2",
|
||||||
subject: "mock subject 2",
|
subject: "mock subject 2",
|
||||||
amount: "1.1" // EUR is default.
|
amount: "1.1", // EUR is default.
|
||||||
}
|
},
|
||||||
)
|
);
|
||||||
let ret = await LibeufinSandboxApi.getAccountInfoWithBalance(sandbox, "mock-account");
|
let ret = await LibeufinSandboxApi.getAccountInfoWithBalance(
|
||||||
|
sandbox,
|
||||||
|
"mock-account",
|
||||||
|
);
|
||||||
t.assertAmountEquals(ret.data.balance, "EUR:2.1");
|
t.assertAmountEquals(ret.data.balance, "EUR:2.1");
|
||||||
}
|
}
|
||||||
runLibeufinApiSandboxTransactionsTest.suites = ["libeufin"];
|
runLibeufinApiSandboxTransactionsTest.suites = ["libeufin"];
|
||||||
|
@ -17,15 +17,14 @@
|
|||||||
/**
|
/**
|
||||||
* Imports.
|
* Imports.
|
||||||
*/
|
*/
|
||||||
import { GlobalTestState, setupDb } from "../harness/harness.js";
|
import { GlobalTestState } from "../harness/harness.js";
|
||||||
import {
|
import {
|
||||||
SandboxUserBundle,
|
|
||||||
NexusUserBundle,
|
|
||||||
launchLibeufinServices,
|
launchLibeufinServices,
|
||||||
LibeufinSandboxApi,
|
|
||||||
LibeufinNexusApi,
|
LibeufinNexusApi,
|
||||||
LibeufinNexusService,
|
LibeufinNexusService,
|
||||||
} from "../harness/libeufin";
|
NexusUserBundle,
|
||||||
|
SandboxUserBundle,
|
||||||
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test Nexus scheduling API. It creates a task, check whether it shows
|
* Test Nexus scheduling API. It creates a task, check whether it shows
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* Imports.
|
* Imports.
|
||||||
*/
|
*/
|
||||||
import { GlobalTestState } from "../harness/harness.js";
|
import { GlobalTestState } from "../harness/harness.js";
|
||||||
import { LibeufinNexusApi, LibeufinNexusService } from "../harness/libeufin";
|
import { LibeufinNexusApi, LibeufinNexusService } from "../harness/libeufin.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run basic test with LibEuFin.
|
* Run basic test with LibEuFin.
|
||||||
|
@ -23,7 +23,7 @@ import {
|
|||||||
LibeufinNexusApi,
|
LibeufinNexusApi,
|
||||||
LibeufinNexusService,
|
LibeufinNexusService,
|
||||||
LibeufinSandboxService,
|
LibeufinSandboxService,
|
||||||
} from "../harness/libeufin";
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Testing how Nexus reacts when the Sandbox is unreachable.
|
* Testing how Nexus reacts when the Sandbox is unreachable.
|
||||||
|
@ -22,7 +22,7 @@ import {
|
|||||||
WalletApiOperation,
|
WalletApiOperation,
|
||||||
HarnessExchangeBankAccount,
|
HarnessExchangeBankAccount,
|
||||||
} from "@gnu-taler/taler-wallet-core";
|
} from "@gnu-taler/taler-wallet-core";
|
||||||
import { CoinConfig, defaultCoinConfig } from "../harness/denomStructures";
|
import { CoinConfig, defaultCoinConfig } from "../harness/denomStructures.js";
|
||||||
import {
|
import {
|
||||||
DbInfo,
|
DbInfo,
|
||||||
ExchangeService,
|
ExchangeService,
|
||||||
|
@ -17,14 +17,13 @@
|
|||||||
/**
|
/**
|
||||||
* Imports.
|
* Imports.
|
||||||
*/
|
*/
|
||||||
import { GlobalTestState, delayMs } from "../harness/harness.js";
|
import { GlobalTestState } from "../harness/harness.js";
|
||||||
import {
|
import {
|
||||||
SandboxUserBundle,
|
|
||||||
NexusUserBundle,
|
|
||||||
launchLibeufinServices,
|
launchLibeufinServices,
|
||||||
LibeufinSandboxApi,
|
|
||||||
LibeufinNexusApi,
|
LibeufinNexusApi,
|
||||||
} from "../harness/libeufin";
|
NexusUserBundle,
|
||||||
|
SandboxUserBundle,
|
||||||
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This test checks how the C52 and C53 coordinate. It'll test
|
* This test checks how the C52 and C53 coordinate. It'll test
|
||||||
@ -81,7 +80,7 @@ export async function runLibeufinC5xTest(t: GlobalTestState) {
|
|||||||
user01nexus.localAccountName,
|
user01nexus.localAccountName,
|
||||||
);
|
);
|
||||||
t.assertTrue(nexusTxs.data["transactions"].length == 0);
|
t.assertTrue(nexusTxs.data["transactions"].length == 0);
|
||||||
|
|
||||||
// Addressing one payment to user 01
|
// Addressing one payment to user 01
|
||||||
await libeufinServices.libeufinSandbox.makeTransaction(
|
await libeufinServices.libeufinSandbox.makeTransaction(
|
||||||
user02sandbox.ebicsBankAccount.label, // debit
|
user02sandbox.ebicsBankAccount.label, // debit
|
||||||
|
@ -24,7 +24,7 @@ import {
|
|||||||
launchLibeufinServices,
|
launchLibeufinServices,
|
||||||
LibeufinNexusApi,
|
LibeufinNexusApi,
|
||||||
LibeufinSandboxApi,
|
LibeufinSandboxApi,
|
||||||
} from "../harness/libeufin";
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Testing the Anastasis API, offered by the Anastasis facade.
|
* Testing the Anastasis API, offered by the Anastasis facade.
|
||||||
|
@ -24,7 +24,7 @@ import {
|
|||||||
launchLibeufinServices,
|
launchLibeufinServices,
|
||||||
LibeufinSandboxApi,
|
LibeufinSandboxApi,
|
||||||
LibeufinNexusApi,
|
LibeufinNexusApi,
|
||||||
} from "../harness/libeufin";
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run basic test with LibEuFin.
|
* Run basic test with LibEuFin.
|
||||||
|
@ -23,7 +23,7 @@ import {
|
|||||||
NexusUserBundle,
|
NexusUserBundle,
|
||||||
launchLibeufinServices,
|
launchLibeufinServices,
|
||||||
LibeufinNexusApi,
|
LibeufinNexusApi,
|
||||||
} from "../harness/libeufin";
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This test checks how the C52 and C53 coordinate. It'll test
|
* This test checks how the C52 and C53 coordinate. It'll test
|
||||||
|
@ -24,7 +24,7 @@ import {
|
|||||||
launchLibeufinServices,
|
launchLibeufinServices,
|
||||||
LibeufinSandboxApi,
|
LibeufinSandboxApi,
|
||||||
LibeufinNexusApi,
|
LibeufinNexusApi,
|
||||||
} from "../harness/libeufin";
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User 01 expects a refund from user 02, and expectedly user 03
|
* User 01 expects a refund from user 02, and expectedly user 03
|
||||||
|
@ -24,7 +24,7 @@ import {
|
|||||||
launchLibeufinServices,
|
launchLibeufinServices,
|
||||||
LibeufinSandboxApi,
|
LibeufinSandboxApi,
|
||||||
LibeufinNexusApi,
|
LibeufinNexusApi,
|
||||||
} from "../harness/libeufin";
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run basic test with LibEuFin.
|
* Run basic test with LibEuFin.
|
||||||
|
@ -19,16 +19,13 @@
|
|||||||
*/
|
*/
|
||||||
import { GlobalTestState } from "../harness/harness.js";
|
import { GlobalTestState } from "../harness/harness.js";
|
||||||
import {
|
import {
|
||||||
NexusUserBundle,
|
|
||||||
LibeufinNexusApi,
|
|
||||||
LibeufinNexusService,
|
|
||||||
LibeufinSandboxService,
|
|
||||||
LibeufinSandboxApi,
|
LibeufinSandboxApi,
|
||||||
findNexusPayment,
|
LibeufinSandboxService,
|
||||||
} from "../harness/libeufin";
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
export async function runLibeufinSandboxWireTransferCliTest(t: GlobalTestState) {
|
|
||||||
|
|
||||||
|
export async function runLibeufinSandboxWireTransferCliTest(
|
||||||
|
t: GlobalTestState,
|
||||||
|
) {
|
||||||
const sandbox = await LibeufinSandboxService.create(t, {
|
const sandbox = await LibeufinSandboxService.create(t, {
|
||||||
httpPort: 5012,
|
httpPort: 5012,
|
||||||
databaseJdbcUri: `jdbc:sqlite:${t.testDir}/libeufin-sandbox.sqlite3`,
|
databaseJdbcUri: `jdbc:sqlite:${t.testDir}/libeufin-sandbox.sqlite3`,
|
||||||
@ -49,22 +46,40 @@ export async function runLibeufinSandboxWireTransferCliTest(t: GlobalTestState)
|
|||||||
label: "mock-account-2",
|
label: "mock-account-2",
|
||||||
});
|
});
|
||||||
await sandbox.makeTransaction(
|
await sandbox.makeTransaction(
|
||||||
"mock-account", "mock-account-2", "EUR:1", "one!"
|
"mock-account",
|
||||||
|
"mock-account-2",
|
||||||
|
"EUR:1",
|
||||||
|
"one!",
|
||||||
);
|
);
|
||||||
await sandbox.makeTransaction(
|
await sandbox.makeTransaction(
|
||||||
"mock-account", "mock-account-2", "EUR:1", "two!"
|
"mock-account",
|
||||||
|
"mock-account-2",
|
||||||
|
"EUR:1",
|
||||||
|
"two!",
|
||||||
);
|
);
|
||||||
await sandbox.makeTransaction(
|
await sandbox.makeTransaction(
|
||||||
"mock-account", "mock-account-2", "EUR:1", "three!"
|
"mock-account",
|
||||||
|
"mock-account-2",
|
||||||
|
"EUR:1",
|
||||||
|
"three!",
|
||||||
);
|
);
|
||||||
await sandbox.makeTransaction(
|
await sandbox.makeTransaction(
|
||||||
"mock-account-2", "mock-account", "EUR:1", "Give one back."
|
"mock-account-2",
|
||||||
|
"mock-account",
|
||||||
|
"EUR:1",
|
||||||
|
"Give one back.",
|
||||||
);
|
);
|
||||||
await sandbox.makeTransaction(
|
await sandbox.makeTransaction(
|
||||||
"mock-account-2", "mock-account", "EUR:0.11", "Give fraction back."
|
"mock-account-2",
|
||||||
|
"mock-account",
|
||||||
|
"EUR:0.11",
|
||||||
|
"Give fraction back.",
|
||||||
);
|
);
|
||||||
let ret = await LibeufinSandboxApi.getAccountInfoWithBalance(sandbox, "mock-account-2");
|
let ret = await LibeufinSandboxApi.getAccountInfoWithBalance(
|
||||||
console.log(ret.data.balance)
|
sandbox,
|
||||||
t.assertTrue(ret.data.balance == "EUR:1.89")
|
"mock-account-2",
|
||||||
|
);
|
||||||
|
console.log(ret.data.balance);
|
||||||
|
t.assertTrue(ret.data.balance == "EUR:1.89");
|
||||||
}
|
}
|
||||||
runLibeufinSandboxWireTransferCliTest.suites = ["libeufin"];
|
runLibeufinSandboxWireTransferCliTest.suites = ["libeufin"];
|
||||||
|
@ -22,7 +22,7 @@ import {
|
|||||||
LibeufinNexusService,
|
LibeufinNexusService,
|
||||||
LibeufinSandboxService,
|
LibeufinSandboxService,
|
||||||
LibeufinCli,
|
LibeufinCli,
|
||||||
} from "../harness/libeufin";
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run basic test with LibEuFin.
|
* Run basic test with LibEuFin.
|
||||||
|
@ -17,35 +17,34 @@
|
|||||||
/**
|
/**
|
||||||
* Imports.
|
* Imports.
|
||||||
*/
|
*/
|
||||||
|
import {
|
||||||
|
codecForMerchantOrderStatusUnpaid,
|
||||||
|
ConfirmPayResultType,
|
||||||
|
PreparePayResultType,
|
||||||
|
} from "@gnu-taler/taler-util";
|
||||||
|
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||||
|
import axiosImp from "axios";
|
||||||
|
const axios = axiosImp.default;
|
||||||
|
import { URL } from "url";
|
||||||
|
import { defaultCoinConfig } from "../harness/denomStructures.js";
|
||||||
|
import {
|
||||||
|
FaultInjectedExchangeService,
|
||||||
|
FaultInjectedMerchantService,
|
||||||
|
} from "../harness/faultInjection.js";
|
||||||
import {
|
import {
|
||||||
BankService,
|
BankService,
|
||||||
ExchangeService,
|
ExchangeService,
|
||||||
|
getPayto,
|
||||||
GlobalTestState,
|
GlobalTestState,
|
||||||
MerchantPrivateApi,
|
MerchantPrivateApi,
|
||||||
MerchantService,
|
MerchantService,
|
||||||
setupDb,
|
setupDb,
|
||||||
WalletCli,
|
WalletCli,
|
||||||
getPayto
|
|
||||||
} from "../harness/harness.js";
|
} from "../harness/harness.js";
|
||||||
import {
|
import {
|
||||||
withdrawViaBank,
|
|
||||||
createFaultInjectedMerchantTestkudosEnvironment,
|
|
||||||
FaultyMerchantTestEnvironment,
|
FaultyMerchantTestEnvironment,
|
||||||
|
withdrawViaBank,
|
||||||
} from "../harness/helpers.js";
|
} from "../harness/helpers.js";
|
||||||
import {
|
|
||||||
PreparePayResultType,
|
|
||||||
codecForMerchantOrderStatusUnpaid,
|
|
||||||
ConfirmPayResultType,
|
|
||||||
} from "@gnu-taler/taler-util";
|
|
||||||
import axios from "axios";
|
|
||||||
import {
|
|
||||||
FaultInjectedExchangeService,
|
|
||||||
FaultInjectedMerchantService,
|
|
||||||
FaultInjectionRequestContext,
|
|
||||||
} from "../harness/faultInjection";
|
|
||||||
import { defaultCoinConfig } from "../harness/denomStructures";
|
|
||||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
|
||||||
import { URL } from "url";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run a test case with a simple TESTKUDOS Taler environment, consisting
|
* Run a test case with a simple TESTKUDOS Taler environment, consisting
|
||||||
@ -115,7 +114,7 @@ export async function createConfusedMerchantTestkudosEnvironment(
|
|||||||
await merchant.addInstance({
|
await merchant.addInstance({
|
||||||
id: "minst1",
|
id: "minst1",
|
||||||
name: "minst1",
|
name: "minst1",
|
||||||
paytoUris: [getPayto("minst1")]
|
paytoUris: [getPayto("minst1")],
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("setup done!");
|
console.log("setup done!");
|
||||||
@ -141,12 +140,8 @@ export async function createConfusedMerchantTestkudosEnvironment(
|
|||||||
export async function runMerchantExchangeConfusionTest(t: GlobalTestState) {
|
export async function runMerchantExchangeConfusionTest(t: GlobalTestState) {
|
||||||
// Set up test environment
|
// Set up test environment
|
||||||
|
|
||||||
const {
|
const { wallet, bank, faultyExchange, faultyMerchant } =
|
||||||
wallet,
|
await createConfusedMerchantTestkudosEnvironment(t);
|
||||||
bank,
|
|
||||||
faultyExchange,
|
|
||||||
faultyMerchant,
|
|
||||||
} = await createConfusedMerchantTestkudosEnvironment(t);
|
|
||||||
|
|
||||||
// Withdraw digital cash into the wallet.
|
// Withdraw digital cash into the wallet.
|
||||||
|
|
||||||
@ -214,7 +209,10 @@ export async function runMerchantExchangeConfusionTest(t: GlobalTestState) {
|
|||||||
const proposalId = preparePayResp.proposalId;
|
const proposalId = preparePayResp.proposalId;
|
||||||
|
|
||||||
const orderUrlWithHash = new URL(publicOrderStatusUrl);
|
const orderUrlWithHash = new URL(publicOrderStatusUrl);
|
||||||
orderUrlWithHash.searchParams.set("h_contract", preparePayResp.contractTermsHash);
|
orderUrlWithHash.searchParams.set(
|
||||||
|
"h_contract",
|
||||||
|
preparePayResp.contractTermsHash,
|
||||||
|
);
|
||||||
|
|
||||||
console.log("requesting", orderUrlWithHash.href);
|
console.log("requesting", orderUrlWithHash.href);
|
||||||
|
|
||||||
|
@ -18,7 +18,8 @@
|
|||||||
* Imports.
|
* Imports.
|
||||||
*/
|
*/
|
||||||
import { URL } from "@gnu-taler/taler-util";
|
import { URL } from "@gnu-taler/taler-util";
|
||||||
import axios from "axios";
|
import axiosImp from "axios";
|
||||||
|
const axios = axiosImp.default;
|
||||||
import {
|
import {
|
||||||
ExchangeService,
|
ExchangeService,
|
||||||
GlobalTestState,
|
GlobalTestState,
|
||||||
|
@ -18,7 +18,8 @@
|
|||||||
* Imports.
|
* Imports.
|
||||||
*/
|
*/
|
||||||
import { Duration } from "@gnu-taler/taler-util";
|
import { Duration } from "@gnu-taler/taler-util";
|
||||||
import axios from "axios";
|
import axiosImp from "axios";
|
||||||
|
const axios = axiosImp.default;
|
||||||
import {
|
import {
|
||||||
ExchangeService,
|
ExchangeService,
|
||||||
GlobalTestState,
|
GlobalTestState,
|
||||||
|
@ -18,7 +18,8 @@
|
|||||||
* Imports.
|
* Imports.
|
||||||
*/
|
*/
|
||||||
import { URL } from "@gnu-taler/taler-util";
|
import { URL } from "@gnu-taler/taler-util";
|
||||||
import axios from "axios";
|
import axiosImp from "axios";
|
||||||
|
const axios = axiosImp.default;
|
||||||
import {
|
import {
|
||||||
ExchangeService,
|
ExchangeService,
|
||||||
GlobalTestState,
|
GlobalTestState,
|
||||||
|
@ -25,7 +25,8 @@ import {
|
|||||||
ConfirmPayResultType,
|
ConfirmPayResultType,
|
||||||
URL,
|
URL,
|
||||||
} from "@gnu-taler/taler-util";
|
} from "@gnu-taler/taler-util";
|
||||||
import axios from "axios";
|
import axiosImp from "axios";
|
||||||
|
const axios = axiosImp.default;
|
||||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,7 +34,8 @@ import {
|
|||||||
PreparePayResultType,
|
PreparePayResultType,
|
||||||
Duration,
|
Duration,
|
||||||
} from "@gnu-taler/taler-util";
|
} from "@gnu-taler/taler-util";
|
||||||
import axios from "axios";
|
import axiosImp from "axios";
|
||||||
|
const axios = axiosImp.default;
|
||||||
import {
|
import {
|
||||||
WalletApiOperation,
|
WalletApiOperation,
|
||||||
BankServiceHandle,
|
BankServiceHandle,
|
||||||
|
@ -28,8 +28,9 @@ import {
|
|||||||
ConfirmPayResultType,
|
ConfirmPayResultType,
|
||||||
URL,
|
URL,
|
||||||
} from "@gnu-taler/taler-util";
|
} from "@gnu-taler/taler-util";
|
||||||
import axios from "axios";
|
import axiosImp from "axios";
|
||||||
import { FaultInjectionRequestContext } from "../harness/faultInjection";
|
const axios = axiosImp.default;
|
||||||
|
import { FaultInjectionRequestContext } from "../harness/faultInjection.js";
|
||||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -43,12 +44,8 @@ import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
|||||||
export async function runPayPaidTest(t: GlobalTestState) {
|
export async function runPayPaidTest(t: GlobalTestState) {
|
||||||
// Set up test environment
|
// Set up test environment
|
||||||
|
|
||||||
const {
|
const { wallet, bank, faultyExchange, faultyMerchant } =
|
||||||
wallet,
|
await createFaultInjectedMerchantTestkudosEnvironment(t);
|
||||||
bank,
|
|
||||||
faultyExchange,
|
|
||||||
faultyMerchant,
|
|
||||||
} = await createFaultInjectedMerchantTestkudosEnvironment(t);
|
|
||||||
|
|
||||||
// Withdraw digital cash into the wallet.
|
// Withdraw digital cash into the wallet.
|
||||||
|
|
||||||
|
@ -35,9 +35,9 @@ import {
|
|||||||
FaultInjectedExchangeService,
|
FaultInjectedExchangeService,
|
||||||
FaultInjectionRequestContext,
|
FaultInjectionRequestContext,
|
||||||
FaultInjectionResponseContext,
|
FaultInjectionResponseContext,
|
||||||
} from "../harness/faultInjection";
|
} from "../harness/faultInjection.js";
|
||||||
import { CoreApiResponse } from "@gnu-taler/taler-util";
|
import { CoreApiResponse } from "@gnu-taler/taler-util";
|
||||||
import { defaultCoinConfig } from "../harness/denomStructures";
|
import { defaultCoinConfig } from "../harness/denomStructures.js";
|
||||||
import {
|
import {
|
||||||
WalletApiOperation,
|
WalletApiOperation,
|
||||||
BankApi,
|
BankApi,
|
||||||
|
@ -28,7 +28,7 @@ import {
|
|||||||
getPayto
|
getPayto
|
||||||
} from "../harness/harness.js";
|
} from "../harness/harness.js";
|
||||||
import { withdrawViaBank } from "../harness/helpers.js";
|
import { withdrawViaBank } from "../harness/helpers.js";
|
||||||
import { coin_ct10, coin_u1 } from "../harness/denomStructures";
|
import { coin_ct10, coin_u1 } from "../harness/denomStructures.js";
|
||||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||||
|
|
||||||
async function setupTest(
|
async function setupTest(
|
||||||
|
@ -22,11 +22,9 @@ import {
|
|||||||
withdrawViaBank,
|
withdrawViaBank,
|
||||||
createFaultInjectedMerchantTestkudosEnvironment,
|
createFaultInjectedMerchantTestkudosEnvironment,
|
||||||
} from "../harness/helpers.js";
|
} from "../harness/helpers.js";
|
||||||
import axios from "axios";
|
|
||||||
import {
|
import {
|
||||||
FaultInjectionRequestContext,
|
|
||||||
FaultInjectionResponseContext,
|
FaultInjectionResponseContext,
|
||||||
} from "../harness/faultInjection";
|
} from "../harness/faultInjection.js";
|
||||||
import {
|
import {
|
||||||
codecForMerchantOrderStatusUnpaid,
|
codecForMerchantOrderStatusUnpaid,
|
||||||
ConfirmPayResultType,
|
ConfirmPayResultType,
|
||||||
@ -36,6 +34,8 @@ import {
|
|||||||
URL,
|
URL,
|
||||||
} from "@gnu-taler/taler-util";
|
} from "@gnu-taler/taler-util";
|
||||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||||
|
import axiosImp from "axios";
|
||||||
|
const axios = axiosImp.default;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run test for a payment where the merchant has a transient
|
* Run test for a payment where the merchant has a transient
|
||||||
|
@ -18,14 +18,18 @@
|
|||||||
* Imports.
|
* Imports.
|
||||||
*/
|
*/
|
||||||
import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js";
|
import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js";
|
||||||
import { createSimpleTestkudosEnvironment, withdrawViaBank } from "../harness/helpers.js";
|
import {
|
||||||
|
createSimpleTestkudosEnvironment,
|
||||||
|
withdrawViaBank,
|
||||||
|
} from "../harness/helpers.js";
|
||||||
import {
|
import {
|
||||||
PreparePayResultType,
|
PreparePayResultType,
|
||||||
codecForMerchantOrderStatusUnpaid,
|
codecForMerchantOrderStatusUnpaid,
|
||||||
ConfirmPayResultType,
|
ConfirmPayResultType,
|
||||||
URL,
|
URL,
|
||||||
} from "@gnu-taler/taler-util";
|
} from "@gnu-taler/taler-util";
|
||||||
import axios from "axios";
|
import axiosImp from "axios";
|
||||||
|
const axios = axiosImp.default;
|
||||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -34,12 +38,8 @@ import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
|||||||
export async function runPaywallFlowTest(t: GlobalTestState) {
|
export async function runPaywallFlowTest(t: GlobalTestState) {
|
||||||
// Set up test environment
|
// Set up test environment
|
||||||
|
|
||||||
const {
|
const { wallet, bank, exchange, merchant } =
|
||||||
wallet,
|
await createSimpleTestkudosEnvironment(t);
|
||||||
bank,
|
|
||||||
exchange,
|
|
||||||
merchant,
|
|
||||||
} = await createSimpleTestkudosEnvironment(t);
|
|
||||||
|
|
||||||
// Withdraw digital cash into the wallet.
|
// Withdraw digital cash into the wallet.
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* Imports.
|
* Imports.
|
||||||
*/
|
*/
|
||||||
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
|
||||||
import { CoinConfig } from "../harness/denomStructures";
|
import { CoinConfig } from "../harness/denomStructures.js";
|
||||||
import {
|
import {
|
||||||
GlobalTestState,
|
GlobalTestState,
|
||||||
ExchangeService,
|
ExchangeService,
|
||||||
|
@ -27,7 +27,7 @@ import {
|
|||||||
PendingOperationsResponse,
|
PendingOperationsResponse,
|
||||||
WalletApiOperation,
|
WalletApiOperation,
|
||||||
} from "@gnu-taler/taler-wallet-core";
|
} from "@gnu-taler/taler-wallet-core";
|
||||||
import { makeNoFeeCoinConfig } from "../harness/denomStructures";
|
import { makeNoFeeCoinConfig } from "../harness/denomStructures.js";
|
||||||
import {
|
import {
|
||||||
BankService,
|
BankService,
|
||||||
ExchangeService,
|
ExchangeService,
|
||||||
|
@ -24,7 +24,7 @@ import {
|
|||||||
createSimpleTestkudosEnvironment,
|
createSimpleTestkudosEnvironment,
|
||||||
withdrawViaBank,
|
withdrawViaBank,
|
||||||
} from "../harness/helpers.js";
|
} from "../harness/helpers.js";
|
||||||
import { SyncService } from "../harness/sync";
|
import { SyncService } from "../harness/sync.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run test for basic, bank-integrated withdrawal.
|
* Run test for basic, bank-integrated withdrawal.
|
||||||
|
@ -29,7 +29,7 @@ import {
|
|||||||
makeTestPayment,
|
makeTestPayment,
|
||||||
withdrawViaBank,
|
withdrawViaBank,
|
||||||
} from "../harness/helpers.js";
|
} from "../harness/helpers.js";
|
||||||
import { SyncService } from "../harness/sync";
|
import { SyncService } from "../harness/sync.js";
|
||||||
|
|
||||||
export async function runWalletBackupDoublespendTest(t: GlobalTestState) {
|
export async function runWalletBackupDoublespendTest(t: GlobalTestState) {
|
||||||
// Set up test environment
|
// Set up test environment
|
||||||
|
@ -56,7 +56,7 @@ import { runLibeufinSandboxWireTransferCliTest } from "./test-libeufin-sandbox-w
|
|||||||
import { runLibeufinTutorialTest } from "./test-libeufin-tutorial.js";
|
import { runLibeufinTutorialTest } from "./test-libeufin-tutorial.js";
|
||||||
import { runMerchantExchangeConfusionTest } from "./test-merchant-exchange-confusion.js";
|
import { runMerchantExchangeConfusionTest } from "./test-merchant-exchange-confusion.js";
|
||||||
import { runMerchantInstancesTest } from "./test-merchant-instances.js";
|
import { runMerchantInstancesTest } from "./test-merchant-instances.js";
|
||||||
import { runMerchantInstancesDeleteTest } from "./test-merchant-instances-delete";
|
import { runMerchantInstancesDeleteTest } from "./test-merchant-instances-delete.js";
|
||||||
import { runMerchantInstancesUrlsTest } from "./test-merchant-instances-urls.js";
|
import { runMerchantInstancesUrlsTest } from "./test-merchant-instances-urls.js";
|
||||||
import { runMerchantLongpollingTest } from "./test-merchant-longpolling.js";
|
import { runMerchantLongpollingTest } from "./test-merchant-longpolling.js";
|
||||||
import { runMerchantRefundApiTest } from "./test-merchant-refund-api.js";
|
import { runMerchantRefundApiTest } from "./test-merchant-refund-api.js";
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"composite": true,
|
"composite": true,
|
||||||
"target": "ES2018",
|
"target": "ES2018",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "Node16",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"lib": ["es6"],
|
"lib": ["es6"],
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
"author": "Florian Dold",
|
"author": "Florian Dold",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "tsc && rollup -c",
|
"prepare": "tsc",
|
||||||
"compile": "tsc && rollup -c",
|
"compile": "tsc",
|
||||||
"pretty": "prettier --write src",
|
"pretty": "prettier --write src",
|
||||||
"test": "tsc && ava",
|
"test": "tsc && ava",
|
||||||
"coverage": "tsc && c8 --src src --all ava",
|
"coverage": "tsc && c8 --src src --all ava",
|
||||||
@ -29,14 +29,15 @@
|
|||||||
"src/",
|
"src/",
|
||||||
"lib/"
|
"lib/"
|
||||||
],
|
],
|
||||||
"main": "./dist/taler-wallet-core.js",
|
|
||||||
"browser": {
|
|
||||||
"./dist/taler-wallet-core.js": "./dist/taler-wallet-core.browser.js",
|
|
||||||
"./lib/index.node.js": "./lib/index.browser.js"
|
|
||||||
},
|
|
||||||
"module": "./lib/index.node.js",
|
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"types": "./lib/index.node.d.ts",
|
"types": "./lib/index.node.d.ts",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"browser": "./lib/index.browser.js",
|
||||||
|
"node": "./lib/index.node.js",
|
||||||
|
"default": "./lib/index.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@ava/typescript": "^3.0.1",
|
"@ava/typescript": "^3.0.1",
|
||||||
"@gnu-taler/pogen": "workspace:*",
|
"@gnu-taler/pogen": "workspace:*",
|
||||||
@ -54,8 +55,6 @@
|
|||||||
"po2json": "^0.4.5",
|
"po2json": "^0.4.5",
|
||||||
"prettier": "^2.5.1",
|
"prettier": "^2.5.1",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"rollup": "^2.79.0",
|
|
||||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
||||||
"source-map-resolve": "^0.6.0",
|
"source-map-resolve": "^0.6.0",
|
||||||
"typedoc": "^0.23.16",
|
"typedoc": "^0.23.16",
|
||||||
"typescript": "^4.8.4"
|
"typescript": "^4.8.4"
|
||||||
|
@ -27,7 +27,7 @@ import {
|
|||||||
HttpResponse,
|
HttpResponse,
|
||||||
} from "../util/http.js";
|
} from "../util/http.js";
|
||||||
import { RequestThrottler } from "@gnu-taler/taler-util";
|
import { RequestThrottler } from "@gnu-taler/taler-util";
|
||||||
import Axios, { AxiosResponse } from "axios";
|
import axios, { AxiosResponse } from "axios";
|
||||||
import { TalerError } from "../errors.js";
|
import { TalerError } from "../errors.js";
|
||||||
import { Logger, bytesToString } from "@gnu-taler/taler-util";
|
import { Logger, bytesToString } from "@gnu-taler/taler-util";
|
||||||
import { TalerErrorCode, URL } from "@gnu-taler/taler-util";
|
import { TalerErrorCode, URL } from "@gnu-taler/taler-util";
|
||||||
@ -75,7 +75,7 @@ export class NodeHttpLib implements HttpRequestLibrary {
|
|||||||
// FIXME: Use AbortController / etc. to handle cancellation
|
// FIXME: Use AbortController / etc. to handle cancellation
|
||||||
let resp: AxiosResponse;
|
let resp: AxiosResponse;
|
||||||
try {
|
try {
|
||||||
let respPromise = Axios({
|
let respPromise = axios.default({
|
||||||
method,
|
method,
|
||||||
url: url,
|
url: url,
|
||||||
responseType: "arraybuffer",
|
responseType: "arraybuffer",
|
||||||
|
@ -29,7 +29,7 @@ import {
|
|||||||
MemoryBackend,
|
MemoryBackend,
|
||||||
shimIndexedDB,
|
shimIndexedDB,
|
||||||
} from "@gnu-taler/idb-bridge";
|
} from "@gnu-taler/idb-bridge";
|
||||||
import { AccessStats } from "@gnu-taler/idb-bridge/src/MemoryBackend";
|
import { AccessStats } from "@gnu-taler/idb-bridge";
|
||||||
import { Logger, WalletNotification } from "@gnu-taler/taler-util";
|
import { Logger, WalletNotification } from "@gnu-taler/taler-util";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { NodeThreadCryptoWorkerFactory } from "../crypto/workers/nodeThreadWorker.js";
|
import { NodeThreadCryptoWorkerFactory } from "../crypto/workers/nodeThreadWorker.js";
|
||||||
|
@ -61,6 +61,7 @@ export {
|
|||||||
nativeCryptoR,
|
nativeCryptoR,
|
||||||
nativeCrypto,
|
nativeCrypto,
|
||||||
nullCrypto,
|
nullCrypto,
|
||||||
|
TalerCryptoInterface,
|
||||||
} from "./crypto/cryptoImplementation.js";
|
} from "./crypto/cryptoImplementation.js";
|
||||||
|
|
||||||
export * from "./util/timer.js";
|
export * from "./util/timer.js";
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"declarationMap": false,
|
"declarationMap": false,
|
||||||
"target": "ES2017",
|
"target": "ES2017",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "Node16",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"lib": ["es6"],
|
"lib": ["es6"],
|
||||||
"types": ["node"],
|
"types": ["node"],
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
"main": "dist/taler-wallet-embedded.js",
|
"main": "dist/taler-wallet-embedded.js",
|
||||||
"author": "Florian Dold",
|
"author": "Florian Dold",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"compile": "tsc && rollup -c",
|
"compile": "tsc && rollup -c",
|
||||||
"pretty": "prettier --write src",
|
"pretty": "prettier --write src",
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"declarationMap": true,
|
"declarationMap": true,
|
||||||
"target": "ES6",
|
"target": "ES6",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "Node16",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"lib": ["es6"],
|
"lib": ["es6"],
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
|
Loading…
Reference in New Issue
Block a user