Skip to main content

xrpl_escrow_stdlib/ledger_objects/
escrow.rs

1use xrpl_common_stdlib::core::ledger_objects::traits::{EscrowFields, LedgerObjectCommonFields};
2#[derive(Debug, Clone, Copy, Eq, PartialEq)]
3pub struct Escrow {
4    pub(crate) slot_num: i32,
5}
6
7impl LedgerObjectCommonFields for Escrow {
8    fn get_slot_num(&self) -> i32 {
9        self.slot_num
10    }
11}
12
13impl EscrowFields for Escrow {}
14
15impl Escrow {
16    pub fn new(slot_num: i32) -> Self {
17        Self { slot_num }
18    }
19}
20
21#[cfg(test)]
22mod tests {
23    use super::*;
24
25    #[test]
26    fn test_new() {
27        let escrow = Escrow::new(42);
28        assert_eq!(escrow.slot_num, 42);
29    }
30}