Merge rust-bitcoin/rust-bitcoin#3931: Remove mutagen

7277092af4 Remove mutagen (Tobin C. Harding)

Pull request description:

  Back in 2022 we elected to use `mutagen` for mutation testing. Since then `cargo mutants` has progressed to a point where we would now like to use it instead.

  Remove all the `mutagen` stuff.

  Close: #2829

ACKs for top commit:
  ndungudedan:
    tested ACK [7277092](7277092af4)
  apoelstra:
    ACK 7277092af44f44f59bdb6326561b0b47416cc085; successfully ran local tests

Tree-SHA512: bf271bbb30607cfc9970ed6b62e1671279517d6c14c165f063b1fcbef61f735916b1510cd2c10ff624bb8d031cb2783f9636bd7db4dadb6f7534e17db25cfcf2
This commit is contained in:
merge-script 2025-01-21 17:28:52 +00:00
commit aea7b1affe
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
7 changed files with 2 additions and 147 deletions

View File

@ -2,12 +2,6 @@
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 3
[[package]]
name = "anyhow"
version = "1.0.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc"
[[package]] [[package]]
name = "arbitrary" name = "arbitrary"
version = "1.4.1" version = "1.4.1"
@ -68,7 +62,6 @@ dependencies = [
"bitcoinconsensus", "bitcoinconsensus",
"hex-conservative 0.3.0", "hex-conservative 0.3.0",
"hex_lit", "hex_lit",
"mutagen",
"ordered", "ordered",
"secp256k1", "secp256k1",
"serde", "serde",
@ -118,7 +111,6 @@ dependencies = [
"bitcoin-units", "bitcoin-units",
"bitcoin_hashes 0.16.0", "bitcoin_hashes 0.16.0",
"hex-conservative 0.3.0", "hex-conservative 0.3.0",
"mutagen",
"ordered", "ordered",
"serde", "serde",
"serde_json", "serde_json",
@ -242,12 +234,6 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" checksum = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b"
[[package]]
name = "json"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd"
[[package]] [[package]]
name = "lazy_static" name = "lazy_static"
version = "1.4.0" version = "1.4.0"
@ -269,39 +255,6 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "mutagen"
version = "0.2.0"
source = "git+https://github.com/llogiq/mutagen#a6377c4c3f360afeb7a287c1c17e4b69456d5f53"
dependencies = [
"mutagen-core",
"mutagen-transform",
]
[[package]]
name = "mutagen-core"
version = "0.2.0"
source = "git+https://github.com/llogiq/mutagen#a6377c4c3f360afeb7a287c1c17e4b69456d5f53"
dependencies = [
"anyhow",
"json",
"lazy_static",
"proc-macro2",
"quote",
"serde",
"serde_json",
"syn",
]
[[package]]
name = "mutagen-transform"
version = "0.2.0"
source = "git+https://github.com/llogiq/mutagen#a6377c4c3f360afeb7a287c1c17e4b69456d5f53"
dependencies = [
"mutagen-core",
"proc-macro2",
]
[[package]] [[package]]
name = "ordered" name = "ordered"
version = "0.4.0" version = "0.4.0"

View File

@ -2,12 +2,6 @@
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 3
[[package]]
name = "anyhow"
version = "1.0.89"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6"
[[package]] [[package]]
name = "arbitrary" name = "arbitrary"
version = "1.4.1" version = "1.4.1"
@ -67,7 +61,6 @@ dependencies = [
"bitcoinconsensus", "bitcoinconsensus",
"hex-conservative 0.3.0", "hex-conservative 0.3.0",
"hex_lit", "hex_lit",
"mutagen",
"ordered", "ordered",
"secp256k1", "secp256k1",
"serde", "serde",
@ -117,7 +110,6 @@ dependencies = [
"bitcoin-units", "bitcoin-units",
"bitcoin_hashes 0.16.0", "bitcoin_hashes 0.16.0",
"hex-conservative 0.3.0", "hex-conservative 0.3.0",
"mutagen",
"ordered", "ordered",
"serde", "serde",
"serde_json", "serde_json",
@ -244,12 +236,6 @@ version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
[[package]]
name = "json"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd"
[[package]] [[package]]
name = "lazy_static" name = "lazy_static"
version = "1.5.0" version = "1.5.0"
@ -277,39 +263,6 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "mutagen"
version = "0.2.0"
source = "git+https://github.com/llogiq/mutagen#a6377c4c3f360afeb7a287c1c17e4b69456d5f53"
dependencies = [
"mutagen-core",
"mutagen-transform",
]
[[package]]
name = "mutagen-core"
version = "0.2.0"
source = "git+https://github.com/llogiq/mutagen#a6377c4c3f360afeb7a287c1c17e4b69456d5f53"
dependencies = [
"anyhow",
"json",
"lazy_static",
"proc-macro2",
"quote",
"serde",
"serde_json",
"syn 1.0.109",
]
[[package]]
name = "mutagen-transform"
version = "0.2.0"
source = "git+https://github.com/llogiq/mutagen#a6377c4c3f360afeb7a287c1c17e4b69456d5f53"
dependencies = [
"mutagen-core",
"proc-macro2",
]
[[package]] [[package]]
name = "ordered" name = "ordered"
version = "0.4.0" version = "0.4.0"
@ -432,7 +385,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.79", "syn",
] ]
[[package]] [[package]]
@ -462,17 +415,6 @@ version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "syn"
version = "1.0.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.79" version = "2.0.79"
@ -514,5 +456,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.79", "syn",
] ]

View File

@ -49,9 +49,6 @@ serde_test = "1.0.19"
bincode = "1.3.1" bincode = "1.3.1"
hex_lit = "0.1.1" hex_lit = "0.1.1"
[target.'cfg(mutate)'.dev-dependencies]
mutagen = { git = "https://github.com/llogiq/mutagen" }
[package.metadata.docs.rs] [package.metadata.docs.rs]
all-features = true all-features = true
rustdoc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"]

View File

@ -10,8 +10,6 @@ use core::{cmp, fmt};
use internals::impl_to_hex_from_lower_hex; use internals::impl_to_hex_from_lower_hex;
use io::{BufRead, Write}; use io::{BufRead, Write};
#[cfg(all(test, mutate))]
use mutagen::mutate;
use units::parse::{self, ParseIntError, PrefixedHexError, UnprefixedHexError}; use units::parse::{self, ParseIntError, PrefixedHexError, UnprefixedHexError};
use crate::block::{BlockHash, Header}; use crate::block::{BlockHash, Header};
@ -218,7 +216,6 @@ impl Target {
/// ///
/// Proof-of-work validity for a block requires the hash of the block to be less than or equal /// Proof-of-work validity for a block requires the hash of the block to be less than or equal
/// to the target. /// to the target.
#[cfg_attr(all(test, mutate), mutate)]
pub fn is_met_by(&self, hash: BlockHash) -> bool { pub fn is_met_by(&self, hash: BlockHash) -> bool {
let hash = U256::from_le_bytes(hash.to_byte_array()); let hash = U256::from_le_bytes(hash.to_byte_array());
hash <= self.0 hash <= self.0
@ -255,7 +252,6 @@ impl Target {
/// ///
/// [max]: Target::max /// [max]: Target::max
/// [target]: crate::block::HeaderExt::target /// [target]: crate::block::HeaderExt::target
#[cfg_attr(all(test, mutate), mutate)]
pub fn difficulty(&self, params: impl AsRef<Params>) -> u128 { pub fn difficulty(&self, params: impl AsRef<Params>) -> u128 {
// Panic here may be eaiser to debug than during the actual division. // Panic here may be eaiser to debug than during the actual division.
assert_ne!(self.0, U256::ZERO, "divide by zero"); assert_ne!(self.0, U256::ZERO, "divide by zero");
@ -274,7 +270,6 @@ impl Target {
/// Panics if `self` is zero (divide by zero). /// Panics if `self` is zero (divide by zero).
/// ///
/// [`difficulty`]: Target::difficulty /// [`difficulty`]: Target::difficulty
#[cfg_attr(all(test, mutate), mutate)]
pub fn difficulty_float(&self, params: impl AsRef<Params>) -> f64 { pub fn difficulty_float(&self, params: impl AsRef<Params>) -> f64 {
// We want to explicitly panic to be uniform with `difficulty()` // We want to explicitly panic to be uniform with `difficulty()`
// (float division by zero does not panic). // (float division by zero does not panic).
@ -499,7 +494,6 @@ impl U256 {
} }
/// Constructs a new `U256` from a big-endian array of `u8`s. /// Constructs a new `U256` from a big-endian array of `u8`s.
#[cfg_attr(all(test, mutate), mutate)]
fn from_be_bytes(a: [u8; 32]) -> U256 { fn from_be_bytes(a: [u8; 32]) -> U256 {
let (high, low) = split_in_half(a); let (high, low) = split_in_half(a);
let big = u128::from_be_bytes(high); let big = u128::from_be_bytes(high);
@ -508,7 +502,6 @@ impl U256 {
} }
/// Constructs a new `U256` from a little-endian array of `u8`s. /// Constructs a new `U256` from a little-endian array of `u8`s.
#[cfg_attr(all(test, mutate), mutate)]
fn from_le_bytes(a: [u8; 32]) -> U256 { fn from_le_bytes(a: [u8; 32]) -> U256 {
let (high, low) = split_in_half(a); let (high, low) = split_in_half(a);
let little = u128::from_le_bytes(high); let little = u128::from_le_bytes(high);
@ -517,7 +510,6 @@ impl U256 {
} }
/// Converts `U256` to a big-endian array of `u8`s. /// Converts `U256` to a big-endian array of `u8`s.
#[cfg_attr(all(test, mutate), mutate)]
fn to_be_bytes(self) -> [u8; 32] { fn to_be_bytes(self) -> [u8; 32] {
let mut out = [0; 32]; let mut out = [0; 32];
out[..16].copy_from_slice(&self.0.to_be_bytes()); out[..16].copy_from_slice(&self.0.to_be_bytes());
@ -526,7 +518,6 @@ impl U256 {
} }
/// Converts `U256` to a little-endian array of `u8`s. /// Converts `U256` to a little-endian array of `u8`s.
#[cfg_attr(all(test, mutate), mutate)]
fn to_le_bytes(self) -> [u8; 32] { fn to_le_bytes(self) -> [u8; 32] {
let mut out = [0; 32]; let mut out = [0; 32];
out[..16].copy_from_slice(&self.1.to_le_bytes()); out[..16].copy_from_slice(&self.1.to_le_bytes());
@ -558,13 +549,10 @@ impl U256 {
ret.wrapping_inc() ret.wrapping_inc()
} }
#[cfg_attr(all(test, mutate), mutate)]
fn is_zero(&self) -> bool { self.0 == 0 && self.1 == 0 } fn is_zero(&self) -> bool { self.0 == 0 && self.1 == 0 }
#[cfg_attr(all(test, mutate), mutate)]
fn is_one(&self) -> bool { self.0 == 0 && self.1 == 1 } fn is_one(&self) -> bool { self.0 == 0 && self.1 == 1 }
#[cfg_attr(all(test, mutate), mutate)]
fn is_max(&self) -> bool { self.0 == u128::MAX && self.1 == u128::MAX } fn is_max(&self) -> bool { self.0 == u128::MAX && self.1 == u128::MAX }
/// Returns the low 32 bits. /// Returns the low 32 bits.
@ -587,7 +575,6 @@ impl U256 {
} }
/// Returns the least number of bits needed to represent the number. /// Returns the least number of bits needed to represent the number.
#[cfg_attr(all(test, mutate), mutate)]
fn bits(&self) -> u32 { fn bits(&self) -> u32 {
if self.0 > 0 { if self.0 > 0 {
256 - self.0.leading_zeros() 256 - self.0.leading_zeros()
@ -602,9 +589,6 @@ impl U256 {
/// ///
/// The multiplication result along with a boolean indicating whether an arithmetic overflow /// The multiplication result along with a boolean indicating whether an arithmetic overflow
/// occurred. If an overflow occurred then the wrapped value is returned. /// occurred. If an overflow occurred then the wrapped value is returned.
// mutagen false pos mul_u64: replace `|` with `^` (XOR is same as OR when combined with <<)
// mutagen false pos mul_u64: replace `|` with `^`
#[cfg_attr(all(test, mutate), mutate)]
fn mul_u64(self, rhs: u64) -> (U256, bool) { fn mul_u64(self, rhs: u64) -> (U256, bool) {
let mut carry: u128 = 0; let mut carry: u128 = 0;
let mut split_le = let mut split_le =
@ -632,7 +616,6 @@ impl U256 {
/// # Panics /// # Panics
/// ///
/// If `rhs` is zero. /// If `rhs` is zero.
#[cfg_attr(all(test, mutate), mutate)]
fn div_rem(self, rhs: Self) -> (Self, Self) { fn div_rem(self, rhs: Self) -> (Self, Self) {
let mut sub_copy = self; let mut sub_copy = self;
let mut shift_copy = rhs; let mut shift_copy = rhs;
@ -672,7 +655,6 @@ impl U256 {
/// Returns a tuple of the addition along with a boolean indicating whether an arithmetic /// Returns a tuple of the addition along with a boolean indicating whether an arithmetic
/// overflow would occur. If an overflow would have occurred then the wrapped value is returned. /// overflow would occur. If an overflow would have occurred then the wrapped value is returned.
#[must_use = "this returns the result of the operation, without modifying the original"] #[must_use = "this returns the result of the operation, without modifying the original"]
#[cfg_attr(all(test, mutate), mutate)]
fn overflowing_add(self, rhs: Self) -> (Self, bool) { fn overflowing_add(self, rhs: Self) -> (Self, bool) {
let mut ret = U256::ZERO; let mut ret = U256::ZERO;
let mut ret_overflow = false; let mut ret_overflow = false;
@ -697,7 +679,6 @@ impl U256 {
/// Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic /// Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic
/// overflow would occur. If an overflow would have occurred then the wrapped value is returned. /// overflow would occur. If an overflow would have occurred then the wrapped value is returned.
#[must_use = "this returns the result of the operation, without modifying the original"] #[must_use = "this returns the result of the operation, without modifying the original"]
#[cfg_attr(all(test, mutate), mutate)]
fn overflowing_sub(self, rhs: Self) -> (Self, bool) { fn overflowing_sub(self, rhs: Self) -> (Self, bool) {
let ret = self.wrapping_add(!rhs).wrapping_add(Self::ONE); let ret = self.wrapping_add(!rhs).wrapping_add(Self::ONE);
let overflow = rhs > self; let overflow = rhs > self;
@ -710,7 +691,6 @@ impl U256 {
/// indicating whether an arithmetic overflow would occur. If an /// indicating whether an arithmetic overflow would occur. If an
/// overflow would have occurred then the wrapped value is returned. /// overflow would have occurred then the wrapped value is returned.
#[must_use = "this returns the result of the operation, without modifying the original"] #[must_use = "this returns the result of the operation, without modifying the original"]
#[cfg_attr(all(test, mutate), mutate)]
fn overflowing_mul(self, rhs: Self) -> (Self, bool) { fn overflowing_mul(self, rhs: Self) -> (Self, bool) {
let mut ret = U256::ZERO; let mut ret = U256::ZERO;
let mut ret_overflow = false; let mut ret_overflow = false;
@ -758,7 +738,6 @@ impl U256 {
/// Returns `self` incremented by 1 wrapping around at the boundary of the type. /// Returns `self` incremented by 1 wrapping around at the boundary of the type.
#[must_use = "this returns the result of the increment, without modifying the original"] #[must_use = "this returns the result of the increment, without modifying the original"]
#[cfg_attr(all(test, mutate), mutate)]
fn wrapping_inc(&self) -> U256 { fn wrapping_inc(&self) -> U256 {
let mut ret = U256::ZERO; let mut ret = U256::ZERO;
@ -778,7 +757,6 @@ impl U256 {
/// restricted to the range of the type, rather than the bits shifted out of the LHS being /// restricted to the range of the type, rather than the bits shifted out of the LHS being
/// returned to the other end. We do not currently support `rotate_left`. /// returned to the other end. We do not currently support `rotate_left`.
#[must_use = "this returns the result of the operation, without modifying the original"] #[must_use = "this returns the result of the operation, without modifying the original"]
#[cfg_attr(all(test, mutate), mutate)]
fn wrapping_shl(self, rhs: u32) -> Self { fn wrapping_shl(self, rhs: u32) -> Self {
let shift = rhs & 0x000000ff; let shift = rhs & 0x000000ff;
@ -805,7 +783,6 @@ impl U256 {
/// restricted to the range of the type, rather than the bits shifted out of the LHS being /// restricted to the range of the type, rather than the bits shifted out of the LHS being
/// returned to the other end. We do not currently support `rotate_right`. /// returned to the other end. We do not currently support `rotate_right`.
#[must_use = "this returns the result of the operation, without modifying the original"] #[must_use = "this returns the result of the operation, without modifying the original"]
#[cfg_attr(all(test, mutate), mutate)]
fn wrapping_shr(self, rhs: u32) -> Self { fn wrapping_shr(self, rhs: u32) -> Self {
let shift = rhs & 0x000000ff; let shift = rhs & 0x000000ff;

View File

@ -36,9 +36,6 @@ serde = { version = "1.0.103", default-features = false, features = ["derive", "
serde_json = "1.0.0" serde_json = "1.0.0"
bincode = "1.3.1" bincode = "1.3.1"
[target.'cfg(mutate)'.dev-dependencies]
mutagen = { git = "https://github.com/llogiq/mutagen" }
[package.metadata.docs.rs] [package.metadata.docs.rs]
all-features = true all-features = true
rustdoc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"]

View File

@ -10,8 +10,6 @@ use core::fmt;
#[cfg(feature = "arbitrary")] #[cfg(feature = "arbitrary")]
use arbitrary::{Arbitrary, Unstructured}; use arbitrary::{Arbitrary, Unstructured};
#[cfg(all(test, mutate))]
use mutagen::mutate;
use units::parse::{self, PrefixedHexError, UnprefixedHexError}; use units::parse::{self, PrefixedHexError, UnprefixedHexError};
#[cfg(all(doc, feature = "alloc"))] #[cfg(all(doc, feature = "alloc"))]
@ -214,7 +212,6 @@ impl LockTime {
/// } /// }
/// ```` /// ````
#[inline] #[inline]
#[cfg_attr(all(test, mutate), mutate)]
pub fn is_satisfied_by(&self, height: Height, time: Time) -> bool { pub fn is_satisfied_by(&self, height: Height, time: Time) -> bool {
use LockTime::*; use LockTime::*;
@ -244,7 +241,6 @@ impl LockTime {
/// assert!(lock_time.is_implied_by(check)); /// assert!(lock_time.is_implied_by(check));
/// ``` /// ```
#[inline] #[inline]
#[cfg_attr(all(test, mutate), mutate)]
pub fn is_implied_by(&self, other: LockTime) -> bool { pub fn is_implied_by(&self, other: LockTime) -> bool {
use LockTime::*; use LockTime::*;

View File

@ -9,9 +9,6 @@
use core::cmp::Ordering; use core::cmp::Ordering;
use core::{cmp, convert, fmt}; use core::{cmp, convert, fmt};
#[cfg(all(test, mutate))]
use mutagen::mutate;
use crate::Sequence; use crate::Sequence;
#[cfg(all(doc, feature = "alloc"))] #[cfg(all(doc, feature = "alloc"))]
use crate::{relative, TxIn}; use crate::{relative, TxIn};
@ -177,7 +174,6 @@ impl LockTime {
/// assert!(lock.is_satisfied_by(current_height(), current_time())); /// assert!(lock.is_satisfied_by(current_height(), current_time()));
/// ``` /// ```
#[inline] #[inline]
#[cfg_attr(all(test, mutate), mutate)]
pub fn is_satisfied_by(&self, h: Height, t: Time) -> bool { pub fn is_satisfied_by(&self, h: Height, t: Time) -> bool {
if let Ok(true) = self.is_satisfied_by_height(h) { if let Ok(true) = self.is_satisfied_by_height(h) {
true true
@ -216,7 +212,6 @@ impl LockTime {
/// assert!(satisfied); /// assert!(satisfied);
/// ``` /// ```
#[inline] #[inline]
#[cfg_attr(all(test, mutate), mutate)]
pub fn is_implied_by(&self, other: LockTime) -> bool { pub fn is_implied_by(&self, other: LockTime) -> bool {
use LockTime::*; use LockTime::*;
@ -258,7 +253,6 @@ impl LockTime {
/// assert!(lock.is_satisfied_by_height(Height::from(required_height + 1)).expect("a height")); /// assert!(lock.is_satisfied_by_height(Height::from(required_height + 1)).expect("a height"));
/// ``` /// ```
#[inline] #[inline]
#[cfg_attr(all(test, mutate), mutate)]
pub fn is_satisfied_by_height(&self, height: Height) -> Result<bool, IncompatibleHeightError> { pub fn is_satisfied_by_height(&self, height: Height) -> Result<bool, IncompatibleHeightError> {
use LockTime::*; use LockTime::*;
@ -285,7 +279,6 @@ impl LockTime {
/// assert!(lock.is_satisfied_by_time(Time::from_512_second_intervals(intervals + 10)).expect("a time")); /// assert!(lock.is_satisfied_by_time(Time::from_512_second_intervals(intervals + 10)).expect("a time"));
/// ``` /// ```
#[inline] #[inline]
#[cfg_attr(all(test, mutate), mutate)]
pub fn is_satisfied_by_time(&self, time: Time) -> Result<bool, IncompatibleTimeError> { pub fn is_satisfied_by_time(&self, time: Time) -> Result<bool, IncompatibleTimeError> {
use LockTime::*; use LockTime::*;