lightwallet_protocol/
lib.rs1pub mod cash {
9 pub mod z {
10 pub mod wallet {
11 pub mod sdk {
12 pub mod rpc {
13 include!("generated/cash.z.wallet.sdk.rpc.rs");
14 }
15 }
16 }
17 }
18}
19
20pub use cash::z::wallet::sdk::rpc::*;
22
23pub use cash::z::wallet::sdk::rpc::compact_tx_streamer_client::CompactTxStreamerClient;
25pub use cash::z::wallet::sdk::rpc::compact_tx_streamer_server::{
26 CompactTxStreamer, CompactTxStreamerServer,
27};
28
29#[cfg(test)]
30mod tests {
31 use super::*;
32
33 #[test]
34 fn test_block_id_creation() {
35 let block_id = BlockId {
36 height: 1000,
37 hash: vec![0x00, 0x01, 0x02],
38 };
39 assert_eq!(block_id.height, 1000);
40 assert_eq!(block_id.hash, vec![0x00, 0x01, 0x02]);
41 }
42
43 #[test]
44 fn test_compact_block_creation() {
45 let block = CompactBlock {
46 proto_version: 1,
47 height: 500000,
48 hash: vec![0xaa, 0xbb],
49 prev_hash: vec![0xcc, 0xdd],
50 time: 1234567890,
51 header: vec![],
52 vtx: vec![],
53 chain_metadata: None,
54 };
55 assert_eq!(block.height, 500000);
56 assert_eq!(block.time, 1234567890);
57 }
58
59 #[test]
60 fn test_raw_transaction() {
61 let tx = RawTransaction {
62 data: vec![0x01, 0x02, 0x03],
63 height: 42,
64 };
65 assert_eq!(tx.data, vec![0x01, 0x02, 0x03]);
66 assert_eq!(tx.height, 42);
67 }
68}