-fix harness type errors

This commit is contained in:
Florian Dold 2023-04-21 22:46:04 +02:00
parent e81ae0f3e5
commit e331012c9f
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
8 changed files with 27 additions and 16 deletions

View File

@ -18,6 +18,7 @@
"scripts": {
"compile": "./build.mjs",
"check": "tsc",
"test": "tsc",
"clean": "rimraf lib dist tsconfig.tsbuildinfo",
"pretty": "prettier --write src"
},
@ -42,4 +43,4 @@
"axios": "^0.27.2",
"tslib": "^2.4.0"
}
}
}

View File

@ -86,13 +86,17 @@ export async function runBench1(configJson: any): Promise<void> {
// No persistent DB storage.
persistentStoragePath: undefined,
httpLib: myHttpLib,
config: {
testing: {
insecureTrustExchange: trustExchange,
},
features: {
batchWithdrawal,
}
}
});
wallet = res.wallet;
getDbStats = res.getDbStats;
if (trustExchange) {
wallet.setInsecureTrustExchange();
}
wallet.setBatchWithdrawal(batchWithdrawal);
await wallet.client.call(WalletApiOperation.InitWallet, {});
}

View File

@ -94,13 +94,17 @@ export async function runBench3(configJson: any): Promise<void> {
// No persistent DB storage.
persistentStoragePath: undefined,
httpLib: myHttpLib,
config: {
features: {
batchWithdrawal: batchWithdrawal,
},
testing: {
insecureTrustExchange: trustExchange,
},
},
});
wallet = res.wallet;
getDbStats = res.getDbStats;
if (trustExchange) {
wallet.setInsecureTrustExchange();
}
wallet.setBatchWithdrawal(batchWithdrawal);
await wallet.client.call(WalletApiOperation.InitWallet, {});
}

View File

@ -19,7 +19,6 @@
*/
import { AbsoluteTime, Duration } from "@gnu-taler/taler-util";
import {
getDefaultNodeWallet2,
WalletApiOperation,
} from "@gnu-taler/taler-wallet-core";
import { defaultCoinConfig } from "../harness/denomStructures.js";
@ -27,7 +26,6 @@ import { GlobalTestState, WalletCli } from "../harness/harness.js";
import {
createSimpleTestkudosEnvironment,
withdrawViaBank,
makeTestPayment,
} from "../harness/helpers.js";
/**

View File

@ -38,7 +38,6 @@ export async function runForcedSelectionTest(t: GlobalTestState) {
await wallet.client.call(WalletApiOperation.WithdrawTestBalance, {
exchangeBaseUrl: exchange.baseUrl,
amount: "TESTKUDOS:10",
bankBaseUrl: bank.baseUrl,
bankAccessApiBaseUrl: bank.bankAccessApiBaseUrl,
forcedDenomSel: {
denoms: [

View File

@ -120,7 +120,6 @@ export async function runWallettestingTest(t: GlobalTestState) {
await wallet.client.call(WalletApiOperation.RunIntegrationTest, {
amountToSpend: "TESTKUDOS:5",
amountToWithdraw: "TESTKUDOS:10",
bankBaseUrl: bank.baseUrl,
bankAccessApiBaseUrl: bank.bankAccessApiBaseUrl,
exchangeBaseUrl: exchange.baseUrl,
merchantAuthToken: merchantAuthToken,
@ -144,7 +143,6 @@ export async function runWallettestingTest(t: GlobalTestState) {
await wallet.client.call(WalletApiOperation.WithdrawTestBalance, {
amount: "TESTKUDOS:10",
bankBaseUrl: bank.baseUrl,
bankAccessApiBaseUrl: bank.bankAccessApiBaseUrl,
exchangeBaseUrl: exchange.baseUrl,
});
@ -170,7 +168,6 @@ export async function runWallettestingTest(t: GlobalTestState) {
await wallet.client.call(WalletApiOperation.WithdrawTestBalance, {
amount: "TESTKUDOS:10",
bankBaseUrl: bank.baseUrl,
bankAccessApiBaseUrl: bank.bankAccessApiBaseUrl,
exchangeBaseUrl: exchange.baseUrl,
});

View File

@ -57,6 +57,9 @@ export interface BankAccountBalanceResponse {
}
export interface BankServiceHandle {
/**
* @deprecated
*/
readonly baseUrl: string;
readonly bankAccessApiBaseUrl: string;
readonly http: HttpRequestLibrary;

View File

@ -205,11 +205,16 @@ export async function withdrawCoin(args: {
};
}
export interface FindDenomOptions {
denomselAllowLate?: boolean;
}
export function findDenomOrThrow(
denomselAllowLate: boolean,
exchangeInfo: ExchangeInfo,
amount: AmountString,
options: FindDenomOptions = {},
): DenominationRecord {
const denomselAllowLate = options.denomselAllowLate ?? false;
for (const d of exchangeInfo.keys.currentDenominations) {
const value: AmountJson = {
currency: d.currency,