-harness fixes for kyc

This commit is contained in:
Florian Dold 2022-11-01 17:52:51 +01:00
parent 504d9f09b4
commit aab3f917c4
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
9 changed files with 15 additions and 39 deletions

View File

@ -1104,7 +1104,6 @@ export interface BackupExchangeGlobalFees {
purseFee: BackupAmountString;
historyTimeout: TalerProtocolDuration;
kycTimeout: TalerProtocolDuration;
purseTimeout: TalerProtocolDuration;
purseLimit: number;

View File

@ -772,11 +772,6 @@ export interface GlobalFees {
// What date (exclusive) does this fees stop going into effect?
end_date: TalerProtocolTimestamp;
// KYC fee, charged when a user wants to create an account.
// The first year of the account_annual_fee after the KYC is
// always included.
kyc_fee: AmountString;
// Account history fee, charged when a user wants to
// obtain a reserve/account history.
history_fee: AmountString;
@ -798,13 +793,6 @@ export interface GlobalFees {
// retain the account history for legal reasons until this time.
history_expiration: TalerProtocolDuration;
// How long does the exchange promise to keep funds
// an account for which the KYC has never happened
// after a purse was merged into an account? Basically,
// after this time funds in an account without KYC are
// forfeit.
account_kyc_timeout: TalerProtocolDuration;
// Non-negative number of concurrent purses that any
// account holder is allowed to create without having
// to pay the purse_fee.
@ -828,8 +816,6 @@ export class WireFeesJson {
*/
wire_fee: string;
wad_fee: string;
/**
* Cost of clising a reserve.
*/
@ -1395,12 +1381,10 @@ export const codecForGlobalFees = (): Codec<GlobalFees> =>
buildCodecForObject<GlobalFees>()
.property("start_date", codecForTimestamp)
.property("end_date", codecForTimestamp)
.property("kyc_fee", codecForAmountString())
.property("history_fee", codecForAmountString())
.property("account_fee", codecForAmountString())
.property("purse_fee", codecForAmountString())
.property("history_expiration", codecForDuration)
.property("account_kyc_timeout", codecForDuration)
.property("purse_account_limit", codecForNumber())
.property("purse_timeout", codecForDuration)
.property("master_sig", codecForString())
@ -1423,7 +1407,6 @@ export const codecForWireFeesJson = (): Codec<WireFeesJson> =>
buildCodecForObject<WireFeesJson>()
.property("wire_fee", codecForString())
.property("closing_fee", codecForString())
.property("wad_fee", codecForString())
.property("sig", codecForString())
.property("start_date", codecForTimestamp)
.property("end_date", codecForTimestamp)

View File

@ -766,7 +766,6 @@ export interface ExchangeGlobalFees {
purseFee: AmountJson;
historyTimeout: TalerProtocolDuration;
kycTimeout: TalerProtocolDuration;
purseTimeout: TalerProtocolDuration;
purseLimit: number;

View File

@ -486,7 +486,7 @@ class BankServiceBase {
protected globalTestState: GlobalTestState,
protected bankConfig: BankConfig,
protected configFile: string,
) { }
) {}
}
/**
@ -780,7 +780,8 @@ class LibEuFinBankService extends BankServiceBase implements BankServiceHandle {
*/
export class FakebankService
extends BankServiceBase
implements BankServiceHandle {
implements BankServiceHandle
{
proc: ProcessWrapper | undefined;
http = new NodeHttpLib();
@ -1131,7 +1132,7 @@ export class ExchangeService implements ExchangeServiceInterface {
private exchangeConfig: ExchangeConfig,
private configFilename: string,
private keyPair: EddsaKeyPair,
) { }
) {}
get name() {
return this.exchangeConfig.name;
@ -1228,11 +1229,14 @@ export class ExchangeService implements ExchangeServiceInterface {
"-c",
this.configFilename,
"wire-fee",
// Year
`${i}`,
// Wire method
accTargetType,
// Wire fee
`${this.exchangeConfig.currency}:0.01`,
`${this.exchangeConfig.currency}:0.01`,
`${this.exchangeConfig.currency}:0.01`,
// Closing fee
`${this.exchangeConfig.currency}:0.01`,
"upload",
],
);
@ -1251,16 +1255,12 @@ export class ExchangeService implements ExchangeServiceInterface {
"now",
// history fee
`${this.exchangeConfig.currency}:0.01`,
// kyc fee
`${this.exchangeConfig.currency}:0.01`,
// account fee
`${this.exchangeConfig.currency}:0.01`,
// purse fee
`${this.exchangeConfig.currency}:0.00`,
// purse timeout
"1h",
// kyc timeout
"1h",
// history expiration
"1year",
// free purses per account
@ -1384,7 +1384,7 @@ export class MerchantApiClient {
constructor(
private baseUrl: string,
public readonly auth: MerchantAuthConfiguration,
) { }
) {}
async changeAuth(auth: MerchantAuthConfiguration): Promise<void> {
const url = new URL("private/auth", this.baseUrl);
@ -1577,7 +1577,7 @@ export class MerchantService implements MerchantServiceInterface {
private globalState: GlobalTestState,
private merchantConfig: MerchantConfig,
private configFilename: string,
) { }
) {}
private currentTimetravel: Duration | undefined;
@ -1899,8 +1899,10 @@ export class WalletCli {
const resp = await sh(
self.globalTestState,
`wallet-${self.name}`,
`taler-wallet-cli ${self.timetravelArg ?? ""
} ${cryptoWorkerArg} --no-throttle -LTRACE --skip-defaults --wallet-db '${self.dbfile
`taler-wallet-cli ${
self.timetravelArg ?? ""
} ${cryptoWorkerArg} --no-throttle -LTRACE --skip-defaults --wallet-db '${
self.dbfile
}' api '${op}' ${shellWrap(JSON.stringify(payload))}`,
);
logger.info("--- wallet core response ---");

View File

@ -914,10 +914,8 @@ export const nativeCryptoR: TalerCryptoInterfaceR = {
.put(timestampRoundedToBuffer(gf.start_date))
.put(timestampRoundedToBuffer(gf.end_date))
.put(durationRoundedToBuffer(gf.purse_timeout))
.put(durationRoundedToBuffer(gf.account_kyc_timeout))
.put(durationRoundedToBuffer(gf.history_expiration))
.put(amountToBuffer(Amounts.parseOrThrow(gf.history_fee)))
.put(amountToBuffer(Amounts.parseOrThrow(gf.kyc_fee)))
.put(amountToBuffer(Amounts.parseOrThrow(gf.account_fee)))
.put(amountToBuffer(Amounts.parseOrThrow(gf.purse_fee)))
.put(bufferForUint32(gf.purse_account_limit))

View File

@ -452,8 +452,6 @@ export interface ExchangeDetailsRecord {
/**
* Fees for exchange services
*
* FIXME: Put in separate object store!
*/
globalFees: ExchangeGlobalFees[];

View File

@ -363,7 +363,6 @@ export async function exportBackup(
accountFee: Amounts.stringify(x.accountFee),
historyFee: Amounts.stringify(x.historyFee),
purseFee: Amounts.stringify(x.purseFee),
kycTimeout: x.kycTimeout,
endDate: x.endDate,
historyTimeout: x.historyTimeout,
signature: x.signature,

View File

@ -414,7 +414,6 @@ export async function importBackup(
accountFee: Amounts.parseOrThrow(x.accountFee),
historyFee: Amounts.parseOrThrow(x.historyFee),
purseFee: Amounts.parseOrThrow(x.purseFee),
kycTimeout: x.kycTimeout,
endDate: x.endDate,
historyTimeout: x.historyTimeout,
signature: x.signature,

View File

@ -326,7 +326,6 @@ async function validateGlobalFees(
endDate: gf.end_date,
signature: gf.master_sig,
historyTimeout: gf.history_expiration,
kycTimeout: gf.account_kyc_timeout,
purseLimit: gf.purse_account_limit,
purseTimeout: gf.purse_timeout,
});