Explorar o código

crypto: Derive serialization for OwnCoin.

parazyd %!s(int64=4) %!d(string=hai) anos
pai
achega
9cb3176639
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  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);