mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-03-15 15:39:09 +01:00
Remove explicit dependency on hex-conservative
The `hex` crate is re-exported by `rust-bitcoin` so we can get it from there instead of explicitly depending on it. Doing so reduces the maintenance burden and helps reduce the likelyhood of getting two versions in the dependency graph.
This commit is contained in:
parent
fd8f4ace7b
commit
aeee8fe31e
14 changed files with 9 additions and 16 deletions
|
@ -23,7 +23,6 @@ lightning-invoice = { path = "../lightning-invoice" }
|
|||
lightning-rapid-gossip-sync = { path = "../lightning-rapid-gossip-sync" }
|
||||
bech32 = "0.9.1"
|
||||
bitcoin = { version = "0.31.2", features = ["secp-lowmemory"] }
|
||||
hex = { package = "hex-conservative", version = "0.1.1", default-features = false }
|
||||
|
||||
afl = { version = "0.12", optional = true }
|
||||
honggfuzz = { version = "0.5", optional = true, default-features = false }
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
// licenses.
|
||||
|
||||
extern crate bitcoin;
|
||||
extern crate hex;
|
||||
extern crate lightning;
|
||||
extern crate lightning_rapid_gossip_sync;
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ rpc-client = [ "serde_json", "chunked_transfer" ]
|
|||
|
||||
[dependencies]
|
||||
bitcoin = "0.31.2"
|
||||
hex = { package = "hex-conservative", version = "0.1.1", default-features = false }
|
||||
lightning = { version = "0.0.123-beta", path = "../lightning" }
|
||||
tokio = { version = "1.35", features = [ "io-util", "net", "time", "rt" ], optional = true }
|
||||
serde_json = { version = "1.0", optional = true }
|
||||
|
|
|
@ -294,8 +294,8 @@ pub(crate) mod tests {
|
|||
use super::*;
|
||||
use bitcoin::constants::genesis_block;
|
||||
use bitcoin::hashes::Hash;
|
||||
use bitcoin::hex::DisplayHex;
|
||||
use bitcoin::network::Network;
|
||||
use hex::DisplayHex;
|
||||
use serde_json::value::Number;
|
||||
use serde_json::Value;
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ bitcoin = { version = "0.31.2", default-features = false }
|
|||
|
||||
[dev-dependencies]
|
||||
lightning = { version = "0.0.123-beta", path = "../lightning", default-features = false, features = ["_test_utils"] }
|
||||
hex = { package = "hex-conservative", version = "0.1.1", default-features = false }
|
||||
serde_json = { version = "1"}
|
||||
hashbrown = { version = "0.13", default-features = false }
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ extern crate bech32;
|
|||
extern crate lightning;
|
||||
extern crate lightning_invoice;
|
||||
extern crate secp256k1;
|
||||
extern crate hex;
|
||||
|
||||
use bitcoin::{PubkeyHash, ScriptHash, WitnessVersion};
|
||||
use bitcoin::hashes::hex::FromHex;
|
||||
|
|
|
@ -45,7 +45,6 @@ bitcoin = { version = "0.31.2", default-features = false, features = ["secp-reco
|
|||
|
||||
hashbrown = { version = "0.13", optional = true, default-features = false }
|
||||
possiblyrandom = { version = "0.2", optional = true, default-features = false }
|
||||
hex = { package = "hex-conservative", version = "0.1.1", default-features = false }
|
||||
regex = { version = "1.5.6", optional = true }
|
||||
backtrace = { version = "0.3", optional = true }
|
||||
|
||||
|
|
|
@ -65,7 +65,6 @@ pub extern crate bitcoin;
|
|||
#[cfg(any(test, feature = "std"))]
|
||||
extern crate core;
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(any(test, feature = "_test_utils"))] extern crate regex;
|
||||
|
||||
#[cfg(not(feature = "std"))] extern crate core2;
|
||||
|
|
|
@ -10274,6 +10274,7 @@ mod tests {
|
|||
use bitcoin::sighash::EcdsaSighashType;
|
||||
use bitcoin::hashes::hex::FromHex;
|
||||
use bitcoin::hash_types::Txid;
|
||||
use bitcoin::hex::DisplayHex;
|
||||
use bitcoin::secp256k1::Message;
|
||||
use crate::sign::{ChannelDerivationParameters, HTLCDescriptor, ecdsa::EcdsaChannelSigner};
|
||||
use crate::ln::PaymentPreimage;
|
||||
|
@ -10283,7 +10284,6 @@ mod tests {
|
|||
use crate::util::logger::Logger;
|
||||
use crate::sync::Arc;
|
||||
use core::str::FromStr;
|
||||
use hex::DisplayHex;
|
||||
|
||||
// Test vectors from BOLT 3 Appendices C and F (anchors):
|
||||
let feeest = TestFeeEstimator{fee_est: 15000};
|
||||
|
|
|
@ -3267,7 +3267,7 @@ impl_writeable_msg!(GossipTimestampFilter, {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use bitcoin::{Amount, Transaction, TxIn, ScriptBuf, Sequence, Witness, TxOut};
|
||||
use hex::DisplayHex;
|
||||
use bitcoin::hex::DisplayHex;
|
||||
use crate::ln::types::{ChannelId, PaymentPreimage, PaymentHash, PaymentSecret};
|
||||
use crate::ln::features::{ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
|
||||
use crate::ln::msgs::{self, FinalOnionHopData, OnionErrorPacket, CommonOpenChannelFields, CommonAcceptChannelFields, TrampolineOnionPacket};
|
||||
|
|
|
@ -17,13 +17,13 @@ use crate::ln::wire;
|
|||
use bitcoin::hashes::{Hash, HashEngine};
|
||||
use bitcoin::hashes::sha256::Hash as Sha256;
|
||||
|
||||
use bitcoin::hex::DisplayHex;
|
||||
|
||||
use bitcoin::secp256k1::Secp256k1;
|
||||
use bitcoin::secp256k1::{PublicKey,SecretKey};
|
||||
use bitcoin::secp256k1::ecdh::SharedSecret;
|
||||
use bitcoin::secp256k1;
|
||||
|
||||
use hex::DisplayHex;
|
||||
|
||||
use crate::crypto::chacha20poly1305rfc::ChaCha20Poly1305RFC;
|
||||
use crate::crypto::utils::hkdf_extract_expand_twice;
|
||||
use crate::util::ser::VecWriter;
|
||||
|
|
|
@ -200,7 +200,7 @@ mod tests {
|
|||
sha256::Hash as Sha256,
|
||||
};
|
||||
use bitcoin::secp256k1::PublicKey;
|
||||
use hex::DisplayHex;
|
||||
use bitcoin::hex::DisplayHex;
|
||||
|
||||
use super::ChannelId;
|
||||
use crate::ln::channel_keys::RevocationBasepoint;
|
||||
|
|
|
@ -158,10 +158,10 @@ impl TryFrom<NodeId> for PublicKey {
|
|||
}
|
||||
|
||||
impl FromStr for NodeId {
|
||||
type Err = hex::parse::HexToArrayError;
|
||||
type Err = bitcoin::hex::parse::HexToArrayError;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
let data: [u8; PUBLIC_KEY_SIZE] = hex::FromHex::from_hex(s)?;
|
||||
let data: [u8; PUBLIC_KEY_SIZE] = bitcoin::hex::FromHex::from_hex(s)?;
|
||||
Ok(NodeId(data))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ use bitcoin::TxOut;
|
|||
use bitcoin::amount::Amount;
|
||||
use bitcoin::constants::ChainHash;
|
||||
|
||||
use hex::DisplayHex;
|
||||
use bitcoin::hex::DisplayHex;
|
||||
|
||||
use crate::events::MessageSendEvent;
|
||||
use crate::ln::chan_utils::make_funding_redeemscript_from_slices;
|
||||
|
|
Loading…
Add table
Reference in a new issue