Merge rust-bitcoin/rust-bitcoin#4540: Remove `impl From<u64> for FeeRate`
c63f80baec
Remove impl From<u64> for FeeRate (Tobin C. Harding)
Pull request description:
This function leaks the inner unit of `FeeRate`. We want to change the unit, best to break downstream so they notice.
ACKs for top commit:
apoelstra:
ACK c63f80baec0780622d70e4c8699369b0a972cb62; successfully ran local tests; will one-ACK merge as this is units-only
Tree-SHA512: 5748f2a4cb29d6554226fe20c5479cb53081da8c2788ac31abfe1a2edb4d17f13a3b3037a840fbdc29e842af3e1accc27835fd5429c7355c1351eb8883943fdc
This commit is contained in:
commit
180d9286d5
|
@ -131,10 +131,6 @@ impl FeeRate {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<FeeRate> for u64 {
|
||||
fn from(value: FeeRate) -> Self { value.to_sat_per_kwu() }
|
||||
}
|
||||
|
||||
crate::internal_macros::impl_op_for_references! {
|
||||
impl ops::Add<FeeRate> for FeeRate {
|
||||
type Output = FeeRate;
|
||||
|
@ -195,12 +191,6 @@ mod tests {
|
|||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn sanity_check() {
|
||||
let fee_rate: u64 = u64::from(FeeRate::from_sat_per_kwu(100));
|
||||
assert_eq!(fee_rate, 100_u64);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::op_ref)]
|
||||
fn feerate_div_nonzero() {
|
||||
|
|
Loading…
Reference in New Issue