fix kudos name; add check in parse_config
This commit is contained in:
parent
96ac74a0ab
commit
b7e48641a5
4 changed files with 40 additions and 26 deletions
|
|
@ -1,22 +1,22 @@
|
||||||
[currency-KUDO]
|
[currency-KUDO]
|
||||||
enabled= YES
|
enabled= YES
|
||||||
code= KUDO
|
code= KUDOS
|
||||||
name= euro
|
name= Kudos
|
||||||
fractional_input_digits= 2
|
fractional_input_digits= 2
|
||||||
fractional_normal_digits= 2
|
fractional_normal_digits= 2
|
||||||
fractional_trailing_zero_digits= 2
|
fractional_trailing_zero_digits= 2
|
||||||
alt_unit_names= "{"0":"€","3":"k€"}"
|
alt_unit_names= "{"0":"ク","3":"kク"}"
|
||||||
|
|
||||||
[exchange]
|
[exchange]
|
||||||
currency = KUDO
|
currency = KUDOS
|
||||||
currency_round_unit = KUDO:0.01
|
currency_round_unit = KUDOS:0.01
|
||||||
db = postgres
|
db = postgres
|
||||||
attribute_encryption_key = "deadbeef"
|
attribute_encryption_key = "deadbeef"
|
||||||
port = 3434
|
port = 3434
|
||||||
bind_to = localhost
|
bind_to = localhost
|
||||||
master_public_key = "SJ0NYND22VQP3MP7FM754RDX8HCKVWAXTHY9SQNBTPRJZ2SPM2S0"
|
master_public_key = "SJ0NYND22VQP3MP7FM754RDX8HCKVWAXTHY9SQNBTPRJZ2SPM2S0"
|
||||||
stefan_abs = KUDO:0.00
|
stefan_abs = KUDOS:0.00
|
||||||
stefan_log = KUDO:0.00
|
stefan_log = KUDOS:0.00
|
||||||
stefan_lin = 0.00
|
stefan_lin = 0.00
|
||||||
aggregator_idle_sleep_interval = "1 hour"
|
aggregator_idle_sleep_interval = "1 hour"
|
||||||
closer_idle_sleep_interval = "1 hour"
|
closer_idle_sleep_interval = "1 hour"
|
||||||
|
|
@ -54,27 +54,27 @@ key_dir = "secrets/secmod_eddsa"
|
||||||
sm_priv_key = "secrets/secmod_eddsa/sm_key"
|
sm_priv_key = "secrets/secmod_eddsa/sm_key"
|
||||||
|
|
||||||
[coin_kudo_1]
|
[coin_kudo_1]
|
||||||
value= KUDO:0.01
|
value= KUDOS:0.01
|
||||||
duration_withdraw= "1 year"
|
duration_withdraw= "1 year"
|
||||||
duration_spend= "1 year"
|
duration_spend= "1 year"
|
||||||
duration_legal= "1 year"
|
duration_legal= "1 year"
|
||||||
fee_withdraw= KUDO:0.00
|
fee_withdraw= KUDOS:0.00
|
||||||
fee_deposit= KUDO:0.00
|
fee_deposit= KUDOS:0.00
|
||||||
fee_refresh= KUDO:0.00
|
fee_refresh= KUDOS:0.00
|
||||||
fee_refund= KUDO:0.00
|
fee_refund= KUDOS:0.00
|
||||||
cipher= RSA
|
cipher= RSA
|
||||||
rsa_keysize= 2048
|
rsa_keysize= 2048
|
||||||
age_restricted= NO
|
age_restricted= NO
|
||||||
|
|
||||||
[coin_kudo_2]
|
[coin_kudo_2]
|
||||||
value= KUDO:0.02
|
value= KUDOS:0.02
|
||||||
duration_withdraw= "1 year"
|
duration_withdraw= "1 year"
|
||||||
duration_spend= "1 year"
|
duration_spend= "1 year"
|
||||||
duration_legal= "1 year"
|
duration_legal= "1 year"
|
||||||
fee_withdraw= KUDO:0.00
|
fee_withdraw= KUDOS:0.00
|
||||||
fee_deposit= KUDO:0.00
|
fee_deposit= KUDOS:0.00
|
||||||
fee_refresh= KUDO:0.00
|
fee_refresh= KUDOS:0.00
|
||||||
fee_refund= KUDO:0.00
|
fee_refund= KUDOS:0.00
|
||||||
cipher= RSA
|
cipher= RSA
|
||||||
rsa_keysize= 2048
|
rsa_keysize= 2048
|
||||||
age_restricted= NO
|
age_restricted= NO
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -178,7 +178,22 @@ let yes_no = function
|
||||||
| s -> fail "expected `YES`/`NO` value, got `%s`" s
|
| s -> fail "expected `YES`/`NO` value, got `%s`" s
|
||||||
|
|
||||||
let uri s = Uri.of_string s
|
let uri s = Uri.of_string s
|
||||||
let amount s = s |> Amount.of_string |> unwrap
|
|
||||||
|
let amount =
|
||||||
|
let currency = ref None in
|
||||||
|
fun s ->
|
||||||
|
let amount = s |> Amount.of_string |> unwrap in
|
||||||
|
match !currency with
|
||||||
|
| None ->
|
||||||
|
currency := Some amount.currency;
|
||||||
|
amount
|
||||||
|
| Some cur -> (
|
||||||
|
match String.equal amount.currency cur with
|
||||||
|
| false ->
|
||||||
|
fail "only one kind of currency is supported, found: `%s` and `%s`."
|
||||||
|
amount.currency cur
|
||||||
|
| true -> amount)
|
||||||
|
|
||||||
let duration s = Config_duration.(s |> parse |> to_time_span)
|
let duration s = Config_duration.(s |> parse |> to_time_span)
|
||||||
|
|
||||||
let ed25519 s =
|
let ed25519 s =
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ b="/tmp/b.json"
|
||||||
url="http://localhost:3434"
|
url="http://localhost:3434"
|
||||||
auditor_pub="A17JXR3E6J4CXDPYT7S1H25PGJ3ABS26TQ38654QCX0TB59RPMF0"
|
auditor_pub="A17JXR3E6J4CXDPYT7S1H25PGJ3ABS26TQ38654QCX0TB59RPMF0"
|
||||||
master_key="./default/master_offline_private_key"
|
master_key="./default/master_offline_private_key"
|
||||||
zero_euro="KUDO:0.0"
|
zero_kudos="KUDOS:0.0"
|
||||||
|
|
||||||
offline_tool() {
|
offline_tool() {
|
||||||
dune exec offline -- "$@" > /dev/null
|
dune exec offline -- "$@" > /dev/null
|
||||||
|
|
@ -63,8 +63,8 @@ offline_tool wire-fee \
|
||||||
--wire_method "xxx" \
|
--wire_method "xxx" \
|
||||||
--fee_start 0 \
|
--fee_start 0 \
|
||||||
--fee_end 99999999 \
|
--fee_end 99999999 \
|
||||||
--closing_fee $zero_euro \
|
--closing_fee $zero_kudos \
|
||||||
--wire_fee $zero_euro
|
--wire_fee $zero_kudos
|
||||||
offline_tool upload --input $b --url $url"/management/wire-fee"
|
offline_tool upload --input $b --url $url"/management/wire-fee"
|
||||||
echo "[OK] /management/wire-fee"
|
echo "[OK] /management/wire-fee"
|
||||||
|
|
||||||
|
|
@ -73,9 +73,9 @@ offline_tool global-fees \
|
||||||
--output $b \
|
--output $b \
|
||||||
--start_date 0 \
|
--start_date 0 \
|
||||||
--end_date 99999999 \
|
--end_date 99999999 \
|
||||||
--history_fee $zero_euro \
|
--history_fee $zero_kudos \
|
||||||
--account_fee $zero_euro \
|
--account_fee $zero_kudos \
|
||||||
--purse_fee $zero_euro \
|
--purse_fee $zero_kudos \
|
||||||
--history_expiration 9999999 \
|
--history_expiration 9999999 \
|
||||||
--purse_account_limit 1 \
|
--purse_account_limit 1 \
|
||||||
--purse_timeout 9999999
|
--purse_timeout 9999999
|
||||||
|
|
@ -107,6 +107,6 @@ offline_tool drain \
|
||||||
--credit_payto_uri "" \
|
--credit_payto_uri "" \
|
||||||
--wtid $wtid \
|
--wtid $wtid \
|
||||||
--date 0 \
|
--date 0 \
|
||||||
--amount $zero_euro
|
--amount $zero_kudos
|
||||||
offline_tool upload --input $b --url $url"/management/drain"
|
offline_tool upload --input $b --url $url"/management/drain"
|
||||||
echo "[OK] /management/drain"
|
echo "[OK] /management/drain"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue