From 1d23d4c29d92cb22bfb942858a2bf73ac87128b8 Mon Sep 17 00:00:00 2001 From: ghassmo Date: Wed, 13 Oct 2021 16:16:40 +0300 Subject: [PATCH] darkfid: clean up --- src/bin/darkfid.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/bin/darkfid.rs b/src/bin/darkfid.rs index 81c28643e..8898ffc67 100644 --- a/src/bin/darkfid.rs +++ b/src/bin/darkfid.rs @@ -513,25 +513,22 @@ async fn main() -> Result<()> { let mut cashiers = Vec::new(); let mut cashier_keys = Vec::new(); - // If is empty, warn! for cashier in config.clone().cashiers { + if cashier.public_key.is_empty() { - // TODO: this is just a random error, need proper error - debug!(target: "DARKFID", "Public key field is empty"); - return Err(Error::PathNotFound); + return Err(Error::CashierKeysNotFound); } - debug!(target: "DARKFID", "Found public key"); + let cashier_public: jubjub::SubgroupPoint = deserialize(&bs58::decode(cashier.public_key).into_vec()?)?; - debug!(target: "DARKFID", "push to Cashier"); + cashiers.push(Cashier { name: cashier.name, rpc_url: cashier.rpc_url, public_key: cashier_public, }); - debug!(target: "DARKFID", "push cashier_public to cashier_keys"); + cashier_keys.push(cashier_public); - debug!(target: "DARKFID", "CASHIER KEYS {:?}", cashier_keys); } let params_paths = (