From 13aa285062d6e8a33c5fe5d42020787cb88ec132 Mon Sep 17 00:00:00 2001 From: ghassmo Date: Sun, 17 Oct 2021 14:09:29 +0300 Subject: [PATCH] darkfid: check the token's network when print balances --- src/bin/darkfid.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/bin/darkfid.rs b/src/bin/darkfid.rs index 8dd4ed29f..b368499d4 100644 --- a/src/bin/darkfid.rs +++ b/src/bin/darkfid.rs @@ -136,13 +136,18 @@ impl Darkfid { let mut symbols: HashMap = HashMap::new(); for balance in balances.list.iter() { - // this is hardcoded for SOL - // TODO: if id == btc_id: - // network = bitcoin - // else - // network = solana - let network = "solana"; + + // XXX: this must be changed once cashierd + // supports more than two networks + + let mut network = "solana"; + + if balance.token_id.to_string() + == "0x01300f9bce0f9ba7168dc001a67bcbda3a5bf4bdb4c56ae900fe4698cee9a7bd" + { + network = "bitcoin" + } if let Some(symbol) = self.drk_tokenlist.symbol_from_id(balance.token_id)? { let amount = encode_base10(balance.value, 8);