[patch.crates-io.possiblyrandom]
path = "possiblyrandom"
+[patch.crates-io]
+bitcoin = { path = "../../rust-bitcoin/bitcoin" }
+bitcoin-io = {path = "../../rust-bitcoin/io" }
+bitcoin_hashes = {path = "../../rust-bitcoin/hashes"}
+
[workspace.lints.rust.unexpected_cfgs]
level = "forbid"
# When adding a new cfg attribute, ensure that it is added to this list.
lightning-invoice = { path = "../lightning-invoice" }
lightning-rapid-gossip-sync = { path = "../lightning-rapid-gossip-sync" }
bech32 = "0.9.1"
-bitcoin = { version = "0.32.2", features = ["secp-lowmemory"] }
+#bitcoin = { version = "0.32.2", features = ["secp-lowmemory"] }
+bitcoin = { path = "../../../rust-bitcoin/bitcoin", features = ["secp-lowmemory"] }
hex = { package = "hex-conservative", version = "0.1.1", default-features = false }
afl = { version = "0.12", optional = true }
default = ["std"]
[dependencies]
-bitcoin = { version = "0.32.2", default-features = false }
+#bitcoin = { version = "0.32.2", default-features = false }
+bitcoin = { path = "../../../rust-bitcoin/bitcoin", default-features = false }
lightning = { version = "0.0.123-beta", path = "../lightning", default-features = false }
lightning-rapid-gossip-sync = { version = "0.0.123-beta", path = "../lightning-rapid-gossip-sync", default-features = false }
rpc-client = [ "serde_json", "chunked_transfer" ]
[dependencies]
-bitcoin = "0.32.2"
+#bitcoin = "0.32.2"
+bitcoin = { path = "../../../rust-bitcoin/bitcoin" }
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 }
rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
-bitcoin = "0.32.2"
+#bitcoin = "0.32.2"
+bitcoin = { path = "../../../rust-bitcoin/bitcoin" }
lightning = { version = "0.0.123-beta", path = "../lightning" }
[lints]
lightning = { version = "0.0.123-beta", path = "../lightning", default-features = false }
secp256k1 = { version = "0.28.0", default-features = false, features = ["recovery", "alloc"] }
serde = { version = "1.0.118", optional = true }
-bitcoin = { version = "0.32.2", default-features = false }
+#bitcoin = { version = "0.32.2", default-features = false }
+bitcoin = { path = "../../../rust-bitcoin/bitcoin", default-features = false }
[dev-dependencies]
lightning = { version = "0.0.123-beta", path = "../lightning", default-features = false, features = ["_test_utils"] }
rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
-bitcoin = "0.32.2"
+#bitcoin = "0.32.2"
+bitcoin = { path = "../../../rust-bitcoin/bitcoin" }
lightning = { version = "0.0.123-beta", path = "../lightning" }
tokio = { version = "1.35", features = [ "rt", "sync", "net", "time" ] }
rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
-bitcoin = "0.32.2"
+#bitcoin = "0.32.2"
+bitcoin = { path = "../../../rust-bitcoin/bitcoin" }
lightning = { version = "0.0.123-beta", path = "../lightning" }
[target.'cfg(windows)'.dependencies]
[dev-dependencies]
lightning = { version = "0.0.123-beta", path = "../lightning", features = ["_test_utils"] }
-bitcoin = { version = "0.32.2", default-features = false }
+#bitcoin = { version = "0.32.2", default-features = false }
+bitcoin = { path = "../../../rust-bitcoin/bitcoin", default-features = false }
[lints]
workspace = true
[dependencies]
lightning = { version = "0.0.123-beta", path = "../lightning", default-features = false }
-bitcoin = { version = "0.32.2", default-features = false }
+#bitcoin = { version = "0.32.2", default-features = false }
+bitcoin = { path = "../../../rust-bitcoin/bitcoin", default-features = false }
[target.'cfg(ldk_bench)'.dependencies]
criterion = { version = "0.4", optional = true, default-features = false }
[dependencies]
lightning = { version = "0.0.123-beta", path = "../lightning", default-features = false, features = ["std"] }
-bitcoin = { version = "0.32.2", default-features = false }
+#bitcoin = { version = "0.32.2", default-features = false }
+bitcoin = { path = "../../../rust-bitcoin/bitcoin", default-features = false }
bdk-macros = "0.6"
futures = { version = "0.3", optional = true }
esplora-client = { version = "0.7", default-features = false, optional = true }
[dependencies]
bech32 = { version = "0.9.1", default-features = false }
bitcoin = { version = "0.32.2", default-features = false, features = ["secp-recovery"] }
+# bitcoin = { path = "../../../rust-bitcoin/bitcoin", default-features = false, features = ["secp-recovery"] }
hashbrown = { version = "0.13", optional = true, default-features = false }
possiblyrandom = { version = "0.2", optional = true, default-features = false }
[dev-dependencies.bitcoin]
version = "0.32.2"
+# path = "../../../rust-bitcoin/bitcoin"
default-features = false
features = ["bitcoinconsensus", "secp-recovery"]
//! [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
use crate::prelude::*;
-use crate::io::{self, Read, Seek, Write};
+use crate::io::{self, Read, Seek, Take, Write, BufRead};
use crate::io_extras::{copy, sink};
use core::hash::Hash;
use crate::sync::{Mutex, RwLock};
bytes_read: u64,
total_bytes: u64,
}
+
impl<'a, R: Read> FixedLengthReader<'a, R> {
/// Returns a new [`FixedLengthReader`].
pub fn new(read: &'a mut R, total_bytes: u64) -> Self {
}
}
+// impl<'a, R: Read> Read for &mut FixedLengthReader<'a, R> {
+// #[inline]
+// fn read(&mut self, buf: &mut [u8]) -> Result<usize, io::Error> {
+// (**self).read(buf)
+// }
+//
+// #[inline]
+// fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), io::Error> {
+// (**self).read_exact(buf)
+// }
+// }
+
impl<'a, R: Read> LengthRead for FixedLengthReader<'a, R> {
#[inline]
fn total_bytes(&self) -> u64 {
}
}
+// impl<R: Read> Read for &mut ReadTrackingReader<R> {
+// #[inline]
+// fn read(&mut self, buf: &mut [u8]) -> Result<usize, io::Error> {
+// (**self).read(buf)
+// }
+//
+// #[inline]
+// fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), io::Error> {
+// (**self).read_exact(buf)
+// }
+// }
+
+// impl<R: Read> Read for &mut &mut ReadTrackingReader<R> {
+// #[inline]
+// fn read(&mut self, buf: &mut [u8]) -> Result<usize, io::Error> {
+// (**self).read(buf)
+// }
+//
+// #[inline]
+// fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), io::Error> {
+// (**self).read_exact(buf)
+// }
+// }
+
/// A trait that various LDK types implement allowing them to be written out to a [`Writer`].
///
/// This is not exported to bindings users as we only export serialization to/from byte arrays instead
where Self: Sized
{
/// Reads a `Self` in from the given [`Read`].
- fn read<R: Read>(reader: &mut R) -> Result<Self, DecodeError>;
+ fn read<R: BufRead>(reader: &mut R) -> Result<Self, DecodeError>;
}
/// A trait that various LDK types implement allowing them to be read in from a
}
impl Readable for $bitcoin_type {
- fn read<R: Read>(r: &mut R) -> Result<Self, DecodeError> {
+ fn read<R: BufRead>(r: &mut R) -> Result<Self, DecodeError> {
match consensus::encode::Decodable::consensus_decode(r) {
Ok(t) => Ok(t),
Err(consensus::encode::Error::Io(ref e)) if e.kind() == io::ErrorKind::UnexpectedEof => Err(DecodeError::ShortRead),