brk_core/structs/
txversion.rs

1use derive_deref::Deref;
2use serde::Serialize;
3use zerocopy::{FromBytes, Immutable, IntoBytes, KnownLayout};
4
5#[derive(Debug, Deref, Clone, Copy, Immutable, IntoBytes, KnownLayout, FromBytes, Serialize)]
6pub struct TxVersion(i32);
7
8impl From<bitcoin::transaction::Version> for TxVersion {
9    fn from(value: bitcoin::transaction::Version) -> Self {
10        Self(value.0)
11    }
12}
13
14impl From<TxVersion> for bitcoin::transaction::Version {
15    fn from(value: TxVersion) -> Self {
16        Self(value.0)
17    }
18}