commit 91457c5d4aed678504951842f6fa95c892aebacd
parent cfdf098fea5f565e2a0d2cffb10f20af07946054
Author: Antoine A <>
Date: Thu, 19 Feb 2026 00:05:02 +0100
cyclos: improve setup
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/taler-cyclos/src/setup.rs b/taler-cyclos/src/setup.rs
@@ -87,10 +87,11 @@ pub async fn setup(cfg: &Config, _reset: bool, client: &http_client::Client) ->
}
// Check account type
- let accmunts = client.accounts().await?;
- if accounts.is_empty() {
+ let accounts = client.accounts().await?;
+ let currency = if accounts.is_empty() {
debug!(target: "setup", "No accounts found, there is some issues in the Cyclos configuration");
ready = false;
+ None
} else {
let accounts_fmt = {
let mut s = String::new();
@@ -104,7 +105,7 @@ pub async fn setup(cfg: &Config, _reset: bool, client: &http_client::Client) ->
}
s
};
- let currency = if let Some(id) = cfg.account_type_id {
+ if let Some(id) = cfg.account_type_id {
if let Some(p) = accounts.iter().find(|it| it.ty.id == id) {
debug!(target: "setup", "ACCOUNT_TYPE_ID {id} in config is one of:{accounts_fmt}");
Some(&p.currency)
@@ -117,8 +118,8 @@ pub async fn setup(cfg: &Config, _reset: bool, client: &http_client::Client) ->
error!(target: "setup", "Missing ACCOUNT_TYPE_ID in config, must be one of:{accounts_fmt}");
ready = false;
None
- };
- }
+ }
+ };
if let Some(currency) = currency {
// Check currency