Skip to content

Commit

Permalink
Add unchecked suffix to function name
Browse files Browse the repository at this point in the history
  • Loading branch information
yancyribbens committed Nov 13, 2024
1 parent 7315ca9 commit 06e0cf7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion units/src/fee_rate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl FeeRate {
pub const fn from_sat_per_vb_unchecked(sat_vb: u64) -> Self { FeeRate(sat_vb * (1000 / 4)) }

/// Constructs a new [`FeeRate`] from satoshis per kilo virtual bytes (1,000 vbytes).
pub const fn from_sat_per_kvb(sat_kvb: u64) -> Self { FeeRate(sat_kvb / 4) }
pub const fn from_sat_per_kvb_unchecked(sat_kvb: u64) -> Self { FeeRate(sat_kvb / 4) }

/// Returns raw fee rate.
///
Expand Down Expand Up @@ -340,6 +340,9 @@ mod tests {
fn from_sat_per_vb_unchecked_test() {
let fee_rate = FeeRate::from_sat_per_vb_unchecked(10);
assert_eq!(FeeRate(2500), fee_rate);

let fee_rate = FeeRate::from_sat_per_kvb_unchecked(10);
assert_eq!(FeeRate(2), fee_rate);
}

#[test]
Expand Down

0 comments on commit 06e0cf7

Please sign in to comment.