Эх сурвалжийг харах

remove retarded 'target: ""' from src/tx/mod.rs

x 3 жил өмнө
parent
commit
c17fb5ca19
2 өөрчлөгдсөн 10 нэмэгдсэн , 10 устгасан
  1. 1 1
      script/clean_logs.py
  2. 9 9
      src/tx/mod.rs

+ 1 - 1
script/clean_logs.py

@@ -118,7 +118,6 @@ def replace(fname, contents):
                     past_line
                 )):
                     function_name = match.group(1)
-                    print(past_line, function_name)
                     break
             assert function_name is not None
 
@@ -162,6 +161,7 @@ def replace(fname, contents):
             # Multiline logs
             # We read the next line and check if there's a target set or not
             else:
+                print(line)
                 assert re.search(f"{log_level}!\\($", line)
 
                 old_text = f"{ln()}: {line}"

+ 9 - 9
src/tx/mod.rs

@@ -75,7 +75,7 @@ impl Transaction {
                 if let Some(vks) = verifying_keys.read().await.get(&call.contract_id.to_bytes()) {
                     if let Some(vk) = vks.iter().find(|x| &x.0 == zk_ns) {
                         // We have a verifying key for this
-                        debug!(target: "", "public inputs: {:#?}", public_vals);
+                        debug!("public inputs: {:#?}", public_vals);
                         if let Err(e) = proof.verify(&vk.1, public_vals) {
                             error!(
                                 target: "",
@@ -84,13 +84,13 @@ impl Transaction {
                             );
                             return Err(VerifyFailed::ProofVerifyFailed(e.to_string()).into())
                         }
-                        debug!(target: "", "Successfully verified {}::{} ZK proof", call.contract_id, zk_ns);
+                        debug!("Successfully verified {}::{} ZK proof", call.contract_id, zk_ns);
                         continue
                     }
                 }
 
                 let e = format!("{}:{} circuit VK nonexistent", call.contract_id, zk_ns);
-                error!(target: "", "{}", e);
+                error!("{}", e);
                 return Err(VerifyFailed::ProofVerifyFailed(e).into())
             }
         }
@@ -102,19 +102,19 @@ impl Transaction {
     pub fn verify_sigs(&self, pub_table: Vec<Vec<PublicKey>>) -> Result<()> {
         let tx_data = self.encode_without_sigs()?;
         let data_hash = blake3::hash(&tx_data);
-        debug!(target: "", "tx.verify_sigs: data_hash: {:?}", data_hash.as_bytes());
+        debug!("tx.verify_sigs: data_hash: {:?}", data_hash.as_bytes());
 
         assert!(pub_table.len() == self.signatures.len());
 
         for (i, (sigs, pubkeys)) in self.signatures.iter().zip(pub_table.iter()).enumerate() {
             for (pubkey, signature) in pubkeys.iter().zip(sigs) {
-                debug!(target: "", "Verifying signature with public key: {}", pubkey);
+                debug!("Verifying signature with public key: {}", pubkey);
                 if !pubkey.verify(&data_hash.as_bytes()[..], signature) {
-                    error!(target: "", "tx::verify_sigs[{}] failed to verify", i);
+                    error!("tx::verify_sigs[{}] failed to verify", i);
                     return Err(Error::InvalidSignature)
                 }
             }
-            debug!(target: "", "tx::verify_sigs[{}] passed", i);
+            debug!("tx::verify_sigs[{}] passed", i);
         }
 
         Ok(())
@@ -128,11 +128,11 @@ impl Transaction {
     ) -> Result<Vec<Signature>> {
         let tx_data = self.encode_without_sigs()?;
         let data_hash = blake3::hash(&tx_data);
-        debug!(target: "", "tx.create_sigs: data_hash: {:?}", data_hash.as_bytes());
+        debug!("tx.create_sigs: data_hash: {:?}", data_hash.as_bytes());
 
         let mut sigs = vec![];
         for secret in secret_keys {
-            debug!(target: "", "Creating signature with public key: {}", PublicKey::from_secret(*secret));
+            debug!("Creating signature with public key: {}", PublicKey::from_secret(*secret));
             let signature = secret.sign(rng, &data_hash.as_bytes()[..]);
             sigs.push(signature);
         }