From 423f8379f53b7407632e7e5ae3dfd4aa6fab351b Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 19 Sep 2022 14:56:41 +0000 Subject: [PATCH] Update bindings branch to 0.0.111 and update rust-bitcoin and secp --- .github/workflows/build.yml | 4 ++-- lightning-c-bindings/Cargo.toml | 14 +++++++------- lightning-c-bindings/src/c_types/mod.rs | 8 ++++++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47382ce..4ad19c4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: run: | git clone https://github.com/rust-bitcoin/rust-lightning cd rust-lightning - git checkout 0.0.110-bindings + git checkout 0.0.111-bindings - name: Rebuild bindings without std, and check the sample app builds + links run: ./genbindings.sh ./rust-lightning false - name: Rebuild bindings, and check the sample app builds + links @@ -88,7 +88,7 @@ jobs: run: | git clone https://github.com/rust-bitcoin/rust-lightning cd rust-lightning - git checkout 0.0.110-bindings + git checkout 0.0.111-bindings - name: Rebuild bindings using Apple clang, and check the sample app builds + links run: ./genbindings.sh ./rust-lightning true - name: Rebuild bindings using upstream clang, and check the sample app builds + links diff --git a/lightning-c-bindings/Cargo.toml b/lightning-c-bindings/Cargo.toml index be1db7e..02dfc54 100644 --- a/lightning-c-bindings/Cargo.toml +++ b/lightning-c-bindings/Cargo.toml @@ -19,14 +19,14 @@ no-std = ["bitcoin/no-std", "lightning/no-std", "lightning-invoice/no-std", "cor std = ["bitcoin/std", "lightning/std", "lightning-invoice/std"] [dependencies] -bitcoin = { version = "0.28", default-features = false } -secp256k1 = { version = "0.22", features = ["global-context", "recovery"] } +bitcoin = { version = "0.29", default-features = false } +secp256k1 = { version = "0.24", features = ["global-context", "recovery"] } # Note that the following line is matched by genbindings to update the path -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.110-bindings", default-features = false } -lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.110-bindings", default-features = false } -lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.110-bindings", default-features = false } -lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.110-bindings", default-features = false } -lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.110-bindings", default-features = false } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.111-bindings", default-features = false } +lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.111-bindings", default-features = false } +lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.111-bindings", default-features = false } +lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.111-bindings", default-features = false } +lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "0.0.111-bindings", default-features = false } core2 = { version = "0.3.0", optional = true, default-features = false } diff --git a/lightning-c-bindings/src/c_types/mod.rs b/lightning-c-bindings/src/c_types/mod.rs index f706b95..3b57407 100644 --- a/lightning-c-bindings/src/c_types/mod.rs +++ b/lightning-c-bindings/src/c_types/mod.rs @@ -24,6 +24,8 @@ pub(crate) use core2::io::{self, Cursor, Read}; #[cfg(feature = "no-std")] use alloc::{boxed::Box, vec::Vec, string::String}; +use core::convert::TryFrom; + #[repr(C)] /// A dummy struct of which an instance must never exist. /// This corresponds to the Rust type `Infallible`, or, in unstable rust, `!` @@ -53,10 +55,12 @@ impl Into for u5 { pub struct WitnessVersion(u8); impl From for WitnessVersion { - fn from(o: address::WitnessVersion) -> Self { Self(o.into_num()) } + fn from(o: address::WitnessVersion) -> Self { Self(o.to_num()) } } impl Into for WitnessVersion { - fn into(self) -> address::WitnessVersion { address::WitnessVersion::from_num(self.0).expect("WitnessVersion objects must be in the range 0..=16") } + fn into(self) -> address::WitnessVersion { + address::WitnessVersion::try_from(self.0).expect("WitnessVersion objects must be in the range 0..=16") + } } #[derive(Clone)] -- 2.39.5