Skip to content

Commit 20c84ce

Browse files
committed
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.
1 parent 251e6a8 commit 20c84ce

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

units/src/fee.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@
1010
//!
1111
//! We provide `fee.checked_div_by_weight_ceil(weight)` to calculate a minimum threshold fee rate
1212
//! required to pay at least `fee` for transaction with `weight`.
13+
//!
14+
//! We support various `core::ops` traits all of which return [`NumOpResult<T>`].
15+
//!
16+
//! For specific methods see:
17+
//!
18+
//! * [`Amount::checked_div_by_weight_floor`]
19+
//! * [`Amount::checked_div_by_weight_ceil`]
20+
//! * [`Amount::checked_div_by_fee_rate_floor`]
21+
//! * [`Amount::checked_div_by_fee_rate_ceil`]
22+
//! * [`Weight::checked_mul_by_fee_rate`]
23+
//! * [`FeeRate::checked_mul_by_weight`]
24+
//! * [`FeeRate::to_fee`]
1325
1426
use core::ops;
1527

units/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ extern crate alloc;
3434
#[cfg(feature = "std")]
3535
extern crate std;
3636

37-
mod fee;
3837
mod internal_macros;
3938
mod result;
4039

@@ -48,6 +47,7 @@ pub mod _export {
4847

4948
pub mod amount;
5049
pub mod block;
50+
pub mod fee;
5151
pub mod fee_rate;
5252
pub mod locktime;
5353
pub mod parse;

0 commit comments

Comments
 (0)