Skip to content

Commit da0cbd2

Browse files
committed
Use from_mtp instead of from_time
1 parent a3a8373 commit da0cbd2

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

examples/taptree_of_horror/taptree_of_horror.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ fn main() {
228228

229229
let unsigned_tx = bitcoin::Transaction {
230230
version: Version::TWO,
231-
lock_time: LockTime::from_time(time).unwrap(),
231+
lock_time: LockTime::from_mtp(time).unwrap(),
232232
inputs: vec![tx_in],
233233
outputs: vec![destination_output],
234234
};

src/descriptor/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,6 @@ mod tests {
11101110
use bitcoin::blockdata::{opcodes, script};
11111111
use bitcoin::script::{PushBytes, ScriptPubKeyBuf, ScriptSigBuf, WitnessScriptExt, ScriptExt, ScriptBufExt};
11121112
use bitcoin::sighash::EcdsaSighashType;
1113-
use bitcoin::ext::*;
11141113
use bitcoin::{bip32, PublicKey, Sequence, XOnlyPublicKey};
11151114

11161115
use super::{checksum, *};

src/plan.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ mod test {
945945
vec![0, 1],
946946
vec![],
947947
None,
948-
Some(absolute::LockTime::from_time(500_001_000).unwrap()),
948+
Some(absolute::LockTime::from_mtp(500_001_000).unwrap()),
949949
Some(153),
950950
), // incompatible timelock
951951
];
@@ -1047,7 +1047,7 @@ mod test {
10471047
vec![4],
10481048
vec![],
10491049
None,
1050-
Some(absolute::LockTime::from_time(1296000000).unwrap()),
1050+
Some(absolute::LockTime::from_mtp(1296000000).unwrap()),
10511051
None,
10521052
),
10531053
// Spend with third leaf (key + timelock),

src/policy/semantic.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ mod tests {
896896
assert_eq!(
897897
policy
898898
.clone()
899-
.at_lock_time(absolute::LockTime::from_time(500_000_001).expect("valid timestamp")),
899+
.at_lock_time(absolute::LockTime::from_mtp(500_000_001).expect("valid timestamp")),
900900
Policy::Unsatisfiable
901901
);
902902
assert_eq!(policy.n_keys(), 0);
@@ -931,25 +931,25 @@ mod tests {
931931
assert_eq!(
932932
policy
933933
.clone()
934-
.at_lock_time(absolute::LockTime::from_time(500_000_000).expect("valid timestamp")),
934+
.at_lock_time(absolute::LockTime::from_mtp(500_000_000).expect("valid timestamp")),
935935
Policy::Unsatisfiable
936936
);
937937
assert_eq!(
938938
policy
939939
.clone()
940-
.at_lock_time(absolute::LockTime::from_time(500_000_001).expect("valid timestamp")),
940+
.at_lock_time(absolute::LockTime::from_mtp(500_000_001).expect("valid timestamp")),
941941
Policy::Unsatisfiable
942942
);
943943
assert_eq!(
944944
policy
945945
.clone()
946-
.at_lock_time(absolute::LockTime::from_time(500_000_010).expect("valid timestamp")),
946+
.at_lock_time(absolute::LockTime::from_mtp(500_000_010).expect("valid timestamp")),
947947
policy
948948
);
949949
assert_eq!(
950950
policy
951951
.clone()
952-
.at_lock_time(absolute::LockTime::from_time(500_000_012).expect("valid timestamp")),
952+
.at_lock_time(absolute::LockTime::from_mtp(500_000_012).expect("valid timestamp")),
953953
policy
954954
);
955955
assert_eq!(policy.n_keys(), 0);

0 commit comments

Comments
 (0)