Skip to content

Commit bee9a1e

Browse files
authored
Merge pull request #1012 from TheBlueMatt/2021-07-bump-deps
Bump dependencies to bitcoin 0.27 and bech32 0.8
2 parents fe4b0b8 + 0671ca6 commit bee9a1e

File tree

13 files changed

+30
-22
lines changed

13 files changed

+30
-22
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
1.41.0,
1717
# 1.45.2 is MSRV for lightning-net-tokio, lightning-block-sync, and coverage generation
1818
1.45.2,
19-
# 1.49.0 is MSRV for no_std builds using hashbrown
20-
1.49.0]
19+
# 1.47.0 will be the MSRV for no_std builds using hashbrown once core2 is updated
20+
1.47.0]
2121
include:
2222
- toolchain: stable
2323
build-net-tokio: true
@@ -41,8 +41,8 @@ jobs:
4141
build-net-tokio: true
4242
build-no-std: false
4343
coverage: true
44-
- toolchain: 1.49.0
45-
build-no-std: true
44+
- toolchain: 1.47.0
45+
build-no-std: false
4646
runs-on: ${{ matrix.platform }}
4747
steps:
4848
- name: Checkout source code

fuzz/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ stdin_fuzz = []
1919
[dependencies]
2020
afl = { version = "0.4", optional = true }
2121
lightning = { path = "../lightning", features = ["fuzztarget"] }
22-
bitcoin = { version = "0.26", features = ["fuzztarget", "secp-lowmemory"] }
22+
bitcoin = { version = "0.27", features = ["fuzztarget", "secp-lowmemory"] }
2323
hex = "0.3"
2424
honggfuzz = { version = "0.5", optional = true }
2525
libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git", optional = true }

lightning-background-processor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Utilities to perform required background tasks for Rust Lightning.
1010
edition = "2018"
1111

1212
[dependencies]
13-
bitcoin = "0.26"
13+
bitcoin = "0.27"
1414
lightning = { version = "0.0.99", path = "../lightning", features = ["allow_wallclock_use"] }
1515
lightning-persister = { version = "0.0.99", path = "../lightning-persister" }
1616

lightning-block-sync/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ rest-client = [ "serde", "serde_json", "chunked_transfer" ]
1414
rpc-client = [ "serde", "serde_json", "chunked_transfer" ]
1515

1616
[dependencies]
17-
bitcoin = "0.26"
17+
bitcoin = "0.27"
1818
lightning = { version = "0.0.99", path = "../lightning" }
1919
tokio = { version = "1.0", features = [ "io-util", "net", "time" ], optional = true }
2020
serde = { version = "1.0", features = ["derive"], optional = true }

lightning-invoice/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ keywords = [ "lightning", "bitcoin", "invoice", "BOLT11" ]
99
readme = "README.md"
1010

1111
[dependencies]
12-
bech32 = "0.7"
12+
bech32 = "0.8"
1313
lightning = { version = "0.0.99", path = "../lightning" }
1414
secp256k1 = { version = "0.20", features = ["recovery"] }
1515
num-traits = "0.2.8"
16-
bitcoin_hashes = "0.9.4"
16+
bitcoin_hashes = "0.10"
1717

1818
[dev-dependencies]
1919
lightning = { version = "0.0.99", path = "../lightning", features = ["_test_utils"] }

lightning-invoice/fuzz/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ honggfuzz_fuzz = ["honggfuzz"]
1515
honggfuzz = { version = "0.5", optional = true }
1616
afl = { version = "0.4", optional = true }
1717
lightning-invoice = { path = ".."}
18-
bech32 = "0.7"
18+
bech32 = "0.8"
1919

2020
# Prevent this from interfering with workspaces
2121
[workspace]

lightning-invoice/src/de.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,13 @@ impl FromStr for SignedRawInvoice {
250250
type Err = ParseError;
251251

252252
fn from_str(s: &str) -> Result<Self, Self::Err> {
253-
let (hrp, data) = bech32::decode(s)?;
253+
let (hrp, data, var) = bech32::decode(s)?;
254+
255+
if var == bech32::Variant::Bech32m {
256+
// Consider Bech32m addresses to be "Invalid Checksum", since that is what we'd get if
257+
// we didn't support Bech32m (which lightning does not use).
258+
return Err(ParseError::Bech32Error(bech32::Error::InvalidChecksum));
259+
}
254260

255261
if data.len() < 104 {
256262
return Err(ParseError::TooShortDataPart);

lightning-invoice/src/ser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl Display for SignedRawInvoice {
117117
let mut data = self.raw_invoice.data.to_base32();
118118
data.extend_from_slice(&self.signature.to_base32());
119119

120-
bech32::encode_to_fmt(f, &hrp, data).expect("HRP is valid")?;
120+
bech32::encode_to_fmt(f, &hrp, data, bech32::Variant::Bech32).expect("HRP is valid")?;
121121

122122
Ok(())
123123
}

lightning-net-tokio/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ For Rust-Lightning clients which wish to make direct connections to Lightning P2
1111
edition = "2018"
1212

1313
[dependencies]
14-
bitcoin = "0.26"
14+
bitcoin = "0.27"
1515
lightning = { version = "0.0.99", path = "../lightning" }
1616
tokio = { version = "1.0", features = [ "io-util", "macros", "rt", "sync", "net", "time" ] }
1717

lightning-persister/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Utilities to manage Rust-Lightning channel data persistence and retrieval.
1212
unstable = ["lightning/unstable"]
1313

1414
[dependencies]
15-
bitcoin = "0.26"
15+
bitcoin = "0.27"
1616
lightning = { version = "0.0.99", path = "../lightning" }
1717
libc = "0.2"
1818

0 commit comments

Comments
 (0)