x 3 лет назад
Родитель
Сommit
37345a3124

+ 3 - 2
example/dao2/contract/money/src/lib.rs

@@ -74,8 +74,9 @@ pub struct Output {
     pub value_commit: pallas::Point,
     pub token_commit: pallas::Point,
     pub coin: pallas::Base,
-    ///// The encrypted note
-    //pub enc_note: EncryptedNote2,
+    /// The encrypted note ciphertext
+    pub ciphertext: Vec<u8>,
+    pub ephem_public: PublicKey,
 }
 
 define_contract!(

+ 3 - 3
example/dao2/src/contract/money/transfer/wallet.rs

@@ -224,18 +224,18 @@ impl Builder {
                 token_blind,
             };
 
-            //let encrypted_note = note::encrypt(&note, &output.public)?;
+            let encrypted_note = note::encrypt(&note, &output.public)?;
 
             let output = Output {
                 value_commit: revealed.value_commit,
                 token_commit: revealed.token_commit,
                 coin: revealed.coin.0,
+                ciphertext: encrypted_note.ciphertext,
+                ephem_public: encrypted_note.ephem_public,
             };
             outputs.push(output);
         }
 
-        //let call_data = CallData { clear_inputs, inputs, outputs };
-
         Ok((MoneyTransferParams {
             clear_inputs, inputs, outputs
         }, proofs))

+ 2 - 2
example/dao2/src/note.rs

@@ -50,8 +50,8 @@ pub fn encrypt<T: Encodable>(note: &T, public: &PublicKey) -> Result<EncryptedNo
 
 #[derive(Debug, Clone, PartialEq, Eq, SerialEncodable, SerialDecodable)]
 pub struct EncryptedNote2 {
-    ciphertext: Vec<u8>,
-    ephem_public: PublicKey,
+    pub ciphertext: Vec<u8>,
+    pub ephem_public: PublicKey,
 }
 
 impl EncryptedNote2 {