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

crypto: Derive serialization for OwnCoin.

parazyd 4 жил өмнө
parent
commit
9cb3176639
1 өөрчлөгдсөн 8 нэмэгдсэн , 1 устгасан
  1. 8 1
      src/crypto/mod.rs

+ 8 - 1
src/crypto/mod.rs

@@ -24,9 +24,15 @@ pub use proof::Proof;
 //pub mod lead_proof;
 //pub mod leadcoin;
 
+use crate::{
+    impl_vec,
+    util::serial::{Decodable, Encodable, SerialDecodable, SerialEncodable, VarInt},
+    Result,
+};
 use keypair::SecretKey;
+use std::io;
 
-#[derive(Copy, Clone, Debug, PartialEq, Eq)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq, SerialEncodable, SerialDecodable)]
 pub struct OwnCoin {
     pub coin: coin::Coin,
     pub note: note::Note,
@@ -36,3 +42,4 @@ pub struct OwnCoin {
 }
 
 pub type OwnCoins = Vec<OwnCoin>;
+impl_vec!(OwnCoin);