Преглед на файлове

daod: added money contract TODO + verify_sigs on dao::mint()

lunar-mining преди 3 години
родител
ревизия
1feb4dd637
променени са 3 файла, в които са добавени 6 реда и са изтрити 4 реда
  1. 1 0
      bin/daod/src/demo.rs
  2. 1 0
      bin/daod/src/money_contract/state.rs
  3. 4 4
      bin/darkfid/src/error.rs

+ 1 - 0
bin/daod/src/demo.rs

@@ -433,6 +433,7 @@ pub async fn demo() -> Result<()> {
     }
 
     tx.zk_verify(&zk_bins);
+    tx.verify_sigs();
 
     // Wallet stuff
 

+ 1 - 0
bin/daod/src/money_contract/state.rs

@@ -21,6 +21,7 @@ pub struct OwnCoin {
 
 pub struct WalletCache {
     // Normally this would be a HashMap, but SecretKey is not Hash-able
+    // TODO: This can be HashableBase
     cache: Vec<(SecretKey, Vec<OwnCoin>)>,
 }
 

+ 4 - 4
bin/darkfid/src/error.rs

@@ -11,12 +11,12 @@ pub enum RpcError {
     InvalidKeypair = -32106,
     UnknownSlot = -32107,
     TxBuildFail = -32108,
-//    NetworkNameError = -32109,
+    //    NetworkNameError = -32109,
     ParseError = -32110,
     TxBroadcastFail = -32111,
     NotYetSynced = -32112,
     InvalidAddressParam = -32113,
-//    InvalidAmountParam = -32114,
+    //    InvalidAmountParam = -32114,
     DecryptionFailed = -32115,
 }
 
@@ -30,12 +30,12 @@ fn to_tuple(e: RpcError) -> (i64, String) {
         RpcError::InvalidKeypair => "Invalid keypair",
         RpcError::UnknownSlot => "Did not find slot",
         RpcError::TxBuildFail => "Failed building transaction",
-//        RpcError::NetworkNameError => "Unknown network name",
+        //        RpcError::NetworkNameError => "Unknown network name",
         RpcError::ParseError => "Parse error",
         RpcError::TxBroadcastFail => "Failed broadcasting transaction",
         RpcError::NotYetSynced => "Blockchain not yet synced",
         RpcError::InvalidAddressParam => "Invalid address parameter",
-//        RpcError::InvalidAmountParam => "invalid amount parameter",
+        //        RpcError::InvalidAmountParam => "invalid amount parameter",
         RpcError::DecryptionFailed => "Decryption failed",
     };