-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; purseFee: BackupAmountString;
historyTimeout: TalerProtocolDuration; historyTimeout: TalerProtocolDuration;
kycTimeout: TalerProtocolDuration;
purseTimeout: TalerProtocolDuration; purseTimeout: TalerProtocolDuration;
purseLimit: number; purseLimit: number;

View File

@ -772,11 +772,6 @@ export interface GlobalFees {
// What date (exclusive) does this fees stop going into effect? // What date (exclusive) does this fees stop going into effect?
end_date: TalerProtocolTimestamp; 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 // Account history fee, charged when a user wants to
// obtain a reserve/account history. // obtain a reserve/account history.
history_fee: AmountString; history_fee: AmountString;
@ -798,13 +793,6 @@ export interface GlobalFees {
// retain the account history for legal reasons until this time. // retain the account history for legal reasons until this time.
history_expiration: TalerProtocolDuration; 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 // Non-negative number of concurrent purses that any
// account holder is allowed to create without having // account holder is allowed to create without having
// to pay the purse_fee. // to pay the purse_fee.
@ -828,8 +816,6 @@ export class WireFeesJson {
*/ */
wire_fee: string; wire_fee: string;
wad_fee: string;
/** /**
* Cost of clising a reserve. * Cost of clising a reserve.
*/ */
@ -1395,12 +1381,10 @@ export const codecForGlobalFees = (): Codec<GlobalFees> =>
buildCodecForObject<GlobalFees>() buildCodecForObject<GlobalFees>()
.property("start_date", codecForTimestamp) .property("start_date", codecForTimestamp)
.property("end_date", codecForTimestamp) .property("end_date", codecForTimestamp)
.property("kyc_fee", codecForAmountString())
.property("history_fee", codecForAmountString()) .property("history_fee", codecForAmountString())
.property("account_fee", codecForAmountString()) .property("account_fee", codecForAmountString())
.property("purse_fee", codecForAmountString()) .property("purse_fee", codecForAmountString())
.property("history_expiration", codecForDuration) .property("history_expiration", codecForDuration)
.property("account_kyc_timeout", codecForDuration)
.property("purse_account_limit", codecForNumber()) .property("purse_account_limit", codecForNumber())
.property("purse_timeout", codecForDuration) .property("purse_timeout", codecForDuration)
.property("master_sig", codecForString()) .property("master_sig", codecForString())
@ -1423,7 +1407,6 @@ export const codecForWireFeesJson = (): Codec<WireFeesJson> =>
buildCodecForObject<WireFeesJson>() buildCodecForObject<WireFeesJson>()
.property("wire_fee", codecForString()) .property("wire_fee", codecForString())
.property("closing_fee", codecForString()) .property("closing_fee", codecForString())
.property("wad_fee", codecForString())
.property("sig", codecForString()) .property("sig", codecForString())
.property("start_date", codecForTimestamp) .property("start_date", codecForTimestamp)
.property("end_date", codecForTimestamp) .property("end_date", codecForTimestamp)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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