chore: various tweaks

This commit is contained in:
Eneko Illarramendi
2020-04-16 20:58:16 +02:00
parent 490e166f75
commit dd23b20090
25 changed files with 156 additions and 99 deletions
+2 -3
View File
@@ -1,15 +1,14 @@
from base64 import urlsafe_b64encode
from uuid import uuid4
from typing import List, Optional, Union
from lnbits.db import open_ext_db
from lnbits.helpers import urlsafe_short_hash
from .models import Paywall
def create_paywall(*, wallet_id: str, url: str, memo: str, amount: int) -> Paywall:
with open_ext_db("paywall") as db:
paywall_id = urlsafe_b64encode(uuid4().bytes_le).decode('utf-8')
paywall_id = urlsafe_short_hash()
db.execute(
"""
INSERT INTO paywalls (id, wallet, url, memo, amount)