-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
223880
committed
Jun 19, 2024
1 parent
cc41eb1
commit b076eff
Showing
2 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |