transaction.rs
1 //! Transaction data. 2 3 use apibara_node::db::Table; 4 5 use super::block::{BlockBody, BlockEvents, BlockReceipts, ContractAtBlockId}; 6 use crate::core::GlobalBlockId; 7 8 /// Store block body. 9 #[derive(Debug, Clone, Copy, Default)] 10 pub struct BlockBodyTable {} 11 12 /// Store block receipts. 13 #[derive(Debug, Clone, Copy, Default)] 14 pub struct BlockReceiptsTable {} 15 16 /// Store block events. 17 #[derive(Debug, Clone, Copy, Default)] 18 pub struct BlockEventsTable {} 19 20 impl Table for BlockBodyTable { 21 type Key = GlobalBlockId; 22 type Value = BlockBody; 23 24 fn db_name() -> &'static str { 25 "BlockBody" 26 } 27 } 28 29 impl Table for BlockReceiptsTable { 30 type Key = GlobalBlockId; 31 type Value = BlockReceipts; 32 33 fn db_name() -> &'static str { 34 "BlockReceipts" 35 } 36 } 37 38 impl Table for BlockEventsTable { 39 type Key = ContractAtBlockId; 40 type Value = BlockEvents; 41 42 fn db_name() -> &'static str { 43 "BlockEvents" 44 } 45 }