From f490222068a59bdce0a36f4bb99af5bcc1661c0c Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 3 Sep 2024 10:57:58 +1000 Subject: [PATCH] Introduce the VersionExt trait In preparation for moving the `transaction::Version` type to `primitives`; add a `VersionExt` trait using our macro. --- bitcoin/src/blockdata/transaction.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bitcoin/src/blockdata/transaction.rs b/bitcoin/src/blockdata/transaction.rs index cfa1533bb..d77022a99 100644 --- a/bitcoin/src/blockdata/transaction.rs +++ b/bitcoin/src/blockdata/transaction.rs @@ -946,14 +946,14 @@ impl Version { pub const TWO: Self = Self(2); } -mod tmp { - use super::*; - impl Version { +crate::internal_macros::define_extension_trait! { + /// Extension functionality for the [`Version`] type. + pub trait VersionExt impl for Version { /// Creates a non-standard transaction version. - pub fn non_standard(version: i32) -> Version { Self(version) } + fn non_standard(version: i32) -> Version { Self(version) } /// Returns true if this transaction version number is considered standard. - pub fn is_standard(&self) -> bool { *self == Version::ONE || *self == Version::TWO } + fn is_standard(&self) -> bool { *self == Version::ONE || *self == Version::TWO } } }