diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-09-08 22:44:01 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-09-08 22:44:01 +0530 |
commit | 855b7028c614b5d4d56657939c4bccbaf542fddc (patch) | |
tree | 888394a9b8459fcb8ec91ec51a8928cb03c11c88 /packages/taler-integrationtests/src/harness.ts | |
parent | e964367d0a31c1e7ad1a535cc94e8483c7f7c555 (diff) | |
download | wallet-core-855b7028c614b5d4d56657939c4bccbaf542fddc.tar.xz |
use cheaper denom structure for auto-refresh test
Diffstat (limited to 'packages/taler-integrationtests/src/harness.ts')
-rw-r--r-- | packages/taler-integrationtests/src/harness.ts | 109 |
1 files changed, 9 insertions, 100 deletions
diff --git a/packages/taler-integrationtests/src/harness.ts b/packages/taler-integrationtests/src/harness.ts index e40798b4b..b71fe4104 100644 --- a/packages/taler-integrationtests/src/harness.ts +++ b/packages/taler-integrationtests/src/harness.ts @@ -91,6 +91,7 @@ import { } from "./merchantApiTypes"; import { ApplyRefundResponse } from "taler-wallet-core"; import { PendingOperationsResponse } from "taler-wallet-core"; +import { CoinConfig } from "./denomStructures"; const exec = util.promisify(require("child_process").exec); @@ -221,96 +222,6 @@ export class ProcessWrapper { } } -interface CoinConfig { - name: string; - value: string; - durationWithdraw: string; - durationSpend: string; - durationLegal: string; - feeWithdraw: string; - feeDeposit: string; - feeRefresh: string; - feeRefund: string; - rsaKeySize: number; -} - -const coinCommon = { - durationLegal: "3 years", - durationSpend: "2 years", - durationWithdraw: "7 days", - rsaKeySize: 1024, -}; - -export const coin_ct1 = (curr: string): CoinConfig => ({ - ...coinCommon, - name: `${curr}_ct1`, - value: `${curr}:0.01`, - feeDeposit: `${curr}:0.00`, - feeRefresh: `${curr}:0.01`, - feeRefund: `${curr}:0.00`, - feeWithdraw: `${curr}:0.01`, -}); - -export const coin_ct10 = (curr: string): CoinConfig => ({ - ...coinCommon, - name: `${curr}_ct10`, - value: `${curr}:0.10`, - feeDeposit: `${curr}:0.01`, - feeRefresh: `${curr}:0.01`, - feeRefund: `${curr}:0.00`, - feeWithdraw: `${curr}:0.01`, -}); - -export const coin_u1 = (curr: string): CoinConfig => ({ - ...coinCommon, - name: `${curr}_u1`, - value: `${curr}:1`, - feeDeposit: `${curr}:0.02`, - feeRefresh: `${curr}:0.02`, - feeRefund: `${curr}:0.02`, - feeWithdraw: `${curr}:0.02`, -}); - -export const coin_u2 = (curr: string): CoinConfig => ({ - ...coinCommon, - name: `${curr}_u2`, - value: `${curr}:2`, - feeDeposit: `${curr}:0.02`, - feeRefresh: `${curr}:0.02`, - feeRefund: `${curr}:0.02`, - feeWithdraw: `${curr}:0.02`, -}); - -export const coin_u4 = (curr: string): CoinConfig => ({ - ...coinCommon, - name: `${curr}_u4`, - value: `${curr}:4`, - feeDeposit: `${curr}:0.02`, - feeRefresh: `${curr}:0.02`, - feeRefund: `${curr}:0.02`, - feeWithdraw: `${curr}:0.02`, -}); - -export const coin_u8 = (curr: string): CoinConfig => ({ - ...coinCommon, - name: `${curr}_u8`, - value: `${curr}:8`, - feeDeposit: `${curr}:0.16`, - feeRefresh: `${curr}:0.16`, - feeRefund: `${curr}:0.16`, - feeWithdraw: `${curr}:0.16`, -}); - -const coin_u10 = (curr: string): CoinConfig => ({ - ...coinCommon, - name: `${curr}_u10`, - value: `${curr}:10`, - feeDeposit: `${curr}:0.2`, - feeRefresh: `${curr}:0.2`, - feeRefund: `${curr}:0.2`, - feeWithdraw: `${curr}:0.2`, -}); - export class GlobalTestParams { testDir: string; } @@ -832,16 +743,6 @@ const codecForWithdrawalOperationInfo = (): Codec<WithdrawalOperationInfo> => .property("taler_withdraw_uri", codecForString()) .build("WithdrawalOperationInfo"); -export const defaultCoinConfig = [ - coin_ct1, - coin_ct10, - coin_u1, - coin_u10, - coin_u2, - coin_u4, - coin_u8, -]; - export interface ExchangeConfig { name: string; currency: string; @@ -1003,6 +904,14 @@ export class ExchangeService implements ExchangeServiceInterface { config.write(this.configFilename); } + addCoinConfigList(ccs: CoinConfig[]) { + const config = Configuration.load(this.configFilename); + ccs.forEach((cc) => + setCoin(config, cc), + ); + config.write(this.configFilename); + } + get masterPub() { return encodeCrock(this.keyPair.eddsaPub); } |