rename to corebank API

This commit is contained in:
Florian Dold 2023-10-06 14:42:32 +02:00
parent 851b2da39c
commit 97d7be7503
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
30 changed files with 54 additions and 54 deletions

View File

@ -98,7 +98,7 @@ export async function runBench1(configJson: any): Promise<void> {
await wallet.client.call(WalletApiOperation.WithdrawTestBalance, {
amount: b1conf.currency + ":" + withdrawAmount,
bankAccessApiBaseUrl: b1conf.bank,
corebankApiBaseUrl: b1conf.bank,
exchangeBaseUrl: b1conf.exchange,
});

View File

@ -109,7 +109,7 @@ export async function runBench3(configJson: any): Promise<void> {
await wallet.client.call(WalletApiOperation.WithdrawTestBalance, {
amount: b3conf.currency + ":" + withdrawAmount,
bankAccessApiBaseUrl: b3conf.bank,
corebankApiBaseUrl: b3conf.bank,
exchangeBaseUrl: b3conf.exchange,
});

View File

@ -650,7 +650,7 @@ export class FakebankService
return `http://localhost:${this.bankConfig.httpPort}/`;
}
get bankAccessApiBaseUrl(): string {
get corebankApiBaseUrl(): string {
return this.baseUrl;
}
@ -691,7 +691,7 @@ export class FakebankService
"bank",
);
await this.pingUntilAvailable();
const bankClient = new TalerCorebankApiClient(this.bankAccessApiBaseUrl);
const bankClient = new TalerCorebankApiClient(this.corebankApiBaseUrl);
for (const acc of this.accounts) {
await bankClient.registerAccount(acc.accountName, acc.accountPassword);
}
@ -798,7 +798,7 @@ export class LibeufinBankService
return `http://localhost:${this.bankConfig.httpPort}/`;
}
get bankAccessApiBaseUrl(): string {
get corebankApiBaseUrl(): string {
return this.baseUrl;
}
@ -825,7 +825,7 @@ export class LibeufinBankService
"libeufin-bank-httpd",
);
await this.pingUntilAvailable();
const bankClient = new TalerCorebankApiClient(this.bankAccessApiBaseUrl);
const bankClient = new TalerCorebankApiClient(this.corebankApiBaseUrl);
for (const acc of this.accounts) {
await bankClient.registerAccount(acc.accountName, acc.accountPassword);
}
@ -841,7 +841,7 @@ export class LibeufinBankService
const useLibeufinBank = false;
export interface BankServiceHandle {
readonly bankAccessApiBaseUrl: string;
readonly corebankApiBaseUrl: string;
readonly http: HttpRequestLibrary;
}

View File

@ -560,7 +560,7 @@ export async function withdrawViaBankV2(
): Promise<WithdrawViaBankResult> {
const { walletClient: wallet, bank, exchange, amount } = p;
const bankClient = new TalerCorebankApiClient(bank.bankAccessApiBaseUrl);
const bankClient = new TalerCorebankApiClient(bank.corebankApiBaseUrl);
const user = await bankClient.createRandomBankUser();
const wop = await bankClient.createWithdrawalOperation(user.username, amount);

View File

@ -312,7 +312,7 @@ deploymentCli
const exchangeInfo = await downloadExchangeInfo(exchangeBaseUrl, http);
await topupReserveWithDemobank({
amount: "KUDOS:10",
bankAccessApiBaseUrl:
corebankApiBaseUrl:
"https://bank.demo.taler.net/",
exchangeInfo,
http,
@ -341,7 +341,7 @@ deploymentCli
const exchangeInfo = await downloadExchangeInfo(exchangeBaseUrl, http);
await topupReserveWithDemobank({
amount: "TESTKUDOS:10",
bankAccessApiBaseUrl:
corebankApiBaseUrl:
"https://bank.test.taler.net/",
exchangeInfo,
http,
@ -371,7 +371,7 @@ deploymentCli
const exchangeInfo = await downloadExchangeInfo(exchangeBaseUrl, http);
await topupReserveWithDemobank({
amount: "TESTKUDOS:10",
bankAccessApiBaseUrl: "http://localhost:8082/taler-bank-access/",
corebankApiBaseUrl: "http://localhost:8082/taler-bank-access/",
exchangeInfo,
http,
reservePub: reserveKeyPair.pub,

View File

@ -179,7 +179,7 @@ export async function runAgeRestrictionsMerchantTest(t: GlobalTestState) {
// Pay with coin from tipping
{
const bankClient = new TalerCorebankApiClient(bank.bankAccessApiBaseUrl);
const bankClient = new TalerCorebankApiClient(bank.corebankApiBaseUrl);
const mbu = await bankClient.createRandomBankUser();
const tipReserveResp = await merchantClient.createTippingReserve({
exchange_url: exchange.baseUrl,

View File

@ -99,7 +99,7 @@ export async function runBankApiTest(t: GlobalTestState) {
console.log("setup done!");
const bankClient = new TalerCorebankApiClient(bank.bankAccessApiBaseUrl);
const bankClient = new TalerCorebankApiClient(bank.corebankApiBaseUrl);
const bankUser = await bankClient.registerAccount("user1", "pw1");

View File

@ -66,7 +66,7 @@ export async function runExchangeDepositTest(t: GlobalTestState) {
await topupReserveWithDemobank({
http,
amount: "TESTKUDOS:10",
bankAccessApiBaseUrl: bank.bankAccessApiBaseUrl,
corebankApiBaseUrl: bank.corebankApiBaseUrl,
exchangeInfo,
reservePub: reserveKeyPair.pub,
});

View File

@ -263,7 +263,7 @@ export async function runExchangeManagementTest(
// Create withdrawal operation
const bankClient = new TalerCorebankApiClient(bank.bankAccessApiBaseUrl);
const bankClient = new TalerCorebankApiClient(bank.corebankApiBaseUrl);
const user = await bankClient.createRandomBankUser();
const wop = await bankClient.createWithdrawalOperation(

View File

@ -79,7 +79,7 @@ export async function runExchangePurseTest(t: GlobalTestState) {
amount: "TESTKUDOS:10",
http,
reservePub: reserveKeyPair.pub,
bankAccessApiBaseUrl: bank.bankAccessApiBaseUrl,
corebankApiBaseUrl: bank.corebankApiBaseUrl,
exchangeInfo,
});

View File

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

View File

@ -302,7 +302,7 @@ export async function runKycTest(t: GlobalTestState) {
// Withdraw digital cash into the wallet.
const bankClient = new TalerCorebankApiClient(bank.bankAccessApiBaseUrl);
const bankClient = new TalerCorebankApiClient(bank.corebankApiBaseUrl);
const amount = "TESTKUDOS:20";
const user = await bankClient.createRandomBankUser();

View File

@ -126,7 +126,7 @@ export async function runLibeufinBankTest(t: GlobalTestState) {
console.log("setup done!");
const bankClient = new TalerCorebankApiClient(bank.bankAccessApiBaseUrl);
const bankClient = new TalerCorebankApiClient(bank.corebankApiBaseUrl);
// register exchange bank account
await bankClient.registerAccountExtended({

View File

@ -127,7 +127,7 @@ export async function runPaymentFaultTest(t: GlobalTestState) {
// Create withdrawal operation
const bankClient = new TalerCorebankApiClient(bank.bankAccessApiBaseUrl);
const bankClient = new TalerCorebankApiClient(bank.corebankApiBaseUrl);
const user = await bankClient.createRandomBankUser();
const wop = await bankClient.createWithdrawalOperation(

View File

@ -39,7 +39,7 @@ export async function runTippingTest(t: GlobalTestState) {
await createSimpleTestkudosEnvironmentV2(t);
const bankAccessApiClient = new TalerCorebankApiClient(
bank.bankAccessApiBaseUrl,
bank.corebankApiBaseUrl,
);
const mbu = await bankAccessApiClient.createRandomBankUser();

View File

@ -72,7 +72,7 @@ export async function runWalletDblessTest(t: GlobalTestState) {
amount: "TESTKUDOS:10",
http,
reservePub: reserveKeyPair.pub,
bankAccessApiBaseUrl: bank.bankAccessApiBaseUrl,
corebankApiBaseUrl: bank.corebankApiBaseUrl,
exchangeInfo,
});

View File

@ -122,7 +122,7 @@ export async function runWalletNotificationsTest(t: GlobalTestState) {
});
const bankAccessApiClient = new TalerCorebankApiClient(
bank.bankAccessApiBaseUrl,
bank.corebankApiBaseUrl,
);
const user = await bankAccessApiClient.createRandomBankUser();
bankAccessApiClient.setAuth(user);

View File

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

View File

@ -34,7 +34,7 @@ export async function runWithdrawalAbortBankTest(t: GlobalTestState) {
// Create a withdrawal operation
const bankAccessApiClient = new TalerCorebankApiClient(
bank.bankAccessApiBaseUrl,
bank.corebankApiBaseUrl,
);
const user = await bankAccessApiClient.createRandomBankUser();
bankAccessApiClient.setAuth(user);

View File

@ -42,7 +42,7 @@ export async function runWithdrawalBankIntegratedTest(t: GlobalTestState) {
// Create a withdrawal operation
const corebankApiClient = new TalerCorebankApiClient(
bank.bankAccessApiBaseUrl,
bank.corebankApiBaseUrl,
);
const user = await corebankApiClient.createRandomBankUser();
corebankApiClient.setAuth(user);

View File

@ -80,7 +80,7 @@ export async function runWithdrawalFakebankTest(t: GlobalTestState) {
});
await wallet.client.call(WalletApiOperation.WithdrawTestBalance, {
bankAccessApiBaseUrl: bank.bankAccessApiBaseUrl,
corebankApiBaseUrl: bank.corebankApiBaseUrl,
exchangeBaseUrl: exchange.baseUrl,
amount: "TESTKUDOS:10",
});

View File

@ -108,7 +108,7 @@ export async function runWithdrawalFeesTest(t: GlobalTestState) {
const amount = "TESTKUDOS:7.5";
const bankAccessApiClient = new TalerCorebankApiClient(
bank.bankAccessApiBaseUrl,
bank.corebankApiBaseUrl,
);
const user = await bankAccessApiClient.createRandomBankUser();
bankAccessApiClient.setAuth(user);

View File

@ -102,7 +102,7 @@ export async function runWithdrawalHugeTest(t: GlobalTestState) {
await wallet.client.call(WalletApiOperation.WithdrawTestBalance, {
exchangeBaseUrl: exchange.baseUrl,
amount: "TESTKUDOS:10000",
bankAccessApiBaseUrl: bank.baseUrl,
corebankApiBaseUrl: bank.baseUrl,
});
await withdrawalFinishedCond;

View File

@ -42,7 +42,7 @@ export async function runWithdrawalManualTest(t: GlobalTestState) {
// Create a withdrawal operation
const bankAccessApiClient = new TalerCorebankApiClient(
bank.bankAccessApiBaseUrl,
bank.corebankApiBaseUrl,
);
const user = await bankAccessApiClient.createRandomBankUser();

View File

@ -1556,7 +1556,7 @@ export const codecForTestPayArgs = (): Codec<TestPayArgs> =>
export interface IntegrationTestArgs {
exchangeBaseUrl: string;
bankAccessApiBaseUrl: string;
corebankApiBaseUrl: string;
merchantBaseUrl: string;
merchantAuthToken?: string;
amountToWithdraw: string;
@ -1570,12 +1570,12 @@ export const codecForIntegrationTestArgs = (): Codec<IntegrationTestArgs> =>
.property("merchantAuthToken", codecOptional(codecForString()))
.property("amountToSpend", codecForAmountString())
.property("amountToWithdraw", codecForAmountString())
.property("bankAccessApiBaseUrl", codecForAmountString())
.property("corebankApiBaseUrl", codecForAmountString())
.build("IntegrationTestArgs");
export interface IntegrationTestV2Args {
exchangeBaseUrl: string;
bankAccessApiBaseUrl: string;
corebankApiBaseUrl: string;
merchantBaseUrl: string;
merchantAuthToken?: string;
}
@ -1585,7 +1585,7 @@ export const codecForIntegrationTestV2Args = (): Codec<IntegrationTestV2Args> =>
.property("exchangeBaseUrl", codecForString())
.property("merchantBaseUrl", codecForString())
.property("merchantAuthToken", codecOptional(codecForString()))
.property("bankAccessApiBaseUrl", codecForAmountString())
.property("corebankApiBaseUrl", codecForAmountString())
.build("IntegrationTestV2Args");
export interface AddExchangeRequest {
@ -1861,9 +1861,9 @@ export interface CoreApiResponseError {
export interface WithdrawTestBalanceRequest {
amount: string;
/**
* Bank access API base URL.
* Corebank API base URL.
*/
bankAccessApiBaseUrl: string;
corebankApiBaseUrl: string;
exchangeBaseUrl: string;
forcedDenomSel?: ForcedDenomSel;
}
@ -1936,7 +1936,7 @@ export const codecForWithdrawTestBalance =
.property("amount", codecForString())
.property("exchangeBaseUrl", codecForString())
.property("forcedDenomSel", codecForAny())
.property("bankAccessApiBaseUrl", codecForString())
.property("corebankApiBaseUrl", codecForString())
.build("WithdrawTestBalanceRequest");
export interface SetCoinSuspendedRequest {

View File

@ -1280,7 +1280,7 @@ advancedCli
await wallet.client.call(WalletApiOperation.RunIntegrationTest, {
amountToSpend: "TESTKUDOS:1",
amountToWithdraw: "TESTKUDOS:3",
bankAccessApiBaseUrl: "http://localhost:8082/taler-bank-access/",
corebankApiBaseUrl: "http://localhost:8082/taler-bank-access/",
exchangeBaseUrl: "http://localhost:8081/",
merchantBaseUrl: "http://localhost:8083/",
});
@ -1507,7 +1507,7 @@ testCli.subcommand("withdrawKudos", "withdraw-kudos").action(async (args) => {
await withWallet(args, async (wallet) => {
await wallet.client.call(WalletApiOperation.WithdrawTestBalance, {
amount: "KUDOS:50",
bankAccessApiBaseUrl:
corebankApiBaseUrl:
"https://bank.demo.taler.net/",
exchangeBaseUrl: "https://exchange.demo.taler.net/",
});

View File

@ -109,7 +109,7 @@ export async function checkReserve(
export interface TopupReserveWithDemobankArgs {
http: HttpRequestLibrary;
reservePub: string;
bankAccessApiBaseUrl: string;
corebankApiBaseUrl: string;
exchangeInfo: ExchangeInfo;
amount: AmountString;
}
@ -117,8 +117,8 @@ export interface TopupReserveWithDemobankArgs {
export async function topupReserveWithDemobank(
args: TopupReserveWithDemobankArgs,
) {
const { http, bankAccessApiBaseUrl, amount, exchangeInfo, reservePub } = args;
const bankClient = new TalerCorebankApiClient(bankAccessApiBaseUrl);
const { http, corebankApiBaseUrl, amount, exchangeInfo, reservePub } = args;
const bankClient = new TalerCorebankApiClient(corebankApiBaseUrl);
const bankUser = await bankClient.createRandomBankUser();
const wopi = await bankClient.createWithdrawalOperation(
bankUser.username,

View File

@ -102,13 +102,13 @@ export async function withdrawTestBalance(
): Promise<void> {
const amount = req.amount;
const exchangeBaseUrl = req.exchangeBaseUrl;
const bankAccessApiBaseUrl = req.bankAccessApiBaseUrl;
const corebankApiBaseUrl = req.corebankApiBaseUrl;
logger.trace(
`Registering bank user, bank access base url ${bankAccessApiBaseUrl}`,
`Registering bank user, bank access base url ${corebankApiBaseUrl}`,
);
const corebankClient = new TalerCorebankApiClient(bankAccessApiBaseUrl);
const corebankClient = new TalerCorebankApiClient(corebankApiBaseUrl);
const bankUser = await corebankClient.createRandomBankUser();
logger.trace(`Registered bank user ${JSON.stringify(bankUser)}`);
@ -287,7 +287,7 @@ export async function runIntegrationTest(
logger.info("withdrawing test balance");
await withdrawTestBalance(ws, {
amount: args.amountToWithdraw,
bankAccessApiBaseUrl: args.bankAccessApiBaseUrl,
corebankApiBaseUrl: args.corebankApiBaseUrl,
exchangeBaseUrl: args.exchangeBaseUrl,
});
await waitUntilDone(ws);
@ -315,7 +315,7 @@ export async function runIntegrationTest(
await withdrawTestBalance(ws, {
amount: Amounts.stringify(withdrawAmountTwo),
bankAccessApiBaseUrl: args.bankAccessApiBaseUrl,
corebankApiBaseUrl: args.corebankApiBaseUrl,
exchangeBaseUrl: args.exchangeBaseUrl,
});
@ -557,7 +557,7 @@ export async function runIntegrationTest2(
logger.info("withdrawing test balance");
await withdrawTestBalance(ws, {
amount: Amounts.stringify(amountToWithdraw),
bankAccessApiBaseUrl: args.bankAccessApiBaseUrl,
corebankApiBaseUrl: args.corebankApiBaseUrl,
exchangeBaseUrl: args.exchangeBaseUrl,
});
await waitUntilDone(ws);
@ -590,7 +590,7 @@ export async function runIntegrationTest2(
await withdrawTestBalance(ws, {
amount: Amounts.stringify(withdrawAmountTwo),
bankAccessApiBaseUrl: args.bankAccessApiBaseUrl,
corebankApiBaseUrl: args.corebankApiBaseUrl,
exchangeBaseUrl: args.exchangeBaseUrl,
});

View File

@ -1073,7 +1073,7 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>(
case WalletApiOperation.WithdrawTestkudos: {
await withdrawTestBalance(ws, {
amount: "TESTKUDOS:10",
bankAccessApiBaseUrl: "https://bank.test.taler.net/",
corebankApiBaseUrl: "https://bank.test.taler.net/",
exchangeBaseUrl: "https://exchange.test.taler.net/",
});
return {

View File

@ -278,7 +278,7 @@ export async function testWithGv() {
await w.wallet.client.call(WalletApiOperation.RunIntegrationTest, {
amountToSpend: "KUDOS:1",
amountToWithdraw: "KUDOS:3",
bankAccessApiBaseUrl:
corebankApiBaseUrl:
"https://bank.demo.taler.net/",
exchangeBaseUrl: "https://exchange.demo.taler.net/",
merchantBaseUrl: "https://backend.demo.taler.net/",
@ -306,7 +306,7 @@ export async function testWithLocal(path: string) {
await w.wallet.client.call(WalletApiOperation.RunIntegrationTest, {
amountToSpend: "TESTKUDOS:1",
amountToWithdraw: "TESTKUDOS:3",
bankAccessApiBaseUrl: "http://localhost:8082/taler-bank-access/",
corebankApiBaseUrl: "http://localhost:8082/taler-bank-access/",
exchangeBaseUrl: "http://localhost:8081/",
merchantBaseUrl: "http://localhost:8083/",
});