Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 480
bitcoin 0.32 upgrade followups#3249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
TheBlueMatt
merged 9 commits into
lightningdevkit:main
from
TheBlueMatt:2024-08-feature-cleanup-1Aug 19, 2024
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
aadf233
Fix bug in `BufReader::fill_buf` when reaching EOF
TheBlueMatt f8b7ad2
Optimize `BufReader` somewhat for the only used case
TheBlueMatt 9ca38c5
Ensure we always pass a `path` for in-workspace dependencies
TheBlueMatt 5e37074
Drop the `no-std` feature from BP and drop feature implications
TheBlueMatt 31a9cd2
Drop the `no-std` feature from `lightning-invoice`
TheBlueMatt 51f5bc8
Drop the `no-std` feature from `lightning-rapid-gossip-sync`
TheBlueMatt e212d74
Somewhat clean up `ci-tests.sh` and sort by `RUSTFLAGS`
TheBlueMatt 3fe4ef9
Drop the `_test_vectors` feature in favor of a `cfg` flag
TheBlueMatt 8049f99
Remove the `std` feature implications from the `lightning` crate
TheBlueMatt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -66,6 +66,7 @@ impl<W: Write> Writer for W { | ||
| } | ||
| } | ||
| // TODO: Drop this entirely if rust-bitcoin releases a version bump with https://github.com/rust-bitcoin/rust-bitcoin/pull/3173 | ||
| /// Wrap buffering support for implementations of Read. | ||
| /// A [`Read`]er which keeps an internal buffer to avoid hitting the underlying stream directly for | ||
| /// every read, implementing [`BufRead`]. | ||
| @@ -92,17 +93,21 @@ impl<'a, R: Read> BufReader<'a, R> { | ||
| impl<'a, R: Read> Read for BufReader<'a, R> { | ||
| #[inline] | ||
| fn read(&mut self, output: &mut [u8]) -> io::Result<usize> { | ||
| let input = self.fill_buf()?; | ||
| let count = cmp::min(input.len(), output.len()); | ||
| output[..count].copy_from_slice(&input[..count]); | ||
| self.consume(count); | ||
| Ok(count) | ||
| if output.is_empty() { return Ok(0); } | ||
tnull marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| let mut offset = 0; | ||
| if !self.is_consumed { | ||
| output[0] = self.buf[0]; | ||
| self.is_consumed = true; | ||
| offset = 1; | ||
| } | ||
| self.inner.read(&mut output[offset..]).map(|len| len + offset) | ||
| } | ||
| } | ||
| impl<'a, R: Read> BufRead for BufReader<'a, R> { | ||
| #[inline] | ||
| fn fill_buf(&mut self) -> io::Result<&[u8]> { | ||
| debug_assert!(false, "rust-bitcoin doesn't actually use this"); | ||
| if self.is_consumed { | ||
| let count = self.inner.read(&mut self.buf[..])?; | ||
| debug_assert!(count <= 1, "read gave us a garbage length"); | ||
| @@ -111,11 +116,16 @@ impl<'a, R: Read> BufRead for BufReader<'a, R> { | ||
| self.is_consumed = count == 0; | ||
| } | ||
| Ok(&self.buf[..]) | ||
| if self.is_consumed { | ||
| Ok(&[]) | ||
| } else { | ||
| Ok(&self.buf[..]) | ||
| } | ||
| } | ||
| #[inline] | ||
| fn consume(&mut self, amount: usize) { | ||
| debug_assert!(false, "rust-bitcoin doesn't actually use this"); | ||
| if amount >= 1 { | ||
| debug_assert_eq!(amount, 1, "Can only consume one byte"); | ||
| debug_assert!(!self.is_consumed, "Cannot consume more than had been read"); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.