Skip to content

Commit

Permalink
Upgrade bech32 dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
optout21 committed Aug 22, 2024
1 parent 0d7ae86 commit c3fa2ad
Show file tree
Hide file tree
Showing 13 changed files with 473 additions and 262 deletions.
2 changes: 1 addition & 1 deletion fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ stdin_fuzz = []
lightning = { path = "../lightning", features = ["regex", "hashbrown", "_test_utils"] }
lightning-invoice = { path = "../lightning-invoice" }
lightning-rapid-gossip-sync = { path = "../lightning-rapid-gossip-sync" }
bech32 = "0.9.1"
bech32 = "0.11.0"
bitcoin = { version = "0.32.2", features = ["secp-lowmemory"] }

afl = { version = "0.12", optional = true }
Expand Down
7 changes: 4 additions & 3 deletions fuzz/src/bolt11_deser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
// licenses.

use crate::utils::test_logger;
use bech32::{u5, FromBase32, ToBase32};
use bech32::Fe32;
use bitcoin::secp256k1::{Secp256k1, SecretKey};
use lightning_invoice::{
Bolt11Invoice, RawBolt11Invoice, RawDataPart, RawHrp, RawTaggedField, TaggedField,
Bolt11Invoice, FromBase32, RawBolt11Invoice, RawDataPart, RawHrp, RawTaggedField, TaggedField,
ToBase32,
};
use std::str::FromStr;

Expand All @@ -25,7 +26,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], _out: Out) {
Err(_) => return,
};
let bech32 =
data.iter().skip(hrp_len).map(|x| u5::try_from_u8(x % 32).unwrap()).collect::<Vec<_>>();
data.iter().skip(hrp_len).map(|x| Fe32::try_from(x % 32).unwrap()).collect::<Vec<_>>();
let invoice_data = match RawDataPart::from_base32(&bech32) {
Ok(invoice) => invoice,
Err(_) => return,
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ rustdoc-args = ["--cfg", "docsrs"]
std = []

[dependencies]
bech32 = { version = "0.9.1", default-features = false }
bech32 = { version = "0.11.0", default-features = false }
lightning-types = { version = "0.1.0-beta", path = "../lightning-types", default-features = false }
serde = { version = "1.0.118", optional = true }
bitcoin = { version = "0.32.2", default-features = false, features = ["secp-recovery"] }
Expand Down
Loading

0 comments on commit c3fa2ad

Please sign in to comment.