Explorar o código

token_list: use drk_tokenlist as a reference

ghassmo %!s(int64=4) %!d(string=hai) anos
pai
achega
a541cd088e
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      src/bin/darkfid.rs
  2. 1 1
      src/util/token_list.rs

+ 1 - 1
src/bin/darkfid.rs

@@ -154,7 +154,7 @@ impl Darkfid {
                 let network = "solana";
                 let mut data_vec: Vec<String> = Vec::new();
 
-                if let Some(symbol) = self.drk_tokenlist.clone().symbol_from_id(id)? {
+                if let Some(symbol) = self.drk_tokenlist.symbol_from_id(id)? {
                     let amount = encode_base10(*value, 8);
                     data_vec.push(amount);
                     data_vec.push(network.to_string());

+ 1 - 1
src/util/token_list.rs

@@ -84,7 +84,7 @@ impl DrkTokenList {
         }
     }
 
-    pub fn symbol_from_id(self, id: jubjub::Fr) -> Result<Option<String>> {
+    pub fn symbol_from_id(&self, id: jubjub::Fr) -> Result<Option<String>> {
         Ok(self
             .tokens
             .iter()