1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Implementations of [`Arbitrary`] for contract types.

#![cfg(feature = "testutils")]

extern crate alloc;

use crate::xdr::ScStatus;
use crate::Status;
use arbitrary::{Arbitrary, Unstructured};

impl<'a> Arbitrary<'a> for Status {
    fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
        let scstatus = ScStatus::arbitrary(u)?;
        let status = Status::from(scstatus);

        Ok(status)
    }
}