You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let s = "tr([83737d5e/86h/1h/0h]tpubDDR5GgtoxS8fJyjjvdahN4VzV5DV6jtbcyvVXhEKq2XtpxjxBXmxH3r8QrNbQqHg4bJM1EGkxi7Pjfkgnui9jQWqS7kxHvX6rhUeriLDKxz/0/*)";
251
+
let desc = Descriptor::parse_descriptor(&secp, s).unwrap().0;
252
+
let def_desc = desc.at_derivation_index(0).unwrap();
253
+
let script_pubkey = def_desc.script_pubkey();
254
+
let desc_pk:DescriptorPublicKey = "[83737d5e/86h/1h/0h]tpubDDR5GgtoxS8fJyjjvdahN4VzV5DV6jtbcyvVXhEKq2XtpxjxBXmxH3r8QrNbQqHg4bJM1EGkxi7Pjfkgnui9jQWqS7kxHvX6rhUeriLDKxz/0/*".parse()?;
255
+
let assets = Assets::new().add(desc_pk);
256
+
let plan = def_desc.plan(&assets).expect("failed to create plan");
257
+
258
+
let prev_tx = Transaction{
259
+
version: transaction::Version::TWO,
260
+
lock_time: absolute::LockTime::ZERO,
261
+
input:vec![TxIn::default()],
262
+
output:vec![TxOut{
263
+
script_pubkey,
264
+
value:Amount::from_sat(10_000),
265
+
}],
266
+
};
267
+
268
+
// Assume the current height is 2500, and previous tx confirms at height 2000.
0 commit comments