Skip to content

Commit

Permalink
Merge pull request #692 from hydra-yse/ln-version-bump
Browse files Browse the repository at this point in the history
Bumping lightning and lightning-invoice versions
  • Loading branch information
hydra-yse authored Dec 19, 2023
2 parents 498a523 + 51bdd21 commit c23db0b
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 165 deletions.
124 changes: 23 additions & 101 deletions libs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions libs/sdk-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ bip21 = "0.2"
bitcoin = "0.29.2"
gl-client = { git = "https://github.com/Blockstream/greenlight.git", features = [
"permissive",
], rev = "84a66ac3c467569365285814ef5a691b5b97f60d" }
], rev = "8b664c8f8e514957dfacf66e9b5a9dc6ff15eb13" }
zbase32 = "0.1.2"
base64 = "0.13.0"
chrono = "0.4"
Expand Down Expand Up @@ -49,9 +49,9 @@ tonic = { version = "^0.8", features = [
"tls-webpki-roots",
] }
lazy_static = "^1.4.0"
lightning = "0.0.115"
lightning = "0.0.118"
# Keep in sync with version used in gl-client
lightning-invoice = "0.23.0"
lightning-invoice = "0.26.0"
log = "0.4"
once_cell = "1"
openssl = { version = "0.10", features = ["vendored"] }
Expand Down
6 changes: 3 additions & 3 deletions libs/sdk-core/src/greenlight/node_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use gl_client::signer::Signer;
use gl_client::tls::TlsConfig;
use gl_client::{node, utils};
use lightning::util::message_signing::verify;
use lightning_invoice::{RawInvoice, SignedRawInvoice};
use lightning_invoice::{RawBolt11Invoice, SignedRawBolt11Invoice};
use serde::{Deserialize, Serialize};
use strum_macros::{Display, EnumString};
use tokio::sync::{mpsc, Mutex};
Expand Down Expand Up @@ -1076,7 +1076,7 @@ impl NodeAPI for Greenlight {
Ok(verify(message.as_bytes(), signature, &pk))
}

fn sign_invoice(&self, invoice: RawInvoice) -> NodeResult<String> {
fn sign_invoice(&self, invoice: RawBolt11Invoice) -> NodeResult<String> {
let hrp_bytes = invoice.hrp.to_string().as_bytes().to_vec();
let data_bytes = invoice.data.to_base32();

Expand Down Expand Up @@ -1106,7 +1106,7 @@ impl NodeAPI for Greenlight {
let sig = &raw_result[0..64];
let recoverable_sig = RecoverableSignature::from_compact(sig, rid)?;

let signed_invoice: Result<SignedRawInvoice> = invoice.sign(|_| Ok(recoverable_sig));
let signed_invoice: Result<SignedRawBolt11Invoice> = invoice.sign(|_| Ok(recoverable_sig));
Ok(signed_invoice?.to_string())
}

Expand Down
Loading

0 comments on commit c23db0b

Please sign in to comment.