1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
use bincode::Encode; use serde::{Deserialize, Serialize}; use crate::client::Client; #[derive(Debug, Hash, Deserialize, Serialize, Clone, Copy, PartialEq, Encode)] pub struct Transaction { from: Client, to: Client, amount: u32, } impl Transaction { pub fn new(from: Client, to: Client, amount: u32) -> Self { Self { from, to, amount, } } }