Skip to content

Commit 84013c2

Browse files
committed
[bindings] Use global context for secp256k1
Note that this uses rust-bitcoin/rust-secp256k1#279
1 parent fe98025 commit 84013c2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

c-bindings-gen/src/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
587587
/// Returns true we if can just skip passing this to C entirely
588588
fn no_arg_path_to_rust(&self, full_path: &str) -> &str {
589589
if full_path == "bitcoin::secp256k1::Secp256k1" {
590-
"&bitcoin::secp256k1::Secp256k1::new()"
590+
"secp256k1::SECP256K1"
591591
} else { unimplemented!(); }
592592
}
593593

lightning-c-bindings/Cargo.toml

+5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ crate-type = ["staticlib"
1616

1717
[dependencies]
1818
bitcoin = "0.26"
19+
secp256k1 = { version = "0.20.1", features = ["global-context-less-secure"] }
1920
lightning = { version = "0.0.12", path = "../lightning" }
2021

22+
[patch.crates-io]
23+
# Rust-Secp256k1 PR 279. Should be dropped once merged.
24+
secp256k1 = { git = 'https://github.com/TheBlueMatt/rust-secp256k1', rev = '15a0d4195a20355f6b1e8f54c84eba56abc15cbd' }
25+
2126
# We eventually want to join the root workspace, but for now, the bindings generation is
2227
# a bit brittle and we don't want to hold up other developers from making changes just
2328
# because they break the bindings

0 commit comments

Comments
 (0)