From 7905c1c165ca6911ad8f3d9f83ff160b2d9dc9bb Mon Sep 17 00:00:00 2001 From: ghe0 Date: Sun, 22 Dec 2024 21:00:41 +0200 Subject: [PATCH] fix bug on == --- src/data.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/data.rs b/src/data.rs index eddacca..639fdd1 100644 --- a/src/data.rs +++ b/src/data.rs @@ -180,7 +180,7 @@ impl BrainData { e ); } - if confirmation.error == "" { + if confirmation.error != "" { return; } let contract = Contract { @@ -274,12 +274,17 @@ impl BrainData { } pub fn find_contracts_by_admin_pubkey(&self, admin_pubkey: &str) -> Vec { - let contracts = self.contracts.read().unwrap(); - contracts + debug!("Searching contracts for admin pubkey {admin_pubkey}"); + let contracts: Vec = self + .contracts + .read() + .unwrap() .iter() .cloned() .filter(|c| c.admin_pubkey == admin_pubkey) - .collect() + .collect(); + debug!("Found {} contracts or {admin_pubkey}.", contracts.len()); + contracts } pub fn find_contracts_by_node_pubkey(&self, node_pubkey: &str) -> Vec {