pub fn new_random() -> Self {
        let t = Transaction {
            r#type: Type::random(),
            client: rand::random(),
            id: unsafe { ID.wrapping_sub(random()) },
            amount: rand::random(),
            under_dispute: rand::random(),
        };
        // Change the ID 30% of the time, to allow for generating
        // more plausible scenarios
        unsafe {
            if (random::<u8>() % 100) < 30 {
                ID += 1;
            }
        }
        t
    }
/// Create a new transaction filled with random data.
Create a new transaction filled with random data.
Create a new transaction filled with random data .
pub fn new_random() -> Self {
        let t = Transaction {
            r#type: Type::random(),
            client: rand::random(),
            id: unsafe { ID.wrapping_sub(random()) },
            amount: rand::random(),
            under_dispute: rand::random(),
        };
        // Change the ID 30% of the time, to allow for generating
        // more plausible scenarios
        unsafe {
            if (random::<u8>() % 100) < 30 {
                ID += 1;
            }
        }
        t
    }
pub fn new_random ( ) -> Self { let t = Transaction { r#type : Type :: random ( ) , client : rand :: random ( ) , id : unsafe { ID . wrapping_sub ( random ( ) ) } , amount : rand :: random ( ) , under_dispute : rand :: random ( ) , } ; // Change the ID 30% of the time, to allow for generating // more plausible scenarios unsafe { if ( random :: < u8 > ( ) % 100 ) < 30 { ID += 1 ; } } t }
Create a new transaction filled with random data.
Create a new transaction filled with random data .