Skip to content

Commit

Permalink
[bindings] Use global context for secp256k1
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed Mar 1, 2021
1 parent 9fba7c9 commit cd0b212
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion c-bindings-gen/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
/// Returns true we if can just skip passing this to C entirely
fn no_arg_path_to_rust(&self, full_path: &str) -> &str {
if full_path == "bitcoin::secp256k1::Secp256k1" {
"&bitcoin::secp256k1::Secp256k1::new()"
"secp256k1::SECP256K1"
} else { unimplemented!(); }
}

Expand Down
5 changes: 5 additions & 0 deletions lightning-c-bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ crate-type = ["staticlib"

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

[patch.crates-io]
# Rust-Secp256k1 PR 279. Should be dropped once merged.
secp256k1 = { git = 'https://github.com/TheBlueMatt/rust-secp256k1', rev = '15a0d4195a20355f6b1e8f54c84eba56abc15cbd' }

# We eventually want to join the root workspace, but for now, the bindings generation is
# a bit brittle and we don't want to hold up other developers from making changes just
# because they break the bindings
Expand Down

0 comments on commit cd0b212

Please sign in to comment.