From 4909d3cd6a05dfcba39fe08e6d8f539944c8ef66 Mon Sep 17 00:00:00 2001 From: "Dr. Maxim Orlovsky" Date: Mon, 27 Apr 2020 16:41:54 +0200 Subject: [PATCH] Bitcoin deps refactoring (BDR): Linearizing bitcoin_hash deps --- fuzz/src/chanmon_consistency.rs | 8 ++++---- fuzz/src/chanmon_deser.rs | 2 +- fuzz/src/full_stack.rs | 12 ++++++------ fuzz/src/router.rs | 2 +- lightning-net-tokio/Cargo.toml | 1 - lightning/Cargo.toml | 3 +-- lightning/src/chain/chaininterface.rs | 2 +- lightning/src/chain/keysinterface.rs | 10 +++++----- lightning/src/chain/transaction.rs | 2 +- lightning/src/lib.rs | 1 - lightning/src/ln/chan_utils.rs | 10 +++++----- lightning/src/ln/chanmon_update_fail_tests.rs | 4 ++-- lightning/src/ln/channel.rs | 18 +++++++++--------- lightning/src/ln/channelmanager.rs | 10 +++++----- lightning/src/ln/channelmonitor.rs | 16 ++++++++-------- lightning/src/ln/functional_test_utils.rs | 6 +++--- lightning/src/ln/functional_tests.rs | 6 +++--- lightning/src/ln/msgs.rs | 6 +++--- lightning/src/ln/onchaintx.rs | 2 +- lightning/src/ln/onion_utils.rs | 8 ++++---- lightning/src/ln/peer_channel_encryptor.rs | 4 ++-- lightning/src/ln/peer_handler.rs | 6 +++--- lightning/src/ln/router.rs | 8 ++++---- lightning/src/util/chacha20poly1305rfc.rs | 2 +- lightning/src/util/macro_logger.rs | 2 +- lightning/src/util/ser.rs | 4 ++-- lightning/src/util/test_utils.rs | 2 +- 27 files changed, 77 insertions(+), 80 deletions(-) diff --git a/fuzz/src/chanmon_consistency.rs b/fuzz/src/chanmon_consistency.rs index fcc88454f..344d099ff 100644 --- a/fuzz/src/chanmon_consistency.rs +++ b/fuzz/src/chanmon_consistency.rs @@ -16,10 +16,10 @@ use bitcoin::blockdata::script::{Builder, Script}; use bitcoin::blockdata::opcodes; use bitcoin::network::constants::Network; -use bitcoin_hashes::Hash as TraitImport; -use bitcoin_hashes::hash160::Hash as Hash160; -use bitcoin_hashes::sha256::Hash as Sha256; -use bitcoin_hashes::sha256d::Hash as Sha256d; +use bitcoin::hashes::Hash as TraitImport; +use bitcoin::hashes::hash160::Hash as Hash160; +use bitcoin::hashes::sha256::Hash as Sha256; +use bitcoin::hashes::sha256d::Hash as Sha256d; use lightning::chain::chaininterface; use lightning::chain::transaction::OutPoint; diff --git a/fuzz/src/chanmon_deser.rs b/fuzz/src/chanmon_deser.rs index abff1319a..45da43c0b 100644 --- a/fuzz/src/chanmon_deser.rs +++ b/fuzz/src/chanmon_deser.rs @@ -1,7 +1,7 @@ // This file is auto-generated by gen_target.sh based on msg_target_template.txt // To modify it, modify msg_target_template.txt and run gen_target.sh instead. -use bitcoin_hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; use lightning::util::enforcing_trait_impls::EnforcingChannelKeys; use lightning::ln::channelmonitor; diff --git a/fuzz/src/full_stack.rs b/fuzz/src/full_stack.rs index 76953548e..d8b58264e 100644 --- a/fuzz/src/full_stack.rs +++ b/fuzz/src/full_stack.rs @@ -12,11 +12,11 @@ use bitcoin::consensus::encode::deserialize; use bitcoin::network::constants::Network; use bitcoin::util::hash::BitcoinHash; -use bitcoin_hashes::Hash as TraitImport; -use bitcoin_hashes::HashEngine as TraitImportEngine; -use bitcoin_hashes::sha256::Hash as Sha256; -use bitcoin_hashes::hash160::Hash as Hash160; -use bitcoin_hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::Hash as TraitImport; +use bitcoin::hashes::HashEngine as TraitImportEngine; +use bitcoin::hashes::sha256::Hash as Sha256; +use bitcoin::hashes::hash160::Hash as Hash160; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; use lightning::chain::chaininterface::{BroadcasterInterface,ConfirmationTarget,ChainListener,FeeEstimator,ChainWatchInterfaceUtil}; use lightning::chain::transaction::OutPoint; @@ -241,7 +241,7 @@ impl KeysInterface for KeyProvider { fn get_destination_script(&self) -> Script { let secp_ctx = Secp256k1::signing_only(); let channel_monitor_claim_key = SecretKey::from_slice(&hex::decode("0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").unwrap()[..]).unwrap(); - let our_channel_monitor_claim_key_hash = ::hash(&PublicKey::from_secret_key(&secp_ctx, &channel_monitor_claim_key).serialize()); + let our_channel_monitor_claim_key_hash = ::hash(&PublicKey::from_secret_key(&secp_ctx, &channel_monitor_claim_key).serialize()); Builder::new().push_opcode(opcodes::all::OP_PUSHBYTES_0).push_slice(&our_channel_monitor_claim_key_hash[..]).into_script() } diff --git a/fuzz/src/router.rs b/fuzz/src/router.rs index 7dcf1de72..83e9a6abd 100644 --- a/fuzz/src/router.rs +++ b/fuzz/src/router.rs @@ -1,4 +1,4 @@ -use bitcoin_hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; use bitcoin::blockdata::script::{Script, Builder}; use bitcoin::blockdata::block::Block; use bitcoin::blockdata::transaction::Transaction; diff --git a/lightning-net-tokio/Cargo.toml b/lightning-net-tokio/Cargo.toml index adfedea7b..20d8509ce 100644 --- a/lightning-net-tokio/Cargo.toml +++ b/lightning-net-tokio/Cargo.toml @@ -11,7 +11,6 @@ For Rust-Lightning clients which wish to make direct connections to Lightning P2 [dependencies] bitcoin = "0.21" -bitcoin_hashes = "0.7" lightning = { version = "0.0.11", path = "../lightning" } secp256k1 = "0.15" tokio = { version = ">=0.2.12", features = [ "io-util", "macros", "rt-core", "sync", "tcp", "time" ] } diff --git a/lightning/Cargo.toml b/lightning/Cargo.toml index 96680b56e..406e039d6 100644 --- a/lightning/Cargo.toml +++ b/lightning/Cargo.toml @@ -13,7 +13,7 @@ Still missing tons of error-handling. See GitHub issues for suggested projects i [features] # Supports tracking channels with a non-bitcoin chain hashes. Currently enables all kinds of fun DoS attacks. non_bitcoin_chain_hash_routing = [] -fuzztarget = ["secp256k1/fuzztarget", "bitcoin/fuzztarget", "bitcoin_hashes/fuzztarget"] +fuzztarget = ["secp256k1/fuzztarget", "bitcoin/fuzztarget"] # Unlog messages superior at targeted level. max_level_off = [] max_level_error = [] @@ -23,7 +23,6 @@ max_level_debug = [] [dependencies] bitcoin = "0.21" -bitcoin_hashes = "0.7" secp256k1 = "0.15" [dev-dependencies.bitcoin] diff --git a/lightning/src/chain/chaininterface.rs b/lightning/src/chain/chaininterface.rs index b30ebc1ee..f49723655 100644 --- a/lightning/src/chain/chaininterface.rs +++ b/lightning/src/chain/chaininterface.rs @@ -9,7 +9,7 @@ use bitcoin::blockdata::transaction::Transaction; use bitcoin::blockdata::script::Script; use bitcoin::blockdata::constants::genesis_block; use bitcoin::util::hash::BitcoinHash; -use bitcoin_hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; use bitcoin::network::constants::Network; use util::logger::Logger; diff --git a/lightning/src/chain/keysinterface.rs b/lightning/src/chain/keysinterface.rs index 73c22684c..daee746be 100644 --- a/lightning/src/chain/keysinterface.rs +++ b/lightning/src/chain/keysinterface.rs @@ -9,11 +9,11 @@ use bitcoin::network::constants::Network; use bitcoin::util::bip32::{ExtendedPrivKey, ExtendedPubKey, ChildNumber}; use bitcoin::util::bip143; -use bitcoin_hashes::{Hash, HashEngine}; -use bitcoin_hashes::sha256::HashEngine as Sha256State; -use bitcoin_hashes::sha256::Hash as Sha256; -use bitcoin_hashes::sha256d::Hash as Sha256dHash; -use bitcoin_hashes::hash160::Hash as Hash160; +use bitcoin::hashes::{Hash, HashEngine}; +use bitcoin::hashes::sha256::HashEngine as Sha256State; +use bitcoin::hashes::sha256::Hash as Sha256; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::hash160::Hash as Hash160; use secp256k1::key::{SecretKey, PublicKey}; use secp256k1::{Secp256k1, Signature, Signing}; diff --git a/lightning/src/chain/transaction.rs b/lightning/src/chain/transaction.rs index 0f479ff91..df45d786b 100644 --- a/lightning/src/chain/transaction.rs +++ b/lightning/src/chain/transaction.rs @@ -1,6 +1,6 @@ //! Contains simple structs describing parts of transactions on the chain. -use bitcoin_hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; use bitcoin::blockdata::transaction::OutPoint as BitcoinOutPoint; /// A reference to a transaction output. diff --git a/lightning/src/lib.rs b/lightning/src/lib.rs index 68924b57a..431caa608 100644 --- a/lightning/src/lib.rs +++ b/lightning/src/lib.rs @@ -19,7 +19,6 @@ #![allow(ellipsis_inclusive_range_patterns)] extern crate bitcoin; -extern crate bitcoin_hashes; extern crate secp256k1; #[cfg(test)] extern crate rand; #[cfg(test)] extern crate hex; diff --git a/lightning/src/ln/chan_utils.rs b/lightning/src/ln/chan_utils.rs index 62d310333..fca166b4a 100644 --- a/lightning/src/ln/chan_utils.rs +++ b/lightning/src/ln/chan_utils.rs @@ -8,11 +8,11 @@ use bitcoin::blockdata::transaction::{TxIn,TxOut,OutPoint,Transaction, SigHashTy use bitcoin::consensus::encode::{self, Decodable, Encodable}; use bitcoin::util::bip143; -use bitcoin_hashes::{Hash, HashEngine}; -use bitcoin_hashes::sha256::Hash as Sha256; -use bitcoin_hashes::ripemd160::Hash as Ripemd160; -use bitcoin_hashes::hash160::Hash as Hash160; -use bitcoin_hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::{Hash, HashEngine}; +use bitcoin::hashes::sha256::Hash as Sha256; +use bitcoin::hashes::ripemd160::Hash as Ripemd160; +use bitcoin::hashes::hash160::Hash as Hash160; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; use ln::channelmanager::{PaymentHash, PaymentPreimage}; use ln::msgs::DecodeError; diff --git a/lightning/src/ln/chanmon_update_fail_tests.rs b/lightning/src/ln/chanmon_update_fail_tests.rs index 4cce9fcd2..adf53b0d5 100644 --- a/lightning/src/ln/chanmon_update_fail_tests.rs +++ b/lightning/src/ln/chanmon_update_fail_tests.rs @@ -12,8 +12,8 @@ use ln::msgs::{ChannelMessageHandler, ErrorAction, RoutingMessageHandler}; use util::events::{Event, EventsProvider, MessageSendEvent, MessageSendEventsProvider}; use util::errors::APIError; -use bitcoin_hashes::sha256::Hash as Sha256; -use bitcoin_hashes::Hash; +use bitcoin::hashes::sha256::Hash as Sha256; +use bitcoin::hashes::Hash; use ln::functional_test_utils::*; diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index 35e688a0d..68a697ddd 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -6,10 +6,10 @@ use bitcoin::util::hash::BitcoinHash; use bitcoin::util::bip143; use bitcoin::consensus::encode; -use bitcoin_hashes::{Hash, HashEngine}; -use bitcoin_hashes::sha256::Hash as Sha256; -use bitcoin_hashes::hash160::Hash as Hash160; -use bitcoin_hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::{Hash, HashEngine}; +use bitcoin::hashes::sha256::Hash as Sha256; +use bitcoin::hashes::hash160::Hash as Hash160; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; use secp256k1::key::{PublicKey,SecretKey}; use secp256k1::{Secp256k1,Signature}; @@ -4291,7 +4291,7 @@ mod tests { use bitcoin::blockdata::constants::genesis_block; use bitcoin::blockdata::opcodes; use bitcoin::network::constants::Network; - use bitcoin_hashes::hex::FromHex; + use bitcoin::hashes::hex::FromHex; use hex; use ln::channelmanager::{HTLCSource, PaymentPreimage, PaymentHash}; use ln::channel::{Channel,ChannelKeys,InboundHTLCOutput,OutboundHTLCOutput,InboundHTLCState,OutboundHTLCState,HTLCOutputInCommitment,TxCreationKeys}; @@ -4309,10 +4309,10 @@ mod tests { use util::logger::Logger; use secp256k1::{Secp256k1, Message, Signature, All}; use secp256k1::key::{SecretKey,PublicKey}; - use bitcoin_hashes::sha256::Hash as Sha256; - use bitcoin_hashes::sha256d::Hash as Sha256dHash; - use bitcoin_hashes::hash160::Hash as Hash160; - use bitcoin_hashes::Hash; + use bitcoin::hashes::sha256::Hash as Sha256; + use bitcoin::hashes::sha256d::Hash as Sha256dHash; + use bitcoin::hashes::hash160::Hash as Hash160; + use bitcoin::hashes::Hash; use std::sync::Arc; use rand::{thread_rng,Rng}; diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index f347c279f..83ff133eb 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -14,11 +14,11 @@ use bitcoin::blockdata::constants::genesis_block; use bitcoin::network::constants::Network; use bitcoin::util::hash::BitcoinHash; -use bitcoin_hashes::{Hash, HashEngine}; -use bitcoin_hashes::hmac::{Hmac, HmacEngine}; -use bitcoin_hashes::sha256::Hash as Sha256; -use bitcoin_hashes::sha256d::Hash as Sha256dHash; -use bitcoin_hashes::cmp::fixed_time_eq; +use bitcoin::hashes::{Hash, HashEngine}; +use bitcoin::hashes::hmac::{Hmac, HmacEngine}; +use bitcoin::hashes::sha256::Hash as Sha256; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::cmp::fixed_time_eq; use secp256k1::key::{SecretKey,PublicKey}; use secp256k1::Secp256k1; diff --git a/lightning/src/ln/channelmonitor.rs b/lightning/src/ln/channelmonitor.rs index c417671ec..86a8591eb 100644 --- a/lightning/src/ln/channelmonitor.rs +++ b/lightning/src/ln/channelmonitor.rs @@ -19,10 +19,10 @@ use bitcoin::blockdata::opcodes; use bitcoin::consensus::encode; use bitcoin::util::hash::BitcoinHash; -use bitcoin_hashes::Hash; -use bitcoin_hashes::sha256::Hash as Sha256; -use bitcoin_hashes::hash160::Hash as Hash160; -use bitcoin_hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::Hash; +use bitcoin::hashes::sha256::Hash as Sha256; +use bitcoin::hashes::hash160::Hash as Hash160; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; use secp256k1::{Secp256k1,Signature}; use secp256k1::key::{SecretKey,PublicKey}; @@ -2518,10 +2518,10 @@ mod tests { use bitcoin::blockdata::transaction::{Transaction, TxIn, TxOut, SigHashType}; use bitcoin::blockdata::transaction::OutPoint as BitcoinOutPoint; use bitcoin::util::bip143; - use bitcoin_hashes::Hash; - use bitcoin_hashes::sha256::Hash as Sha256; - use bitcoin_hashes::sha256d::Hash as Sha256dHash; - use bitcoin_hashes::hex::FromHex; + use bitcoin::hashes::Hash; + use bitcoin::hashes::sha256::Hash as Sha256; + use bitcoin::hashes::sha256d::Hash as Sha256dHash; + use bitcoin::hashes::hex::FromHex; use hex; use chain::transaction::OutPoint; use ln::channelmanager::{PaymentPreimage, PaymentHash}; diff --git a/lightning/src/ln/functional_test_utils.rs b/lightning/src/ln/functional_test_utils.rs index 91365d5a2..e59e5339e 100644 --- a/lightning/src/ln/functional_test_utils.rs +++ b/lightning/src/ln/functional_test_utils.rs @@ -24,9 +24,9 @@ use bitcoin::blockdata::block::BlockHeader; use bitcoin::blockdata::transaction::{Transaction, TxOut}; use bitcoin::network::constants::Network; -use bitcoin_hashes::sha256::Hash as Sha256; -use bitcoin_hashes::sha256d::Hash as Sha256d; -use bitcoin_hashes::Hash; +use bitcoin::hashes::sha256::Hash as Sha256; +use bitcoin::hashes::sha256d::Hash as Sha256d; +use bitcoin::hashes::Hash; use secp256k1::Secp256k1; use secp256k1::key::PublicKey; diff --git a/lightning/src/ln/functional_tests.rs b/lightning/src/ln/functional_tests.rs index 267d4bbdc..b91e0f8b7 100644 --- a/lightning/src/ln/functional_tests.rs +++ b/lightning/src/ln/functional_tests.rs @@ -25,7 +25,7 @@ use util::config::UserConfig; use util::logger::Logger; use bitcoin::util::hash::BitcoinHash; -use bitcoin_hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; use bitcoin::util::bip143; use bitcoin::util::address::Address; use bitcoin::util::bip32::{ChildNumber, ExtendedPubKey, ExtendedPrivKey}; @@ -36,8 +36,8 @@ use bitcoin::blockdata::opcodes; use bitcoin::blockdata::constants::genesis_block; use bitcoin::network::constants::Network; -use bitcoin_hashes::sha256::Hash as Sha256; -use bitcoin_hashes::Hash; +use bitcoin::hashes::sha256::Hash as Sha256; +use bitcoin::hashes::Hash; use secp256k1::{Secp256k1, Message}; use secp256k1::key::{PublicKey,SecretKey}; diff --git a/lightning/src/ln/msgs.rs b/lightning/src/ln/msgs.rs index b17b4aa08..310aea52a 100644 --- a/lightning/src/ln/msgs.rs +++ b/lightning/src/ln/msgs.rs @@ -18,7 +18,7 @@ use secp256k1::key::PublicKey; use secp256k1::Signature; use secp256k1; -use bitcoin_hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; use bitcoin::blockdata::script::Script; use ln::features::{ChannelFeatures, InitFeatures, NodeFeatures}; @@ -1360,8 +1360,8 @@ mod tests { use ln::channelmanager::{PaymentPreimage, PaymentHash, PaymentSecret}; use util::ser::{Writeable, Readable}; - use bitcoin_hashes::sha256d::Hash as Sha256dHash; - use bitcoin_hashes::hex::FromHex; + use bitcoin::hashes::sha256d::Hash as Sha256dHash; + use bitcoin::hashes::hex::FromHex; use bitcoin::util::address::Address; use bitcoin::network::constants::Network; use bitcoin::blockdata::script::Builder; diff --git a/lightning/src/ln/onchaintx.rs b/lightning/src/ln/onchaintx.rs index 49572f2cb..531f7cd8b 100644 --- a/lightning/src/ln/onchaintx.rs +++ b/lightning/src/ln/onchaintx.rs @@ -8,7 +8,7 @@ use bitcoin::blockdata::transaction::OutPoint as BitcoinOutPoint; use bitcoin::blockdata::script::Script; use bitcoin::util::bip143; -use bitcoin_hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; use secp256k1::{Secp256k1, Signature}; use secp256k1; diff --git a/lightning/src/ln/onion_utils.rs b/lightning/src/ln/onion_utils.rs index dc3b2f902..2783c90c6 100644 --- a/lightning/src/ln/onion_utils.rs +++ b/lightning/src/ln/onion_utils.rs @@ -7,10 +7,10 @@ use util::errors::{self, APIError}; use util::ser::{Readable, Writeable, LengthCalculatingWriter}; use util::logger::{Logger, LogHolder}; -use bitcoin_hashes::{Hash, HashEngine}; -use bitcoin_hashes::cmp::fixed_time_eq; -use bitcoin_hashes::hmac::{Hmac, HmacEngine}; -use bitcoin_hashes::sha256::Hash as Sha256; +use bitcoin::hashes::{Hash, HashEngine}; +use bitcoin::hashes::cmp::fixed_time_eq; +use bitcoin::hashes::hmac::{Hmac, HmacEngine}; +use bitcoin::hashes::sha256::Hash as Sha256; use secp256k1::key::{SecretKey,PublicKey}; use secp256k1::Secp256k1; diff --git a/lightning/src/ln/peer_channel_encryptor.rs b/lightning/src/ln/peer_channel_encryptor.rs index 7e84e329e..9585887d5 100644 --- a/lightning/src/ln/peer_channel_encryptor.rs +++ b/lightning/src/ln/peer_channel_encryptor.rs @@ -1,8 +1,8 @@ use ln::msgs::LightningError; use ln::msgs; -use bitcoin_hashes::{Hash, HashEngine, Hmac, HmacEngine}; -use bitcoin_hashes::sha256::Hash as Sha256; +use bitcoin::hashes::{Hash, HashEngine, Hmac, HmacEngine}; +use bitcoin::hashes::sha256::Hash as Sha256; use secp256k1::Secp256k1; use secp256k1::key::{PublicKey,SecretKey}; diff --git a/lightning/src/ln/peer_handler.rs b/lightning/src/ln/peer_handler.rs index 15fa105d0..8005a40c1 100644 --- a/lightning/src/ln/peer_handler.rs +++ b/lightning/src/ln/peer_handler.rs @@ -26,9 +26,9 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use std::{cmp,error,hash,fmt}; use std::ops::Deref; -use bitcoin_hashes::sha256::Hash as Sha256; -use bitcoin_hashes::sha256::HashEngine as Sha256Engine; -use bitcoin_hashes::{HashEngine, Hash}; +use bitcoin::hashes::sha256::Hash as Sha256; +use bitcoin::hashes::sha256::HashEngine as Sha256Engine; +use bitcoin::hashes::{HashEngine, Hash}; /// Provides references to trait impls which handle different types of messages. pub struct MessageHandler where CM::Target: msgs::ChannelMessageHandler { diff --git a/lightning/src/ln/router.rs b/lightning/src/ln/router.rs index c7ebe86d7..bdb6f9828 100644 --- a/lightning/src/ln/router.rs +++ b/lightning/src/ln/router.rs @@ -7,8 +7,8 @@ use secp256k1::key::PublicKey; use secp256k1::Secp256k1; use secp256k1; -use bitcoin_hashes::sha256d::Hash as Sha256dHash; -use bitcoin_hashes::Hash; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::Hash; use bitcoin::blockdata::script::Builder; use bitcoin::blockdata::opcodes; @@ -1085,8 +1085,8 @@ mod tests { use util::logger::Logger; use util::ser::{Writeable, Readable}; - use bitcoin_hashes::sha256d::Hash as Sha256dHash; - use bitcoin_hashes::Hash; + use bitcoin::hashes::sha256d::Hash as Sha256dHash; + use bitcoin::hashes::Hash; use bitcoin::network::constants::Network; use bitcoin::blockdata::constants::genesis_block; use bitcoin::blockdata::script::Builder; diff --git a/lightning/src/util/chacha20poly1305rfc.rs b/lightning/src/util/chacha20poly1305rfc.rs index 1d3af1ea3..622af70ac 100644 --- a/lightning/src/util/chacha20poly1305rfc.rs +++ b/lightning/src/util/chacha20poly1305rfc.rs @@ -14,7 +14,7 @@ mod real_chachapoly { use util::chacha20::ChaCha20; use util::poly1305::Poly1305; - use bitcoin_hashes::cmp::fixed_time_eq; + use bitcoin::hashes::cmp::fixed_time_eq; use util::byte_utils; diff --git a/lightning/src/util/macro_logger.rs b/lightning/src/util/macro_logger.rs index bee0f0d26..f02fced7f 100644 --- a/lightning/src/util/macro_logger.rs +++ b/lightning/src/util/macro_logger.rs @@ -1,7 +1,7 @@ use chain::transaction::OutPoint; use chain::keysinterface::SpendableOutputDescriptor; -use bitcoin_hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; use bitcoin::blockdata::transaction::Transaction; use secp256k1::key::PublicKey; diff --git a/lightning/src/util/ser.rs b/lightning/src/util/ser.rs index 5a68f7a5e..0f05dfe1a 100644 --- a/lightning/src/util/ser.rs +++ b/lightning/src/util/ser.rs @@ -14,7 +14,7 @@ use bitcoin::blockdata::script::Script; use bitcoin::blockdata::transaction::{OutPoint, Transaction, TxOut}; use bitcoin::consensus; use bitcoin::consensus::Encodable; -use bitcoin_hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; use std::marker::Sized; use ln::msgs::DecodeError; use ln::channelmanager::{PaymentPreimage, PaymentHash, PaymentSecret}; @@ -542,7 +542,7 @@ impl Writeable for Sha256dHash { impl Readable for Sha256dHash { fn read(r: &mut R) -> Result { - use bitcoin_hashes::Hash; + use bitcoin::hashes::Hash; let buf: [u8; 32] = Readable::read(r)?; Ok(Sha256dHash::from_slice(&buf[..]).unwrap()) diff --git a/lightning/src/util/test_utils.rs b/lightning/src/util/test_utils.rs index 905a53e66..658e8b58e 100644 --- a/lightning/src/util/test_utils.rs +++ b/lightning/src/util/test_utils.rs @@ -16,7 +16,7 @@ use bitcoin::blockdata::transaction::Transaction; use bitcoin::blockdata::script::{Builder, Script}; use bitcoin::blockdata::block::Block; use bitcoin::blockdata::opcodes; -use bitcoin_hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; use bitcoin::network::constants::Network; use secp256k1::{SecretKey, PublicKey}; -- 2.39.5