From 20c84ce444fe68577bf14842ebaffd796572d91f Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 12 Jun 2025 10:31:56 +1000 Subject: [PATCH] units: Make fee module public The `fee` module is now empty as far as API surface. It still holds the `core::ops` impls for fee calculation. It also does have useful rustdocs which are not currently visible online because module is private. Make the module public. Functionally all this does is provide a place for the module level docs under a discoverable name. Improve the docs by adding a bunch of links to fee related functions. --- units/src/fee.rs | 12 ++++++++++++ units/src/lib.rs | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/units/src/fee.rs b/units/src/fee.rs index 76aa55309..008fd920b 100644 --- a/units/src/fee.rs +++ b/units/src/fee.rs @@ -10,6 +10,18 @@ //! //! We provide `fee.checked_div_by_weight_ceil(weight)` to calculate a minimum threshold fee rate //! required to pay at least `fee` for transaction with `weight`. +//! +//! We support various `core::ops` traits all of which return [`NumOpResult`]. +//! +//! For specific methods see: +//! +//! * [`Amount::checked_div_by_weight_floor`] +//! * [`Amount::checked_div_by_weight_ceil`] +//! * [`Amount::checked_div_by_fee_rate_floor`] +//! * [`Amount::checked_div_by_fee_rate_ceil`] +//! * [`Weight::checked_mul_by_fee_rate`] +//! * [`FeeRate::checked_mul_by_weight`] +//! * [`FeeRate::to_fee`] use core::ops; diff --git a/units/src/lib.rs b/units/src/lib.rs index 643120223..12c818650 100644 --- a/units/src/lib.rs +++ b/units/src/lib.rs @@ -34,7 +34,6 @@ extern crate alloc; #[cfg(feature = "std")] extern crate std; -mod fee; mod internal_macros; mod result; @@ -48,6 +47,7 @@ pub mod _export { pub mod amount; pub mod block; +pub mod fee; pub mod fee_rate; pub mod locktime; pub mod parse;