Sfoglia il codice sorgente

bin: Apply API changes.

Luther Blissett 3 anni fa
parent
commit
7a431fca4d

+ 1 - 1
bin/daod/src/dao_contract/vote/validate.rs

@@ -68,7 +68,7 @@ impl CallDataBase for CallData {
             zk_publics.push((
                 "dao-vote-burn".to_string(),
                 vec![
-                    input.nullifier.0,
+                    input.nullifier.inner(),
                     *value_coords.x(),
                     *value_coords.y(),
                     self.header.token_commit,

+ 3 - 2
bin/daod/src/dao_contract/vote/wallet.rs

@@ -140,7 +140,8 @@ impl Builder {
             let token_commit = poseidon_hash::<2>([note.token_id, gov_token_blind]);
             assert_eq!(self.dao.gov_token_id, note.token_id);
 
-            let nullifier = Nullifier::from(poseidon_hash::<2>([input.secret.0, note.serial]));
+            let nullifier =
+                Nullifier::from(poseidon_hash::<2>([input.secret.inner(), note.serial]));
 
             let vote_commit = pedersen_commitment_u64(note.value, vote_value_blind);
             let vote_commit_coords = vote_commit.to_affine().coordinates().unwrap();
@@ -148,7 +149,7 @@ impl Builder {
             let sigpub_coords = signature_public.0.to_affine().coordinates().unwrap();
 
             let public_inputs = vec![
-                nullifier,
+                nullifier.inner(),
                 *vote_commit_coords.x(),
                 *vote_commit_coords.y(),
                 token_commit,

+ 2 - 2
bin/darkotc/src/rpc.rs

@@ -141,8 +141,8 @@ impl Rpc {
                 exit(1);
             }
 
-            let n = MerkleNode::from_bytes(&n.try_into().unwrap());
-            if n.is_some().unwrap_u8() == 0 {
+            let n = MerkleNode::from_bytes(n.try_into().unwrap());
+            if n.is_none() {
                 eprintln!("Error: Noncanonical bytes of MerkleNode");
                 exit(1);
             }

+ 1 - 0
bin/drk/src/deploy_contract.rs

@@ -10,6 +10,7 @@ use rand::{rngs::OsRng, RngCore};
 
 use darkfi::{
     crypto::keypair::SecretKey,
+    node::{MemoryState, State},
     runtime::vm_runtime::{Runtime, ENTRYPOINT},
     util::cli::{fg_green, fg_red},
     zkas::ZkBinary,