Skip to content

Commit

Permalink
fix docker and release bolt11
Browse files Browse the repository at this point in the history
  • Loading branch information
223880 committed Jun 19, 2024
1 parent cc41eb1 commit b076eff
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
$ Lightning
RUN VERSION = 0.0.123
FROM rust-Lightning
FROM rust-bitcoin
FROM bdk
RUN cargo install --git https://github.com/AreaLayer/HashPool.git --branch master --locked
RUN cargo install --git https://github.com/AreaLayer/HashPool.git --branch master --locked --features=bitcoin
RUN cargo install --git https://github.com/AreaLayer/HashPool.git --branch master --locked --features=lightning
RUN cargo install --git https://github.com/AreaLayer/HashPool.git --branch master --locked --features=bitcoin,lightning
COPY --chown=user:group --from=rust-Lightning /usr/local/cargo/bin/lightning-hashpool /usr/local/bin/lightning-hashpool
42 changes: 42 additions & 0 deletions src/lightning/payments/bolt11.rs
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
use crate::util::error::Error;
use std::str::FromStr;
use std::fmt;

use lightning_invoice::Invoice;
use lightning_invoice::InvoiceError;
use lightning_invoice::InvoiceFeatures;
use lightning_invoice::BOLT11;
use lightning_invoice::InvoiceSignature;
use lightning_invoice::InvoiceSignatureHashType;

pub struct LightningInvoice {
pub invoice: Invoice,
pub signature: InvoiceSignature,
}

impl LightningInvoice {
pub fn new(invoice: Invoice, signature: InvoiceSignature) -> Self {
LightningInvoice {
invoice,
signature,
}
}

pub fn get_payment_hash(&self) -> Result<[u8; 32], Error> {
let payment_hash = self.invoice.payment_hash()?;
Ok(payment_hash)
}

pub fn get_payment_secret(&self) -> Result<[u8; 32], Error> {
let payment_secret = self.invoice.payment_secret()?;
Ok(payment_secret)
}

pub fn get_description(&self) -> Result<String, Error> {
let description = self.invoice.description();
Ok(description)
}

pub fn get_description_hash(&self) -> Result<[u8; 32], Error> {
let description_hash = self.invoice.description_hash()?;
Ok(description_hash)
}

0 comments on commit b076eff

Please sign in to comment.