chore: move BebopOrderType to models.rs

This commit is contained in:
pedrobergamini
2025-06-08 01:01:51 -03:00
parent 71a8401670
commit 0106c5c425
6 changed files with 58 additions and 85 deletions

View File

@@ -210,6 +210,27 @@ pub enum TransferType {
None = 2,
}
/// Bebop order types
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum BebopOrderType {
Single = 0,
Multi = 1,
Aggregate = 2,
}
impl TryFrom<u8> for BebopOrderType {
type Error = EncodingError;
fn try_from(value: u8) -> Result<Self, Self::Error> {
match value {
0 => Ok(BebopOrderType::Single),
1 => Ok(BebopOrderType::Multi),
2 => Ok(BebopOrderType::Aggregate),
_ => Err(EncodingError::InvalidInput(format!("Invalid Bebop order type: {}", value))),
}
}
}
#[derive(Clone, PartialEq, Eq, Hash)]
pub struct Chain {
pub id: u64,