wallet-core: fix withdrawTestBalance command

This commit is contained in:
Florian Dold 2022-09-13 17:41:47 +02:00
parent 676ae5102b
commit 962bfde214
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
2 changed files with 7 additions and 9 deletions

View File

@ -1166,7 +1166,7 @@ export interface WithdrawTestBalanceRequest {
/**
* Bank access API base URL. Defaults to the bankBaseUrl.
*/
bankAccessApiBaseUrl: string;
bankAccessApiBaseUrl?: string;
exchangeBaseUrl: string;
forcedDenomSel?: ForcedDenomSel;
}
@ -1245,7 +1245,7 @@ export const codecForWithdrawTestBalance =
.property("bankBaseUrl", codecForString())
.property("exchangeBaseUrl", codecForString())
.property("forcedDenomSel", codecForAny())
.property("bankAccessApiBaseUrl", codecForString())
.property("bankAccessApiBaseUrl", codecOptional(codecForString()))
.build("WithdrawTestBalanceRequest");
export interface ApplyRefundResponse {

View File

@ -92,19 +92,17 @@ export async function withdrawTestBalance(
): Promise<void> {
const amount = req.amount;
const exchangeBaseUrl = req.exchangeBaseUrl;
const bankAccessApiBaseUrl = req.bankAccessApiBaseUrl ?? req.bankBaseUrl;
logger.trace(
`Registered bank user, bank access base url ${req.bankAccessApiBaseUrl}`,
);
const bankUser = await registerRandomBankUser(
ws.http,
req.bankAccessApiBaseUrl,
`Registered bank user, bank access base url ${bankAccessApiBaseUrl}`,
);
const bankUser = await registerRandomBankUser(ws.http, bankAccessApiBaseUrl);
logger.trace(`Registered bank user ${JSON.stringify(bankUser)}`);
const wresp = await createDemoBankWithdrawalUri(
ws.http,
req.bankAccessApiBaseUrl,
bankAccessApiBaseUrl,
bankUser,
amount,
);
@ -117,7 +115,7 @@ export async function withdrawTestBalance(
await confirmBankWithdrawalUri(
ws.http,
req.bankAccessApiBaseUrl,
bankAccessApiBaseUrl,
bankUser,
wresp.withdrawal_id,
);