Wallets/unhashed_description (#870)
* new argument: unhashed_description * accept in api * set unhashed_description for memo case * bolt11.py: dont be like CLN, accept the hash * send hash to lnd in b64 * fix cln * skip descr_hash for cln * skip * format
This commit is contained in:
@@ -93,6 +93,8 @@ class SparkWallet(Wallet):
|
||||
amount: int,
|
||||
memo: Optional[str] = None,
|
||||
description_hash: Optional[bytes] = None,
|
||||
unhashed_description: Optional[bytes] = None,
|
||||
**kwargs,
|
||||
) -> InvoiceResponse:
|
||||
label = "lbs{}".format(random.random())
|
||||
checking_id = label
|
||||
@@ -102,7 +104,13 @@ class SparkWallet(Wallet):
|
||||
r = await self.invoicewithdescriptionhash(
|
||||
msatoshi=amount * 1000,
|
||||
label=label,
|
||||
description_hash=hashlib.sha256(description_hash).hexdigest(),
|
||||
description_hash=description_hash.hex(),
|
||||
)
|
||||
elif unhashed_description:
|
||||
r = await self.invoicewithdescriptionhash(
|
||||
msatoshi=amount * 1000,
|
||||
label=label,
|
||||
description_hash=hashlib.sha256(unhashed_description).hexdigest(),
|
||||
)
|
||||
else:
|
||||
r = await self.invoice(
|
||||
|
||||
Reference in New Issue
Block a user