Skip to content

Commit

Permalink
Do not use blockdata:: in bitcoin paths
Browse files Browse the repository at this point in the history
  • Loading branch information
tcharding committed Jun 21, 2024
1 parent e67d92f commit 5d342eb
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion examples/sign_multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use std::collections::HashMap;
use std::str::FromStr;

use bitcoin::blockdata::witness::Witness;
use bitcoin::witness::Witness;
use bitcoin::{absolute, ecdsa, transaction, Amount, Sequence};

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion fuzz/fuzz_targets/roundtrip_miniscript_script.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![allow(unexpected_cfgs)]

use honggfuzz::fuzz;
use miniscript::bitcoin::blockdata::script;
use miniscript::bitcoin::script;
use miniscript::{Miniscript, Segwitv0};

fn do_test(data: &[u8]) {
Expand Down
8 changes: 3 additions & 5 deletions src/descriptor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,13 +1000,11 @@ pub(crate) use write_descriptor;
mod tests {
use core::convert::TryFrom;

use bitcoin::blockdata::opcodes::all::{OP_CLTV, OP_CSV};
use bitcoin::blockdata::script::Instruction;
use bitcoin::blockdata::{opcodes, script};
use bitcoin::hashes::hex::FromHex;
use bitcoin::script::PushBytes;
use bitcoin::opcodes::all::{OP_CLTV, OP_CSV};
use bitcoin::script::{Instruction, PushBytes};
use bitcoin::sighash::EcdsaSighashType;
use bitcoin::{bip32, PublicKey, Sequence};
use bitcoin::{bip32, opcodes, script, PublicKey, Sequence};

use super::checksum::desc_checksum;
use super::*;
Expand Down
2 changes: 1 addition & 1 deletion src/descriptor/tr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ impl<Pk: MiniscriptKey + ToPublicKey> Tr<Pk> {
/// Obtains the corresponding script pubkey for this descriptor.
pub fn script_pubkey(&self) -> ScriptBuf {
let output_key = self.spend_info().output_key();
let builder = bitcoin::blockdata::script::Builder::new();
let builder = bitcoin::script::Builder::new();
builder
.push_opcode(opcodes::all::OP_PUSHNUM_1)
.push_slice(output_key.serialize())
Expand Down
3 changes: 1 addition & 2 deletions src/interpreter/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,9 @@ mod tests {
use core::convert::TryFrom;
use core::str::FromStr;

use bitcoin::blockdata::script;
use bitcoin::hashes::hex::FromHex;
use bitcoin::script::PushBytes;
use bitcoin::ScriptBuf;
use bitcoin::{script, ScriptBuf};

use super::*;

Expand Down
5 changes: 2 additions & 3 deletions src/interpreter/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

//! Interpreter stack

use bitcoin::blockdata::{opcodes, script};
use bitcoin::hashes::{hash160, ripemd160, sha256};
use bitcoin::{absolute, relative, Sequence};
use bitcoin::{absolute, opcodes, relative, script, Sequence};

use super::error::PkEvalErrInner;
use super::{verify_sersig, BitcoinKey, Error, HashLockType, KeySigPair, SatisfiedConstraint};
Expand Down Expand Up @@ -50,7 +49,7 @@ impl<'txin> Element<'txin> {
///
/// Supports `OP_1` but no other numbers since these are not used by Miniscript
pub fn from_instruction(
ins: Result<script::Instruction<'txin>, bitcoin::blockdata::script::Error>,
ins: Result<script::Instruction<'txin>, bitcoin::script::Error>,
) -> Result<Self, Error> {
match ins {
//Also covers the dissatisfied case as PushBytes0
Expand Down
2 changes: 1 addition & 1 deletion src/miniscript/lex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

use core::fmt;

use bitcoin::blockdata::{opcodes, script};
use bitcoin::{opcodes, script};

use super::Error;
use crate::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion src/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ impl Plan {
&self,
stfr: &Sat,
) -> Result<(Vec<Vec<u8>>, ScriptBuf), Error> {
use bitcoin::blockdata::script::Builder;
use bitcoin::script::Builder;

let stack = self
.template
Expand Down
3 changes: 1 addition & 2 deletions src/policy/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1200,8 +1200,7 @@ where
mod tests {
use core::str::FromStr;

use bitcoin::blockdata::{opcodes, script};
use bitcoin::hashes;
use bitcoin::{hashes, opcodes, script};

use super::*;
use crate::miniscript::{Legacy, Segwitv0, Tap};
Expand Down

0 comments on commit 5d342eb

Please sign in to comment.